Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

Implements snapshot testing for gh aw add to detect unintentional changes to generated workflow scaffolding.

Implementation

  • Test infrastructure - 4 test cases covering: basic addition, custom naming (-n), subdirectory placement (--dir), numbered copies (-c)
  • Normalization - Filters timestamps, versions, and commit SHAs from comparisons to ensure stability across environments
  • Golden files - Captures both markdown (.md) and compiled YAML (.lock.yml) outputs in pkg/cli/testdata/add_golden/

Usage

# Run tests
go test -v -tags 'integration' -run='^TestAddCommandGolden$' ./pkg/cli

# Update snapshots after intentional changes
UPDATE_GOLDEN=1 go test -v -tags 'integration' -run='^TestAddCommandGolden$' ./pkg/cli

Tests run automatically in CI. Comprehensive documentation provided in pkg/cli/testdata/add_golden/README.md.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login Gd5O8d-a7doXyfI6dVT2/Gd5O8d-a7doXyfI6dVT2 -dwarf=false 1/x64/bin/node go1.25.0 -c=4 -nolocalimports git stat�� 40/update_issue.js /tmp/go-build265952283/b001/_testmain.go /home/REDACTED/go/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login tags/v5 -d/gh-aw 322465/b348=> by/c923cf85ad66dgh (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login tags/v5 add aae159f24662fd722d7e17306f67fbbba5a/log.json (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add golden test: gh aw add</issue_title>
<issue_description>## Summary
Add golden tests for initialization and template generation via gh aw add.

Implementation Notes

  • Create test repositories in temporary dirs
  • Snapshot generated files
  • Add diffs to CI workflow

Success Criteria

  • Changes to generated scaffolding are intentional and reviewed
    </issue_description>

Comments on the Issue (you are @copilot in this section)

@pelikhan Yes more testing around add is good.
  • Fixes githubnext/gh-aw-planning#12

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

Copilot AI and others added 3 commits December 9, 2025 06:22
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add golden tests for gh aw add command Add golden tests for gh aw add command Dec 9, 2025
Copilot AI requested a review from mnkiefer December 9, 2025 06:55
@pelikhan
Copy link
Contributor

pelikhan commented Dec 9, 2025

This kind of testing will break on every compiler changes'.

@pelikhan pelikhan closed this Dec 9, 2025
@pelikhan pelikhan deleted the copilot/add-golden-tests-gh-aw-add branch December 15, 2025 04:50
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