You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AI-3395: integration CI runs only integration tests - #2125
Each integration job runs every test in its packages. go test -tags integration also runs the untagged unit tests, and -count=1 turns off the test cache. The CI (unit) go job already runs these unit tests on the same commit, so the integration jobs run them a second time.
How it works
integration-tagged *_test.go files of the group's packages
-> top-level test names (func TestX)
-> go test -tags integration -run '^(TestA|TestB|...)$' -skip "$SKIP" ...
untagged *_test.go files (unit tests)
-> CI (unit) go job only
The unit test files still compile into the test binary. Only their execution is left out. The per-group -skip applies as before.
Changes
.github/workflows/integration.yml: the test step builds a -run filter from the top-level tests in the group's integration-tagged files, then runs go test with it. The workflow header says that the workflow runs only these suites.
Top-level tests per group
Group
Runs here
Unit, no longer runs here
agent
10
92
store
24
153
api
173
173
router
37
105
routers
42
51
rest
37
161
These are top-level functions; a suite holds many tests. One unit suite in rest still runs: TestResolverSuite in internal/tts/voices has the same name as the tagged suite in internal/connectors/resolver.
Unit-test time per run, from CI (unit) logs: internal/session 61 s, cmd/router 11 s, internal/api 11 s. The time for internal/agent (1,148 unit tests) is unknown: its CI (unit) result came from the test cache. Unverified until this PR's run.
Risk
A test in an untagged file that needs Postgres would no longer run in CI. There are none:
Untagged files in these packages that open a store use an unreachable address (port 1) to test failures.
Untagged files that need Redis read ROUTER_REDIS_ADDR, which this workflow does not set, so they skip here already.
No testify suite has its runner in an untagged file and its methods in a tagged file, so the filter on top-level names drops no suite method.
Validation
Parsed the workflow YAML and ran the step's filter line with bash for each matrix group. The selected names match the func Test lines in the tagged files. In routers (44 lines, 42 names) and rest (39 lines, 37 names), the same name occurs in two packages.
go test was not run locally. Compare this PR's group times with recent means: store 16.2 min, agent 16.1, api 11.5, router 11.2, rest 6.4, routers 5.5.
The integration CI workflow comment now states that CI runs only the listed integration suites. The test step finds top-level test names in integration-tagged files and passes them to go test -run. It retains the existing tag, serial package execution, timeout, count, skip pattern, and package matrix settings.
Merge Risk: Low · up to 8395c
The integration CI job now runs only top-level tests from integration-tagged files. Every current integration test file uses the exact tag form the filter matches, so tests are selected as intended. If someone later adds a file with a compound build constraint, its tests would be silently skipped while the job still passes. This is low risk and mergeable, with that gap noted.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Additional comments: 1
.github/workflows/integration.yml-144-144: 1
144-144: Major · Functional Correctness · Heavy lift
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Discover compound integration build constraints.
A file with //go:build linux && integration is included by Go on this runner, but this grep does not select it. Its tests are then excluded by -run and by the untagged unit job. Other discovered tests can still make the integration job pass. Use Go-aware build-constraint discovery and check the selected tests per package. (pkg.go.dev)
As per path instructions, flag “skipped required work” and tests that pass on a broken implementation.
Reviewing files that changed from the base of the PR and between ab01365 and 9f4bbf8.
Files selected for processing: 1
.github/workflows/integration.yml
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
go test -tags integration also ran the untagged unit tests in each
package, with the test cache off. The CI (unit) go job already runs
them. The test step now gives go test a -run filter with the top-level
tests declared in the group's integration-tagged files.
The reason will be displayed to describe this comment to others. Learn more.
Additional comments: 1
.github/workflows/integration.yml-144-144: 1
144-144: Major · Functional Correctness · Heavy lift
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Include equivalent integration build constraints.
A file with //go:build linux && integration is included by Go on this runner, but this grep does not select it. Its tests are omitted from -run, while other tests can make the job pass. Select files using Go build-constraint semantics. (raw.githubusercontent.com)
As per path instructions, flag “skipped required work” and “hidden or reclassified failures.”
Reviewing files that changed from the base of the PR and between da0abf6 and 8395c9c.
Files selected for processing: 1
.github/workflows/integration.yml
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Each integration job runs every test in its packages.
go test -tags integrationalso runs the untagged unit tests, and-count=1turns off the test cache. The CI (unit)gojob already runs these unit tests on the same commit, so the integration jobs run them a second time.How it works
The unit test files still compile into the test binary. Only their execution is left out. The per-group
-skipapplies as before.Changes
.github/workflows/integration.yml: the test step builds a-runfilter from the top-level tests in the group's integration-tagged files, then runsgo testwith it. The workflow header says that the workflow runs only these suites.Top-level tests per group
These are top-level functions; a suite holds many tests. One unit suite in
reststill runs:TestResolverSuiteininternal/tts/voiceshas the same name as the tagged suite ininternal/connectors/resolver.Unit-test time per run, from CI (unit) logs:
internal/session61 s,cmd/router11 s,internal/api11 s. The time forinternal/agent(1,148 unit tests) is unknown: its CI (unit) result came from the test cache. Unverified until this PR's run.Risk
A test in an untagged file that needs Postgres would no longer run in CI. There are none:
ROUTER_REDIS_ADDR, which this workflow does not set, so they skip here already.No testify suite has its runner in an untagged file and its methods in a tagged file, so the filter on top-level names drops no suite method.
Validation
func Testlines in the tagged files. Inrouters(44 lines, 42 names) andrest(39 lines, 37 names), the same name occurs in two packages.go testwas not run locally. Compare this PR's group times with recent means: store 16.2 min, agent 16.1, api 11.5, router 11.2, rest 6.4, routers 5.5.🤖 Generated with Claude Code