Add CLI integration test for init command#44678
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Add integration test for init command via compiled CLI binary
Add CLI integration test for Jul 10, 2026
init command
Copilot created this pull request from a session on behalf of
pelikhan
July 10, 2026 07:16
View session
Contributor
🤖 PR Triage
Score breakdown: impact 18 + urgency 10 + quality 10 Rationale: Adds integration tests for
|
pelikhan
approved these changes
Jul 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an integration test suite (build tag integration) to exercise gh aw init end-to-end via the compiled CLI binary, verifying that repository initialization produces the expected on-disk artifacts.
Changes:
- Introduces
pkg/cli/init_integration_test.gowith three integration tests covering default init behavior,--no-skill, and idempotency. - Reuses the existing
globalBinaryPathintegration-test binary infrastructure to run the real CLI.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/init_integration_test.go | New integration tests validating gh aw init --no-mcp file generation, --no-skill suppression, and .gitattributes idempotency. |
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: 3
- Review effort level: Low
Comment on lines
+34
to
+38
| originalWd, err := os.Getwd() | ||
| require.NoError(t, err, "Failed to get current working directory") | ||
|
|
||
| err = os.Chdir(tempDir) | ||
| require.NoError(t, err, "Failed to change to temp directory") |
Comment on lines
+46
to
+50
| // Copy the pre-built binary to this test's temp directory | ||
| binaryPath := filepath.Join(tempDir, "gh-aw") | ||
| err = fileutil.CopyFile(globalBinaryPath, binaryPath) | ||
| require.NoError(t, err, "Failed to copy gh-aw binary to temp directory") | ||
|
|
Comment on lines
+125
to
+126
| _, err = os.Stat(skillPath) | ||
| assert.True(t, os.IsNotExist(err), "dispatcher skill should NOT be created with --no-skill") |
Contributor
|
🎉 This pull request is included in a new release. Release: |
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.
No integration test existed to verify that
gh aw initactually generates the expected files when run through the compiled binary.New:
pkg/cli/init_integration_test.goThree integration tests (build tag
integration) using the sharedglobalBinaryPathinfrastructure fromcompile_integration_test.go:TestInitCommandIntegration— runsinit --no-mcpin a fresh git repo; asserts.gitattributes(with*.lock.yml linguist-generatedentry),.github/skills/agentic-workflows/SKILL.md,.github/agents/agentic-workflows.md, and.vscode/settings.jsonare all created.TestInitCommandNoSkillIntegration—--no-skillsuppresses the dispatcher skill while.gitattributesis still written.TestInitCommandIdempotentIntegration— two sequentialinitruns produce no errors and no duplicate.gitattributesentries.