Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions pkg/cli/actions_build_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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")
}
})
Expand Down Expand Up @@ -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")
}
})
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/cli/add_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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")
}
5 changes: 0 additions & 5 deletions pkg/cli/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
12 changes: 6 additions & 6 deletions pkg/cli/generate_action_metadata_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/logs_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand Down