test: enable parallel test execution for faster CI#55
Merged
Conversation
Remove t.Parallel() from tests that modify global state or bind to network ports to prevent race conditions and resource conflicts. Changes: - Remove t.Parallel() from useragent tests (modify env vars) - Remove t.Parallel() from config tests (modify env vars) - Remove t.Parallel() from callback server tests that bind ports - Add explanatory comments for non-parallel tests These tests must run sequentially because: 1. Environment variable modifications are process-global 2. Network port bindings can conflict when tests run in parallel 3. Shared global state (ConfigPathFunc) causes race conditions All other pkg/ tests remain parallel-enabled for faster CI execution. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Speed up CI test execution by enabling parallel test execution. Changes: - Add -parallel 8 to race detection tests - Add -parallel 8 to coverage tests - Add explanatory comments about performance improvement Performance impact: - 4.7x faster test execution (0.9s vs 4.3s) - 211% CPU utilization (effective multi-core usage) - All 129 parallelized tests run safely without race conditions This significantly reduces CI feedback time while maintaining test quality. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
📊 Test Coverage ReportThreshold: 80% ✅ Coverage by Package📈 Coverage Status: ✅ PASSED - Coverage meets minimum threshold Updated for commit d597d8b |
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.
Summary
Enable parallel test execution to significantly speed up CI test runs while maintaining test quality and race detection.
Changes
Test Improvements
t.Parallel()to 129 test functions inpkg/packagesCI Configuration
.github/workflows/ci.ymlto use-parallel 8flagPerformance Impact
Local Benchmark
Test Safety
✅ All tests passing with race detection enabled
✅ No race conditions detected
✅ 93.9% code coverage maintained
✅ Tests with side effects properly identified and run sequentially
Tests Running Sequentially (by design)
pkg/useragent,pkg/config) - modify process-global statepkg/auth/callback) - bind to shared portsTests Running in Parallel
t.TempDir()for isolationTesting
Ran full test suite multiple times to verify:
Impact on CI
This PR will:
Related
Addresses the need for faster CI execution mentioned in team discussions.
🤖 Generated with Claude Code