Skip to content

Add canary_go job to agent-ci.yml to detect untested Go functions#12353

Merged
pelikhan merged 5 commits intomainfrom
copilot/add-canary-go-job
Jan 28, 2026
Merged

Add canary_go job to agent-ci.yml to detect untested Go functions#12353
pelikhan merged 5 commits intomainfrom
copilot/add-canary-go-job

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

CI test jobs use pattern-based matrix execution. Without validation, tests can be accidentally excluded from all patterns, silently reducing coverage.

Changes

New CI Job: canary_go in agent-ci.yml

  • Depends on test and integration jobs
  • Compares all test functions in source (*_test.go) against executed tests from JSON artifacts
  • Fails if any test is defined but never executed
  • Runs with if: always() to report coverage even when tests fail

Scripts Added

  • scripts/list-all-tests.sh - Extracts test function names from source
  • scripts/extract-executed-tests.sh - Parses go test -json artifacts for executed tests
  • scripts/compare-test-coverage.sh - Compares lists, reports missing tests with coverage percentage

New Experimental CI Workflow

  • Created agent-ci.yml with the canary_go job and experimental CI improvements
  • Original ci.yml remains unchanged in this PR
  • Updated ci-coach.md to optimize agent-ci.yml instead of ci.yml

Behavior

  • Skipped tests (via t.Skip()) count as executed (they show "Action":"run" in JSON)
  • Output includes test counts and coverage percentage
  • Artifacts uploaded for debugging (~3,980 tests currently tracked)
Original prompt

Add a job in ci.yml that compares the list of go tests vs the list of tests executed in all test jobs. It must ensure that all tests were executed unless the test is skipped. call the job "canary_go"


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

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add canary_go job to compare Go tests execution Add canary_go job to detect untested Go functions Jan 28, 2026
Copilot AI requested a review from pelikhan January 28, 2026 20:21
@pelikhan pelikhan marked this pull request as ready for review January 28, 2026 20:35
@pelikhan
Copy link
Contributor

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 28, 2026

@copilot investigate why this fails

https://github.com/githubnext/gh-aw/actions/runs/21454017768/job/61792350333#step:6:1

The failure was caused by extract-executed-tests.sh exiting with code 1 when processing JSON files with no test executions (files containing only package-level actions without any "Action":"run" entries).

Fixed in commit 1212c0b by:

  • Adding || true to prevent grep from causing script exit when no matches found
  • Redirecting stderr to /dev/null to suppress grep warnings

The script now correctly handles empty test results, files with tests, and mixed scenarios.

@pelikhan
Copy link
Contributor

@copilot, rename the current version of CI.yml to agent-ci.yml. Restore the original CI.yml so that it remains unchanged in this pull-request branch. Update the CI coach agentic-workflow to optimize agent-ci.yml instead of CI.yml.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 28, 2026

@copilot, rename the current version of CI.yml to agent-ci.yml. Restore the original CI.yml so that it remains unchanged in this pull-request branch. Update the CI coach agentic-workflow to opti...

Done in commit 605695c:

  • Created agent-ci.yml with the canary_go job and all CI modifications
  • Restored ci.yml to its original state (unchanged in this PR)
  • Updated ci-coach.md to reference agent-ci.yml in 3 locations (target workflow, CI configuration data, and implementation instructions)

Copilot AI changed the title Add canary_go job to detect untested Go functions Add canary_go job to agent-ci.yml to detect untested Go functions Jan 28, 2026
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.

2 participants