Objective
Identify commands missing test coverage and ensure all commands have comprehensive unit and integration tests.
Context
Testing ensures commands work reliably and prevents regressions. The gh-aw testing strategy includes:
- Unit tests for command logic (
*_test.go files)
- Integration tests for end-to-end command execution
- Table-driven tests for different scenarios
Commands to Audit
For each command file in pkg/cli/, verify:
- Test file exists:
*_test.go alongside implementation
- Test coverage: Core functionality is tested
- Error cases: Invalid inputs are tested
- Flag handling: Flags are tested with different values
- Integration tests: End-to-end command execution is tested where applicable
Known Command Files
From pkg/cli/:
actions_build_command.go
add_command.go
compile_command.go
fix_command.go
generate_action_metadata_command.go
init_command.go
list_command.go
logs_command.go
pr_command.go
remove_command.go
run_command.go
secret_set_command.go
secrets_command.go
status_command.go
trial_command.go
update_command.go
Approach
- Audit: Check each command file for corresponding test file
- Analyze: Review existing tests for completeness
- Identify gaps: List commands with missing or insufficient tests
- Prioritize: Focus on high-impact commands first
- Write tests: Add missing test coverage following patterns in specs/testing.md
Test Patterns to Follow
Based on specs/testing.md:
- Use
require.* for critical setup (stops test on failure)
- Use
assert.* for test validations (continues checking)
- Write table-driven tests with
t.Run() and descriptive names
- No mocks or test suites - test real component interactions
- Always include helpful assertion messages
Example Test Structure
func TestCommandName(t *testing.T) {
tests := []struct {
name string
args []string
expectError bool
errorMsg string
}{
{
name: "valid input",
args: []string{"workflow-name"},
expectError: false,
},
{
name: "missing required arg",
args: []string{},
expectError: true,
errorMsg: "required argument missing",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Test implementation
})
}
}
Acceptance Criteria
AI generated by Plan Command for discussion #8482
Objective
Identify commands missing test coverage and ensure all commands have comprehensive unit and integration tests.
Context
Testing ensures commands work reliably and prevents regressions. The gh-aw testing strategy includes:
*_test.gofiles)Commands to Audit
For each command file in
pkg/cli/, verify:*_test.goalongside implementationKnown Command Files
From
pkg/cli/:actions_build_command.goadd_command.gocompile_command.gofix_command.gogenerate_action_metadata_command.goinit_command.golist_command.gologs_command.gopr_command.goremove_command.gorun_command.gosecret_set_command.gosecrets_command.gostatus_command.gotrial_command.goupdate_command.goApproach
Test Patterns to Follow
Based on specs/testing.md:
require.*for critical setup (stops test on failure)assert.*for test validations (continues checking)t.Run()and descriptive namesExample Test Structure
Acceptance Criteria
*_test.gofilesmake test-unitsuccessfullyRelated to [plan] Review and document existing CLI commands #8492