[ci-coach] Optimize CI by fixing duplicate test execution in unit and integration jobs#8176
Merged
[ci-coach] Optimize CI by fixing duplicate test execution in unit and integration jobs#8176
Conversation
…tion - Add //go:build integration to run_command_test.go (TestProgressFlagSignature: 30.26s) - Add //go:build integration to compile_command_test.go (TestCompileWorkflows: 10.24s) - Add //go:build integration to mcp_inspect_headers_test.go (TestConnectHTTPMCPServer: 20s) These tests are already isolated in dedicated integration matrix groups but were running in BOTH the unit test job and integration jobs, causing ~60s of duplicate test execution per CI run. Expected impact: - Unit test time: 110s → 50s (45% reduction) - Integration test time: No change (tests already in matrix) - Net savings: ~60 seconds per run (~100 minutes/day) Fixes duplicate test execution identified by CI Coach workflow run #34
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CI Optimization: Fix Duplicate Test Execution
Summary
This PR eliminates duplicate test execution by properly tagging slow integration tests. Currently, three test files containing ~60 seconds of slow tests are running in both the unit test job and the integration test job, causing unnecessary duplication.
Problem Identified
Issue: Three test files without
//go:build integrationtags are running in both jobs:pkg/cli/run_command_test.go(containsTestProgressFlagSignature- 30.26s)pkg/cli/compile_command_test.go(containsTestCompileWorkflows_EmptyMarkdownFiles- 10.24s)pkg/cli/mcp_inspect_headers_test.go(containsTestConnectHTTPMCPServertests - 20s combined)Current Behavior:
Root Cause: The integration matrix was properly configured with specific groups for these slow tests:
TestProgressFlagSignatureTestCompileWorkflows_EmptyMarkdownFilesTestConnectHTTPMCPServerHowever, the test files lacked the
//go:build integrationtag, so the unit test job (which uses-tags '!integration') couldn't exclude them.Changes Made
Added
//go:build integrationbuild tags to three test files:Files Modified:
pkg/cli/run_command_test.gopkg/cli/compile_command_test.gopkg/cli/mcp_inspect_headers_test.goExpected Impact
Unit Test Time Reduction: ~60 seconds (45% reduction from 110s → 50s)
TestProgressFlagSignature(30.26s)TestCompileWorkflows_EmptyMarkdownFiles(10.24s)TestConnectHTTPMCPServer_WithHeaders(10.01s)TestConnectHTTPMCPServer_NoHeaders(10.00s)Integration Test Time: No change (tests already in matrix with dedicated groups)
Net CI Speedup: ~60 seconds per run
Cost Savings:
Risk: Low
Validation
The changes ensure:
-tags '!integration')CI Structure Analysis
The CI workflow is already very well optimized:
-parallel=8for good CPU utilizationThis PR addresses the only significant inefficiency found: duplicate test execution.
Testing Plan
Metrics Baseline
Current state (from analysis of 100 recent runs):
Expected after merge:
References:
/tmp/gh-aw/cache-memory/ci-coach/last-analysis.json