Skip to content

ci(test): shorten the Test job with its own caches and no repeated lint work - #1451

Open
mbevc1 wants to merge 5 commits into
mainfrom
20261204_faster-test-job
Open

mbevc1 wants to merge 5 commits into
mainfrom
20261204_faster-test-job

Conversation

@mbevc1

@mbevc1 mbevc1 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Follows #1450. Shortens the Test job, which now sets the length of the Main and Release pipelines, without removing a check.

On run 47420088402 the Test job took 515s: 116s of go mod tidy, gofmt and go vet, 58s starting the server, 51s compiling the tests, 240s running them.

  • No repeated lint work. CI calls a new make test_integration_ci, which skips deps and vet. The Lint job now runs go vet for Linux as well as macOS and Windows, so vet still covers every platform.
  • New check: go mod tidy -diff in Lint. The Test job used to tidy silently, so drift was never reported.
  • The Test job has its own Go caches. setup-go keys one cache for every job on go.sum alone, and the first job to finish saves it, without the test builds. The Test job now has a module cache keyed on go.sum and a build cache that falls back to the previous go.sum's, both saved from main only.
  • Tests compile while the server starts (make -j2).
  • gotestsum is pinned to v1.13.0 in a separate tools/go.mod instead of @latest, and runs through go tool. Dependabot watches /tools, and Lint checks the module is tidy.
  • The Docker merge job no longer installs Go; nothing in it runs Go.

make test_integration and make test_integration_full are unchanged for local use.

Notes for review:

  • Runs on this branch do not show the full gain: the new caches exist only after the first main run saves them, so the Test job compiles cold until this merges. The Lint job is also slower until its renamed vet cache is saved on main.
  • The go directive in tools/go.mod must follow the root go.mod by hand; Dependabot does not bump it.

Checklist

  • Docs are autogenerated from CLI help — make sure the help text reflects your changes
  • Helm chart (charts/k8s-reporter/) updated, if needed. Note: these changes live in a separate PR
  • Terraform provider and related changes (terraform-provider-kosli, terraform-aws-kosli-reporter) updated, if needed

@mbevc1
mbevc1 marked this pull request as ready for review December 4, 2026 20:53
@claude

claude Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 3m 5s —— View job


Follow-up review on PR #1451

  • Fetch previous review comments and the new commits
  • Determine status of each previous finding
  • Check new commits (tools/go.mod, GOTESTSUM via go tool -modfile, etc.) for regressions
  • Post inline comments for any new issues
  • Post summary comment

@mbevc1
mbevc1 force-pushed the 20261204_faster-test-job branch from 8e56e76 to 7f35ae0 Compare December 4, 2026 20:54
@mbevc1
mbevc1 marked this pull request as draft December 4, 2026 20:54
Comment thread Makefile Resolved
Comment thread Makefile Resolved
@mbevc1
mbevc1 force-pushed the 20261204_faster-test-job branch 2 times, most recently from 570de2e to 42ec4f4 Compare December 4, 2026 21:00
@mbevc1
mbevc1 marked this pull request as ready for review December 4, 2026 21:01
Comment thread .github/workflows/test.yml Resolved
Comment thread .github/workflows/test.yml Resolved
Base automatically changed from 20261204_parallel-docker-build to main December 4, 2026 22:00
@mbevc1
mbevc1 force-pushed the 20261204_faster-test-job branch 2 times, most recently from a5b0239 to 6df0534 Compare December 4, 2026 22:08
@mbevc1
mbevc1 enabled auto-merge (squash) December 4, 2026 22:09
go install gotestsum@latest resolved a new version whenever one was
published, so a test run could change without a commit, and no cached
build of it could be relied on.
The Test job spent about 2 minutes on go mod tidy, gofmt and go vet before
any test compiled, then started the server and only afterwards compiled the
tests. It also restored setup-go's shared cache, which the first job to
finish saves and which therefore held no test builds.

- make test_integration_ci runs the full suite without deps and vet, and
  compiles the tests while the server starts.
- The Lint job now vets Linux as well as macOS and Windows, so go vet still
  covers every platform, and checks go mod tidy -diff, which CI never
  checked before (the Test job tidied silently).
- The Test job has a module cache keyed on go.sum and a build cache that
  falls back to the previous go.sum's, both saved from main only.
Nothing in the job runs Go: it merges digests, scans, attests and runs the
smoke tests in the built image. The step cost about 12s per run.
…e help

which gotestsum picked any copy on PATH ahead of the one ensure_gotestsum
installs, so the version pin could be bypassed. The path now points at go
install's own target directory.

test_integration_ci was listed in make help, although it leaves
~/.kosli.yml in place and needs GNU make 4, which macOS does not ship.
A version variable in the Makefile pinned gotestsum, but Dependabot cannot
read it, so the pin would have gone stale until someone bumped it by hand.

tools/go.mod declares gotestsum as a Go tool, with its dependency hashes in
tools/go.sum, and make runs it with go tool -modfile. Dependabot watches the
new directory, the Lint job checks the module is tidy, and the Test job's
cache keys include tools/go.sum. Being a separate module, it adds nothing to
the CLI's own go.mod.
@mbevc1
mbevc1 force-pushed the 20261204_faster-test-job branch from 25bfdd2 to ed35e82 Compare December 4, 2026 22:23

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants