MCPcopy Create free account
hub / github.com/github/gh-aw / TestRunUpdateWorkflows_NoSourceWorkflows

Function TestRunUpdateWorkflows_NoSourceWorkflows

pkg/cli/update_command_test.go:1039–1052  ·  view source on GitHub ↗

TestRunUpdateWorkflows_NoSourceWorkflows tests that RunUpdateWorkflows reports a message (not an error) when no source workflows exist

(t *testing.T)

Source from the content-addressed store, hash-verified

1037
1038// TestRunUpdateWorkflows_NoSourceWorkflows tests that RunUpdateWorkflows reports a message (not an error) when no source workflows exist
1039func TestRunUpdateWorkflows_NoSourceWorkflows(t *testing.T) {
1040 tmpDir := testutil.TempDir(t, "test-*")
1041 originalDir, _ := os.Getwd()
1042 defer os.Chdir(originalDir)
1043
1044 // Create empty .github/workflows directory
1045 workflowsDir := filepath.Join(tmpDir, ".github", "workflows")
1046 require.NoError(t, os.MkdirAll(workflowsDir, 0755))
1047 os.Chdir(tmpDir)
1048
1049 // Running update with no source workflows should succeed with an info message, not an error
1050 err := RunUpdateWorkflows(context.Background(), UpdateWorkflowsOptions{})
1051 assert.NoError(t, err, "Should not error when no workflows with source field exist")
1052}
1053
1054// TestRunUpdateWorkflows_SpecificWorkflowNotFound tests that RunUpdateWorkflows errors for unknown workflow name
1055func TestRunUpdateWorkflows_SpecificWorkflowNotFound(t *testing.T) {

Callers

nothing calls this directly

Calls 3

TempDirFunction · 0.92
RunUpdateWorkflowsFunction · 0.85
BackgroundMethod · 0.80

Tested by

no test coverage detected