Add missing test patterns to CI - cover all 353 untested functions#12371
Merged
pelikhan merged 4 commits intocopilot/add-canary-go-jobfrom Jan 28, 2026
Merged
Add missing test patterns to CI - cover all 353 untested functions#12371pelikhan merged 4 commits intocopilot/add-canary-go-jobfrom
pelikhan merged 4 commits intocopilot/add-canary-go-jobfrom
Conversation
Added comprehensive test patterns to cover all 353 missing tests: - Enhanced existing CLI test groups with missing test patterns - Added 17 new CLI test groups for categorized test coverage - Added CMD Main & Entry group for main_entry_test.go tests - Enhanced Workflow test groups with missing patterns - Updated Parser test groups with missing tests - Updated skip patterns to properly exclude covered tests Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added final test patterns to ensure all 353 missing tests are covered: - Added TestNoCommandsInAdditionalCommandsWithGroups to CMD Main & Entry - Added TestImprovementComparison to Parser Remote Fetch & Cache - Added SafeOutputJobs pattern to Workflow Safe Outputs - Updated skip patterns accordingly All missing tests are now covered by CI test groups. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update ci.yml jobs to run missing tests
Add missing test patterns to CI - cover all 353 untested functions
Jan 28, 2026
Contributor
|
@copilot Ensure failing tests cause the job to fail. Do not swallow any errors in the scripts. Review all scripts in CI YAML and confirm that no error codes are being swallowed. |
- Add set -o pipefail to unit and integration test steps to capture go test exit codes when using tee - Add set -euo pipefail to all canary_go inline bash scripts for proper error handling - Improve extract-executed-tests.sh to fail when no test records are found (instead of silently succeeding with || true) - Use temporary file approach in extract-executed-tests.sh for better error detection Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Fixed in commit 9985000. Changes made: CI YAML (.github/workflows/ci.yml):
Script (scripts/extract-executed-tests.sh):
All test failures and script errors will now properly cause CI jobs to fail. |
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.
Fix CI to run all missing tests ✅
This PR updates ci.yml to ensure all 353 missing tests are executed in CI.
Problem Statement
The canary_go job detected 353 test functions (8.9% of codebase) not being executed in any CI test job, representing significant coverage gaps.
Analysis
Missing Tests Breakdown by Package
pkg/cli (288 tests - 81.6%)
The majority of missing tests were in CLI command implementations:
cmd/gh-aw (16 tests - 4.5%)
Main entry point and command structure tests:
pkg/workflow (38 tests - 10.8%)
Workflow compilation and validation tests:
pkg/parser (11 tests - 3.1%)
Parser and frontmatter tests:
Changes Made
Enhanced Existing Test Groups
Updated patterns in existing test groups to include missing tests:
CLI Compile & Poutine: Added build helpers (TestBuildCommandString, TestBuildSourceString, TestBuildWorkflowDescription, TestPrintCompilationSummary, TestCompilationStats, TestModifyWorkflowForTrialMode)
CLI MCP Other: Added TestMCPCommand, TestIsRunningAsMCPServer, TestHeaderRoundTripper
CLI Compile Workflows: Expanded from single test to all workflow compilation tests (TestCompileWorkflows*, TestCollectWorkflowFiles, TestFilterWorkflowFiles, TestNormalizeWorkflowFile)
CLI Security Tools: Added TestParseAndDisplayZizmorOutput, TestSecurityToolsIndependentOfValidate, TestSecurity*
Workflow Safe Outputs: Added SafeInputs, ConsolidatedSafeOutputs, SafeOutputJobs patterns
Workflow GitHub & Git: Added AdditionalClaudeTools, CopilotGitCommands patterns
Workflow Validation: Added TestRepositoryFeaturesValidation, TestBackwardCompatibilityWithClaudeFormat
Workflow Permissions: Added TestExtractNpx pattern
Workflow Misc Part 1: Added TestCustomEngine, TestManualApprovalEnvironmentInActivationJob, TestNeutralToolsIntegration, TestIndividualGitHubToken, TestTopLevelGitHubTokenPrecedence
Workflow String & Sanitization: Added SingleQuoteEscaping, WorkflowTimestampCheckUsesJavaScript
Workflow Runtime & Setup: Added StopTimeResolution pattern
Parser Remote Fetch & Cache: Added TestFrontmatterLocation, TestFrontmatterOffsetCalculation, TestImprovementComparison
New Test Groups Added (17 CLI + 1 CMD = 18 total)
Created focused test groups for better organization and parallelization:
New CLI Test Groups
CLI Shell Completion (11 tests)
TestCompletion|TestUninstall.*CompletionCLI Secrets & Encryption (11 tests)
TestSecret|TestEncrypt|TestCheckSecretsAvailability|...CLI Status & Versioning (16 tests)
TestStatus|TestVersion|TestWorkflowStatus|TestWorkflowRunInfo|...CLI Update & Upgrade (34 tests)
TestUpdate|TestUpgrade|TestCheckForUpdates|...CLI Workflows Path & Discovery (28 tests)
TestFindRunnableWorkflows|TestGetAvailableWorkflowNames|...CLI Trial & Interactive (7 tests)
TestTrial|TestLipglossImportPresent|TestSectionCompositionPatternCLI Run Command (11 tests)
TestRun|TestPoll|TestTrackWorkflowFailure|TestInputValidation|...CLI Repo & Git (13 tests)
TestRepo|TestGet.*RepoSlug|TestExtractBaseRepo|...CLI Spec Parsing (11 tests)
TestParse.*Spec|TestResolveImportPathLocal|...CLI Validators & Semver (8 tests)
TestValidat|TestIsCommitSHA|TestIsPreciseVersion|...CLI Tool Graph (3 tests)
TestToolGraphCLI Signal Handling (5 tests)
TestPollWithSignalHandlingCLI Makefile & Setup (3 tests)
TestMakefile|TestSetupCLIActionCLI Merge Content (5 tests)
TestMergeWorkflowContentCLI Workflows Actions (3 tests)
TestGetActionSHAForTag|TestExtractNpxPackagesCLI Codespace Integration (5 tests)
TestCodespace|TestDetectShellCLI Safe Inputs (1 test)
TestSafeInputsMCPServerCompilationNew CMD Test Group
TestMain|TestCommandGroup|TestCommandLine|TestCommand|...Error Handling Improvements
Fixed Issues with Exit Code Propagation
Problem: Using
| teein bash withoutset -o pipefailcauses the exit code ofgo testto be ignored, allowing test failures to be swallowed.Solution:
set -o pipefailto unit and integration test steps to ensurego testexit codes propagate correctly when usingteeset -euo pipefailto all inline bash scripts in canary_go job for proper error handlingextract-executed-tests.shto explicitly fail when no test records are found (instead of silently succeeding with|| true)Changes Made
In
.github/workflows/ci.yml:set -o pipefailbeforego test | teeset -o pipefailbeforego test | teeset -euo pipefailIn
scripts/extract-executed-tests.sh:|| truethat was swallowing errorsThese changes ensure that:
✅ Test failures will cause CI jobs to fail
✅ Missing test artifacts will be detected
✅ Script errors will propagate correctly
✅ No silent failures in the test pipeline
Validation
Pattern Matching Verification
All 353 missing tests are now covered by the updated patterns:
✅ pkg/cli tests: 288/288 covered (100%)
✅ cmd/gh-aw tests: 16/16 covered (100%)
✅ pkg/workflow tests: 38/38 covered (100%)
✅ pkg/parser tests: 11/11 covered (100%)
Test Execution Verification
Verified that previously missing tests now execute correctly:
YAML Validation
✅ ci.yml syntax is valid
✅ All patterns use valid regex syntax
✅ Skip patterns properly exclude covered tests
✅ Script syntax validated
Error Handling Validation
✅ Tested extract-executed-tests.sh with empty directory - properly fails with exit code 1
✅ Tested extract-executed-tests.sh with valid results - works correctly
✅ Verified set -o pipefail prevents exit code swallowing
Impact
Before This PR
After This PR
Checklist
Notes for Reviewers
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.