Skip to content

ci: make test binaries faster to build - #11735

Merged
sipsma merged 2 commits into
dagger:mainfrom
sipsma:faster-test-build
Jan 24, 2026
Merged

sipsma merged 2 commits into
dagger:mainfrom
sipsma:faster-test-build

Conversation

@sipsma

@sipsma sipsma commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

We were running all tests with -race, which means that we don't hit earlier go build cache and is generally quite slow to build. It also is not incredibly valuable in that it applies to the client side of integ tests, which isn't the main point of the integ tests.

You could see this in telemetry because there was often a large gap between the start of the withExec for go test ... and the actual start of spans for tests.

  • Some of them are as much as ~1m30s (example), seems in particular when we hit an engine with fresh cache

This was exacerbated by the fact that we defaulted to running go test against ./..., which re-built and re-ran a number of test packages that never actually got executed.

This change updates us to only run against ./... and with -race in testBase. Every other suite doesn't use -race and is package specific.

Also snuck in a fix to break TestCgroups (which is archaic) to TestProvision and TestTelemetry as separate checks.

Comment on lines +2 to +3
let testSpecific(run: [String!]!, ebpfProgs: [String!], pkg: String, race: Boolean): Void {
engineDev().test(race: race, run: run.join("|"), ebpfProgs: ebpfProgs, pkg: pkg ?? "./core/integration")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: You can set default values in args, and make them required on the receiving side which is handy for cases like this:

Suggested change
let testSpecific(run: [String!]!, ebpfProgs: [String!], pkg: String, race: Boolean): Void {
engineDev().test(race: race, run: run.join("|"), ebpfProgs: ebpfProgs, pkg: pkg ?? "./core/integration")
let testSpecific(run: [String!]!, ebpfProgs: [String!], pkg: String! = "./core/integration", race: Boolean): Void {
engineDev().test(race: race, run: run.join("|"), ebpfProgs: ebpfProgs, pkg: pkg)

On the calling side, the type for the pkg arg is optional (String).

Comment on lines +6 to +7
let testSkip(skip: [String!]!, ebpfProgs: [String!], pkg: String, race: Boolean): Void {
engineDev().test(race: race, skip: skip.join("|"), ebpfProgs: ebpfProgs, pkg: pkg ?? "./core/integration")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let testSkip(skip: [String!]!, ebpfProgs: [String!], pkg: String, race: Boolean): Void {
engineDev().test(race: race, skip: skip.join("|"), ebpfProgs: ebpfProgs, pkg: pkg ?? "./core/integration")
let testSkip(skip: [String!]!, ebpfProgs: [String!], pkg: String! = "./core/integration", race: Boolean): Void {
engineDev().test(race: race, skip: skip.join("|"), ebpfProgs: ebpfProgs, pkg: pkg)

We were running all tests with -race, which means that we don't hit
earlier go build cache and is generally quite slow to build. It also
is not incredibly valuable in that it applies to the client side of
integ tests, which isn't the main point of the integ tests.

You could see this in telemetry because there was often a large gap
between the start of the withExec for `go test ...` and the actual start
of spans for tests.

This was exacerbated by the fact that we defaulted to running go test
against `./...`, which re-built and re-ran a number of test packages
that never actually got executed.

This change updates us to only run against `./...` and with `-race` in
`testBase`. Every other suite doesn't use `-race` and is package
specific.

Also snuck in a fix to break `TestCgroups` (which is archaic) to
TestProvision and TestTelemetry as separate workflows.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma force-pushed the faster-test-build branch from 266c905 to 9be2020 Compare January 23, 2026 23:59
@sipsma
sipsma merged commit 54ae9f9 into dagger:main Jan 24, 2026
2 checks passed
sipsma added a commit that referenced this pull request Oct 8, 2026
The TestClientGenerator suite was deleted from core/integration in the
workspace overlay and export change (#13600). Client generation tests
are planned to move to the SDK modules, per future/sdk-tests.md. Since
then the test-split/test-client-generator check builds a dev engine and
runs go test with a selector that matches nothing:

  testing: warning: no tests to run
  ok  github.com/dagger/dagger/core/integration 0.066s [no tests to run]

Remove the check, its release-branch workflow entry, and the now-dead
skip entries in the base and package shards. A future TestClientGenerator
suite would run in the base catch-all shard by default.

Also drop the release-branch workflow entry for test-split/test-cgroups.
That check was split into test-provision and test-telemetry in #11735
and no longer exists.

Also point a helper comment that named the deleted suite at
TestGenerators, which uses the same helper.

Signed-off-by: Erik Sipsma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants