Skip to content

Optimize CI integration test matrix by splitting bottleneck groups#7603

Merged
pelikhan merged 2 commits intomainfrom
copilot/optimize-ci-test-matrix
Dec 25, 2025
Merged

Optimize CI integration test matrix by splitting bottleneck groups#7603
pelikhan merged 2 commits intomainfrom
copilot/optimize-ci-test-matrix

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

Three test groups were dominating CI runtime: "Workflow Cache & Actions" (247s), "CLI Completion & Other" (155s), and "Workflow Misc Part 2" (151s). These are split into focused, parallelizable groups.

Changes

Workflow Cache & Actions → 3 groups:

  • Workflow Cache - Cache validation tests
  • Workflow Actions Pin Validation - SHA verification tests (16s+ each, network-bound)
  • Workflow Actions & Containers - Remaining action/container tests

CLI Completion & Other → 5 groups:

  • CLI Add & List Commands
  • CLI Update Command
  • CLI Audit & Inspect
  • CLI Completion & Other - Reduced catch-all with updated skip_pattern

Workflow Misc Part 2 → 3 groups:

  • Workflow String & Sanitization
  • Workflow Runtime & Setup
  • Workflow Misc Part 2 - Reduced catch-all with updated skip_pattern

Impact

  • Integration test groups: 26 → 33
  • Expected critical path: 247s → ~80s (67% reduction)
  • Enables better parallelization of previously monolithic test groups
Original prompt

This section details on the original issue you should resolve

<issue_title>[ci-coach] Optimize CI integration test matrix to reduce bottlenecks</issue_title>
<issue_description>## CI Optimization Proposal

Summary

This PR addresses three severe bottlenecks in the CI integration test matrix identified through analysis of recent test runs. The changes rebalance the test matrix by splitting large, slow test groups into smaller, focused groups that can complete faster.

Expected Impact: ~60% reduction in the longest-running integration test groups, reducing overall CI time.


Analysis Results

Analyzed test timing data from the most recent successful CI run:

Group Runtime Tests Issue
Workflow Cache & Actions 247.4s 348 Contains slow TestActionPinSHAsMatchVersionTags tests (16s+ each)
CLI Completion & Other 155.4s 1,023 Catch-all group with too many diverse tests
Workflow Misc Part 2 150.8s 3,997 Catch-all group with massive test count

Optimizations

1. Workflow Cache & Actions → Split into 3 Groups

Type: Matrix Rebalancing
Impact: ~165s per run (67% reduction in bottleneck)
Risk: Low

Current State:

  • Single group: "Workflow Cache & Actions" (247.4s, 348 tests)
  • Contains slow TestActionPinSHAsMatchVersionTags tests that validate action SHAs (16s+ per action)

Proposed Structure:

- name: "Workflow Cache"
  pattern: "^TestCache|TestCacheDependencies|TestCacheKey|TestValidateCache"
  
- name: "Workflow Actions Pin Validation"
  pattern: "^TestActionPinSHAsMatchVersionTags"  # Isolate slow SHA validation tests
  
- name: "Workflow Actions & Containers"
  pattern: "^TestAction[^P]|Container"  # Actions but not ActionPin tests

Rationale: TestActionPinSHAsMatchVersionTags tests are network-bound (verify GitHub tags) and run 16s+ per action. Isolating them allows other tests to complete faster in parallel.


2. CLI Completion & Other → Extract Specific Command Groups

Type: Matrix Rebalancing
Impact: ~100s per run (65% reduction)
Risk: Low

Current State:

  • Catch-all group: "CLI Completion & Other" (155.4s, 1,023 tests)
  • Contains tests for multiple CLI commands mixed together

Proposed Structure:

- name: "CLI Add & List Commands"
  pattern: "^TestAdd|^TestList"
  
- name: "CLI Update Command"
  pattern: "^TestUpdate"
  
- name: "CLI Audit & Inspect"
  pattern: "^TestAudit|^TestInspect"
  
- name: "CLI Completion & Other"  # Reduced catch-all
  skip_pattern: "...(now excludes Add|List|Update|Audit|Inspect)"

Rationale: The original catch-all contained 1,023 tests including tests for add, list, update, audit, and inspect commands. Extracting these specific command groups reduces the catch-all size and enables better parallelization.


3. Workflow Misc Part 2 → Extract String & Runtime Groups

Type: Matrix Rebalancing
Impact: ~100s per run (66% reduction)
Risk: Low

Current State:

  • Catch-all group: "Workflow Misc Part 2" (150.8s, 3,997 tests)
  • Massive catch-all for all workflow tests not matched by specific patterns

Proposed Structure:

- name: "Workflow String & Sanitization"
  pattern: "String|Sanitize|Normalize|Trim|Clean|Format"
  
- name: "Workflow Runtime & Setup"
  pattern: "Runtime|Setup|Install|Download|Version|Binary"
  
- name: "Workflow Misc Part 2"  # Reduced catch-all
  skip_pattern: "...(now excludes String/Runtime tests)"

Rationale: The catch-all contained 3,997 tests, making it the largest test group by far. Extracting string manipulation and runtime setup tests into dedicated groups reduces the catch-all size significantly.


Expected Impact

Metric Before After Improvement
Integration Groups 23 29 +6 groups for better balance
Longest Group 247.4s ~80s (est.) 67% faster
Second Longest 155.4s ~50s (est.) 68% faster
Third Longest 150.8s ~50s (est.) 67% faster

Estimated Total Savings: ~165s in critical path per CI run


Validation Status

⚠️ Note: This PR was created in an environment without Go/make available. The YAML syntax has been manually validated for correctness.

Manual Validation Performed:

  • ✅ YAML syntax checked for formatting consistency
  • ✅ Pattern syntax verified against existing working patterns
  • ✅ Skip pattern updated to include all new extracted groups
  • ✅ Group names follow existing naming conventions
  • ✅ All test patterns are non-overlapping

Required Post-Merge Validation:

  • Monitor first CI run after merge for correct test distribution
  • Verify no tests are skipped or duplicated
  • Confirm runtime improvements match estimates
  • Check that new groups have balanced execution times

Testing Plan

  1. **Verify workf...

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Split three large test groups into smaller, focused groups:

1. Split "Workflow Cache & Actions" (247.4s) into 3 groups:
   - Workflow Cache
   - Workflow Actions Pin Validation (isolates slow SHA tests)
   - Workflow Actions & Containers

2. Split "CLI Completion & Other" (155.4s) into 5 groups:
   - CLI Add & List Commands
   - CLI Update Command
   - CLI Audit & Inspect
   - CLI Completion & Other (reduced catch-all)

3. Split "Workflow Misc Part 2" (150.8s) into 3 groups:
   - Workflow String & Sanitization
   - Workflow Runtime & Setup
   - Workflow Misc Part 2 (reduced catch-all)

Total groups increased from 26 to 33 for better parallelization.
Expected impact: ~60% reduction in longest-running groups.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize CI integration test matrix to reduce bottlenecks Optimize CI integration test matrix by splitting bottleneck groups Dec 25, 2025
Copilot AI requested a review from mnkiefer December 25, 2025 08:05
@pelikhan pelikhan marked this pull request as ready for review December 25, 2025 10:52
@pelikhan pelikhan merged commit 9e54901 into main Dec 25, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/optimize-ci-test-matrix branch December 25, 2025 10:53
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.

[ci-coach] Optimize CI integration test matrix to reduce bottlenecks

3 participants