TestConclusionJobPushRepoMemoryResult verifies that when repo-memory is configured, GH_AW_PUSH_REPO_MEMORY_RESULT is passed to the conclusion job so the failure handler can report push_repo_memory job-level failures.
(t *testing.T)
| 1031 | // GH_AW_PUSH_REPO_MEMORY_RESULT is passed to the conclusion job so the failure handler |
| 1032 | // can report push_repo_memory job-level failures. |
| 1033 | func TestConclusionJobPushRepoMemoryResult(t *testing.T) { |
| 1034 | compiler := NewCompiler() |
| 1035 | workflowData := &WorkflowData{ |
| 1036 | Name: "Test Workflow", |
| 1037 | SafeOutputs: &SafeOutputsConfig{ |
| 1038 | MissingTool: &MissingToolConfig{}, |
| 1039 | }, |
| 1040 | RepoMemoryConfig: &RepoMemoryConfig{ |
| 1041 | Memories: []RepoMemoryEntry{ |
| 1042 | {ID: "default", BranchName: "memory/default"}, |
| 1043 | }, |
| 1044 | }, |
| 1045 | } |
| 1046 | |
| 1047 | job, err := compiler.buildConclusionJob(workflowData, string(constants.AgentJobName), []string{}) |
| 1048 | if err != nil { |
| 1049 | t.Fatalf("Failed to build conclusion job: %v", err) |
| 1050 | } |
| 1051 | if job == nil { |
| 1052 | t.Fatal("Expected conclusion job to be created") |
| 1053 | } |
| 1054 | |
| 1055 | allSteps := strings.Join(job.Steps, "\n") |
| 1056 | if !strings.Contains(allSteps, "GH_AW_PUSH_REPO_MEMORY_RESULT") { |
| 1057 | t.Error("Expected conclusion job to include GH_AW_PUSH_REPO_MEMORY_RESULT env var for push job failure reporting") |
| 1058 | } |
| 1059 | if !strings.Contains(allSteps, "${{ needs.push_repo_memory.result }}") { |
| 1060 | t.Error("Expected GH_AW_PUSH_REPO_MEMORY_RESULT to reference needs.push_repo_memory.result") |
| 1061 | } |
| 1062 | } |
| 1063 | |
| 1064 | // TestConclusionJobNoPushRepoMemoryResult verifies that when repo-memory is NOT configured, |
| 1065 | // GH_AW_PUSH_REPO_MEMORY_RESULT is not added to the conclusion job (no unnecessary env vars). |
nothing calls this directly
no test coverage detected