TestRunUpdateWorkflows_NoSourceWorkflows tests that RunUpdateWorkflows reports a message (not an error) when no source workflows exist
(t *testing.T)
| 1037 | |
| 1038 | // TestRunUpdateWorkflows_NoSourceWorkflows tests that RunUpdateWorkflows reports a message (not an error) when no source workflows exist |
| 1039 | func 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 |
| 1055 | func TestRunUpdateWorkflows_SpecificWorkflowNotFound(t *testing.T) { |
nothing calls this directly
no test coverage detected