Skip to content

Add CI guard to assert pkg/cli and pkg/console unit tests are executed#47905

Merged
pelikhan merged 1 commit into
mainfrom
copilot/validate-tests-after-change
Jul 25, 2026
Merged

Add CI guard to assert pkg/cli and pkg/console unit tests are executed#47905
pelikhan merged 1 commit into
mainfrom
copilot/validate-tests-after-change

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

PR #47865 introduced package-level TestMain changes (goleak) in pkg/cli and pkg/console; this update adds an explicit CI assertion that those package tests are still actually running. The goal is to fail fast if test discovery/execution regresses while the workflow still appears green.

  • Unit test execution guard (cgo workflow)

    • Added a dedicated step in .github/workflows/cgo.yml after unit test execution.
    • The step scans test-result-unit.json for Action:"run" records for:
      • github.com/github/gh-aw/pkg/cli
      • github.com/github/gh-aw/pkg/console
    • The job fails if either package has no run records.
  • Scope and behavior

    • Reuses existing go test -json output generated by the workflow.
    • Does not change test selection, coverage generation, or artifact flow; it adds a targeted assertion on execution presence.
- name: Validate pkg/cli and pkg/console tests executed
  run: |
    set -euo pipefail
    for package in pkg/cli pkg/console; do
      if ! grep -q "\"Action\":\"run\",\"Package\":\"github.com/github/gh-aw/${package}\"" test-result-unit.json; then
        echo "Missing unit test execution records for ${package}" >&2
        exit 1
      fi
    done

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Validate pkg/cli and pkg/console tests still execute in CI Add CI guard to assert pkg/cli and pkg/console unit tests are executed Jul 25, 2026
Copilot AI requested a review from pelikhan July 25, 2026 03:47
@pelikhan
pelikhan marked this pull request as ready for review July 25, 2026 03:47
Copilot AI review requested due to automatic review settings July 25, 2026 03:47
@pelikhan
pelikhan merged commit c175442 into main Jul 25, 2026
@pelikhan
pelikhan deleted the copilot/validate-tests-after-change branch July 25, 2026 03:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a CI guard ensuring pkg/cli and pkg/console unit tests produce execution records.

Changes:

  • Scans existing Go JSON test results for both packages.
  • Fails the cgo test job when either package lacks test execution records.
Show a summary per file
File Description
.github/workflows/cgo.yml Adds the package test-execution assertion.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Medium

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.83.3

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.

3 participants