ci: shard integration tests and matrix darwin on go 1.25/1.26#65
Conversation
Splits the linux integration job into 3 shards × 2 Go versions and mirrors the darwin jobs on both supported Go versions. Test names are enumerated via `go test -list` under the integration build tag and partitioned deterministically by sorted-index modulo SHARD_TOTAL, so adding a test only reshuffles which shard owns it. Renames `test` → `test-linux` and `test-integration` → `test-integration-linux` for symmetry with the darwin jobs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe CI workflow is refactored to support flexible Go versions and parallel test execution. The Linux unit test job is renamed to ChangesCI workflow test sharding and Go version parameterization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
120-126: ⚡ Quick winHandle empty linux shard before building
-runregex.If
selectedis empty, the generated pattern becomes^()$, which is brittle and harder to reason about. Add an explicit empty-shard guard (as done in the darwin shard) for consistency and predictable behavior.Suggested patch
selected=$(echo "$tests" | awk -v s="$SHARD_INDEX" -v t="$SHARD_TOTAL" \ '{ if ((NR - 1) % t == (s - 1)) print }') echo "Shard ${SHARD_INDEX}/${SHARD_TOTAL} will run:" echo "$selected" + if [ -z "$selected" ]; then + echo "shard is empty; nothing to run" + exit 0 + fi pattern="^($(echo "$selected" | paste -sd '|' -))$" go test -race -count=1 -tags=integration -timeout=15m \ -run "$pattern" ./test/integration/...🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml around lines 120 - 126, The linux shard can produce an empty $selected which yields a brittle pattern "^()$"; add the same empty-shard guard used in the darwin shard: after computing selected, check if it is empty (test -z "$selected"), and if so print a message like "Shard X/Y has no tests, skipping" and exit successfully before constructing pattern or invoking go test -run; ensure you reference the existing variables $selected, $SHARD_INDEX, $SHARD_TOTAL and keep the rest of the go test invocation unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 120-126: The linux shard can produce an empty $selected which
yields a brittle pattern "^()$"; add the same empty-shard guard used in the
darwin shard: after computing selected, check if it is empty (test -z
"$selected"), and if so print a message like "Shard X/Y has no tests, skipping"
and exit successfully before constructing pattern or invoking go test -run;
ensure you reference the existing variables $selected, $SHARD_INDEX,
$SHARD_TOTAL and keep the rest of the go test invocation unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d3e9e9b7-27dc-4d75-ba16-a5514c435e05
📒 Files selected for processing (1)
.github/workflows/ci.yml
Summary
test→test-linuxandtest-integration→test-integration-linuxfor symmetry with the darwin jobs.test-darwinandtest-integration-darwinover Go 1.25 and 1.26 (previously 1.25 only).go test -listunder theintegrationbuild tag and partitioned by sorted-index moduloSHARD_TOTAL, so adding a test only reshuffles which shard owns it. Apple-container tests are already build-tagged darwin/arm64, so they don't leak into linux shards; the darwin shard filters to^TestAppleContainer_before partitioning.Wall-clock on the last successful run was ~5m27s for linux integration. With 3 shards we expect ~2m per shard (~3m saved). Critical path remains
test-darwinat ~10m (SwiftPM build dominates) — now exercising both Go versions in parallel.Test plan
test-integration-linuxlegs (go × shard) and 6test-integration-darwinlegs.test-darwin (1.26)passes alongsidetest-darwin (1.25).🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Note: These changes are internal infrastructure improvements with no direct impact on end-user functionality.