Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions pkg/cli/add_interactive_workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,13 @@ func TestGetWorkflowStatuses(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
// This function calls gh CLI, so it will likely error in tests
// We just verify it doesn't panic
statuses, err := getWorkflowStatuses(tt.pattern, tt.repoOverride, tt.verbose)
_, err := getWorkflowStatuses(tt.pattern, tt.repoOverride, tt.verbose)

// Either succeeds or fails gracefully, but shouldn't panic
// Note: statuses may be nil even when err is nil (no workflows found)
if err != nil {
Comment on lines +44 to 47
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

This test currently doesn’t actually validate anything: on the success path there are no assertions, and on the error path the if err != nil { assert.Error(t, err, ...) } check is redundant (and may still be flagged by testifylint as a useless assert). If the intent is purely “doesn’t panic”, wrap the call in require.NotPanics and drop the conditional assert entirely (optionally just ignore err or add a deterministic assertion via mocking).

This issue also appears on line 47 of the same file.

Copilot uses AI. Check for mistakes.
// Error is acceptable in test environment without gh CLI setup
assert.Error(t, err, "Expected error without gh CLI")
}
// If no error and statuses exist, verify they have expected structure
if err == nil && statuses != nil {
for _, status := range statuses {
assert.NotEmpty(t, status.Workflow, "Workflow name should not be empty")
}
}
})
}
}
Loading