Skip to content

AI-3395: integration CI runs only integration tests - #2125

Closed
dangusev wants to merge 2 commits into
mainfrom
ai-3395-integration-only
Closed

dangusev wants to merge 2 commits into
mainfrom
ai-3395-integration-only

Conversation

@dangusev

Copy link
Copy Markdown
Contributor

Why

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.

🤖 Generated with Claude Code

@dangusev
dangusev marked this pull request as ready for review November 19, 2026 15:56
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

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.

Share

@coderabbitai coderabbitai Bot left a comment

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.

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.

Source: Path instructions

Review info

Run configuration

Commits

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.

Comment thread .github/workflows/integration.yml Resolved
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.
@dangusev
dangusev force-pushed the ai-3395-integration-only branch from da0abf6 to 8395c9c Compare November 19, 2026 17:09

@coderabbitai coderabbitai Bot left a comment

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.

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.”

Source: Path instructions

Review info

Run configuration

Commits

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.

@dangusev dangusev closed this Nov 19, 2026
@dangusev
dangusev deleted the ai-3395-integration-only branch November 19, 2026 17:28
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.

1 participant