Eliminate 35% test duplication in CI integration matrix using skip patterns #6640
+10
−1
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.
Catch-all test groups with
pattern: ""were running ALL tests in their packages, including 3,480 tests (35.4%) already executed by specific pattern groups. This wasted 114s per CI run.Changes
Matrix Configuration
skip_patternfield to 4 catch-all groups:CLI Completion & Safe Inputs: excludes 13 specific CLI patternsParser Location & Validation: excludes 4 remote fetch patternsWorkflow Misc Part 2: excludes 45+ workflow patternsCMD Tests: empty skip (no overlaps)Test Execution Logic
-skipflag whenskip_patternis defined-rununchangedskip_patternImplementation
Impact
Original prompt
This section details on the original issue you should resolve
<issue_title>[ci-coach] Eliminate massive test duplication in CI integration tests</issue_title>
<issue_description>## Critical CI Optimization: Eliminate Test Duplication
This PR fixes a critical issue where 3,480 tests (35.4% of all tests) are running in multiple matrix groups, wasting 1.9 minutes of CI time per run.
🔍 Problem Discovery
While analyzing CI performance for workflow run §20269295629, I discovered that the previous optimization (run #16) did not achieve its expected results. Instead of improving from 76.8s → 46s, the max integration group duration increased to 105.5s.
Root Cause Analysis:
The issue: Catch-all groups with
pattern: ""run ALL tests in the package, including those already matched by specific patterns. When you usego test -run "", it runs every test. This caused tests to run in BOTH their specific groups AND in catch-all groups.💡 Solution
Add
skip_patternfield to catch-all matrix groups and update the test execution logic to use Go's-skipflag:Changes to
.github/workflows/ci.yml:Updated test execution logic (lines 174-188):
skip_patternfield in matrix configuration-skipflag to exclude already-tested patterns-runas beforeAdded skip patterns to catch-all groups:
📊 Expected Impact
Before (Current State):
After (With This Fix):
🔧 Technical Details
How
-skipWorks:Example for CLI Completion & Safe Inputs:
This ensures tests like
TestProgressFlagSignature(30s) only run in "CLI Progress Flag" group, not in both "CLI Progress Flag" AND "CLI Completion & Safe Inputs".✅ Validation Plan
The fix will be validated by:
Expected first-run results:
📈 Success Metrics
🎯 Context
This optimization was discovered by CI Optimization Coach workflow run #17. The previous optimization (run #16) attempted to fix matrix imbalance but inadvertently maintained test duplication due to catch-all pattern behavior.
References:
Impact: High - Reduces CI time by ~2 minutes per run
Risk: Low - Uses Go's native
-skipflag, no behavioral changesMaintenance: None - Self-maintaining exclusion lists
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.