From 9e9f9cacfe183ef2861a6944f5e8458d502deca7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 00:19:28 +0000 Subject: [PATCH 1/2] Initial plan From 9403203a952140426befe1596c558c401b03f98e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 00:33:04 +0000 Subject: [PATCH 2/2] Fix duplicate validateEngineStub and testifylint errors Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/actions_build_command_test.go | 10 +++++----- pkg/cli/add_command_test.go | 8 ++++---- pkg/cli/flags_test.go | 5 ----- pkg/cli/generate_action_metadata_command_test.go | 12 ++++++------ pkg/cli/logs_command_test.go | 4 ++-- 5 files changed, 17 insertions(+), 22 deletions(-) diff --git a/pkg/cli/actions_build_command_test.go b/pkg/cli/actions_build_command_test.go index 1d52576e1fd..24c6be1d4fd 100644 --- a/pkg/cli/actions_build_command_test.go +++ b/pkg/cli/actions_build_command_test.go @@ -21,7 +21,7 @@ func TestActionsBuildCommand_NoActionsDir(t *testing.T) { // Test with non-existent actions directory err = ActionsBuildCommand() - assert.Error(t, err, "Should error when actions/ directory does not exist") + require.Error(t, err, "Should error when actions/ directory does not exist") assert.Contains(t, err.Error(), "actions/ directory does not exist", "Error should mention missing directory") } @@ -117,9 +117,9 @@ func TestGetActionDirectories(t *testing.T) { dirs, err := getActionDirectories(actionsDir) if tt.expectError { - assert.Error(t, err, "Expected an error") + require.Error(t, err, "Expected an error") } else { - assert.NoError(t, err, "Should not error") + require.NoError(t, err, "Should not error") assert.Len(t, dirs, tt.expectedLen, "Should return expected number of directories") } }) @@ -207,12 +207,12 @@ runs: err = validateActionYml(actionPath) if tt.expectError { - assert.Error(t, err, "Expected an error") + require.Error(t, err, "Expected an error") if tt.errorContains != "" { assert.Contains(t, err.Error(), tt.errorContains, "Error should contain expected message") } } else { - assert.NoError(t, err, "Should not error for valid action.yml") + require.NoError(t, err, "Should not error for valid action.yml") } }) } diff --git a/pkg/cli/add_command_test.go b/pkg/cli/add_command_test.go index 515a933147c..ace8f0c3473 100644 --- a/pkg/cli/add_command_test.go +++ b/pkg/cli/add_command_test.go @@ -79,7 +79,7 @@ func TestNewAddCommand(t *testing.T) { func TestAddWorkflows_EmptyWorkflows(t *testing.T) { err := AddWorkflows([]string{}, 1, false, "", "", false, "", false, false, "", false, "") - assert.Error(t, err, "Should error when no workflows are provided") + require.Error(t, err, "Should error when no workflows are provided") assert.Contains(t, err.Error(), "at least one workflow", "Error should mention missing workflow") } @@ -192,11 +192,11 @@ func TestAddCommandArgs(t *testing.T) { // Verify it requires at least 1 arg err := cmd.Args(cmd, []string{}) - assert.Error(t, err, "Should error with no arguments") + require.Error(t, err, "Should error with no arguments") err = cmd.Args(cmd, []string{"workflow1"}) - assert.NoError(t, err, "Should not error with 1 argument") + require.NoError(t, err, "Should not error with 1 argument") err = cmd.Args(cmd, []string{"workflow1", "workflow2"}) - assert.NoError(t, err, "Should not error with multiple arguments") + require.NoError(t, err, "Should not error with multiple arguments") } diff --git a/pkg/cli/flags_test.go b/pkg/cli/flags_test.go index 1144807bbf4..366e4b5a763 100644 --- a/pkg/cli/flags_test.go +++ b/pkg/cli/flags_test.go @@ -237,11 +237,6 @@ func TestShortFlagConsistency(t *testing.T) { } } -// Helper function to validate engine (stub for testing) -func validateEngineStub(engine string) error { - return nil -} - // Stub command creation functions that match main.go structure func createCompileCommandStub() *cobra.Command { cmd := &cobra.Command{Use: "compile"} diff --git a/pkg/cli/generate_action_metadata_command_test.go b/pkg/cli/generate_action_metadata_command_test.go index 59dffbc90c9..83fdc70ef5c 100644 --- a/pkg/cli/generate_action_metadata_command_test.go +++ b/pkg/cli/generate_action_metadata_command_test.go @@ -83,9 +83,9 @@ module.exports = async function test(input1, required_input) { metadata, err := extractActionMetadata(tt.filename, tt.content) if tt.expectError { - assert.Error(t, err, "Expected an error") + require.Error(t, err, "Expected an error") } else { - assert.NoError(t, err, "Should not error") + require.NoError(t, err, "Should not error") require.NotNil(t, metadata, "Metadata should not be nil") if tt.checkFields != nil { tt.checkFields(t, metadata) @@ -312,9 +312,9 @@ func TestGenerateActionYml(t *testing.T) { err = generateActionYml(actionDir, tt.metadata) if tt.expectError { - assert.Error(t, err, "Expected an error") + require.Error(t, err, "Expected an error") } else { - assert.NoError(t, err, "Should not error") + require.NoError(t, err, "Should not error") // Verify action.yml was created ymlPath := filepath.Join(actionDir, "action.yml") @@ -363,9 +363,9 @@ func TestGenerateReadme(t *testing.T) { err = generateReadme(actionDir, tt.metadata) if tt.expectError { - assert.Error(t, err, "Expected an error") + require.Error(t, err, "Expected an error") } else { - assert.NoError(t, err, "Should not error") + require.NoError(t, err, "Should not error") // Verify README.md was created readmePath := filepath.Join(actionDir, "README.md") diff --git a/pkg/cli/logs_command_test.go b/pkg/cli/logs_command_test.go index 00685f6c464..88c06230fdf 100644 --- a/pkg/cli/logs_command_test.go +++ b/pkg/cli/logs_command_test.go @@ -144,11 +144,11 @@ func TestLogsCommandArgs(t *testing.T) { if cmd.Args != nil { // Verify it accepts no arguments err := cmd.Args(cmd, []string{}) - assert.NoError(t, err, "Should not error with no arguments") + require.NoError(t, err, "Should not error with no arguments") // Verify it accepts 1 argument err = cmd.Args(cmd, []string{"workflow1"}) - assert.NoError(t, err, "Should not error with 1 argument") + require.NoError(t, err, "Should not error with 1 argument") } }