Skip to content

Commit

Permalink
fix tests (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
VonnyJap authored Jan 9, 2025
1 parent 08a6729 commit 5b24e2d
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions launch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2824,7 +2824,8 @@ func TestMetaWhenTriggeredFromExternalPipelineByORLogicWithParentBuildMeta(t *te
want := fmt.Sprintf(`{
"build_only": "build_value",
"event_only": "event_value",
"build_and_event_and_external_pipeline": "event_value",
"build_and_event_and_external_pipeline": "external_pipeline_value",
"external_pipeline_only": "external_pipeline_value",
"build":{
"buildId": "%d",
"jobId": "%d",
Expand All @@ -2835,7 +2836,8 @@ func TestMetaWhenTriggeredFromExternalPipelineByORLogicWithParentBuildMeta(t *te
"coverageKey": "%s",
"build_only": "build_value",
"event_only": "event_value",
"build_and_event_and_external_pipeline": "event_value",
"external_pipeline_only": "external_pipeline_value",
"build_and_event_and_external_pipeline": "external_pipeline_value",
"build_and_event_and_parent_event": "parent_event_value",
"parent_event_only": "parent_event_value"
},
Expand All @@ -2845,10 +2847,11 @@ func TestMetaWhenTriggeredFromExternalPipelineByORLogicWithParentBuildMeta(t *te
"meta": {
"build_only": "build_value",
"event_only": "event_value",
"build_and_event_and_external_pipeline": "event_value",
"build_and_event_and_external_pipeline": "external_pipeline_value",
"build_and_event_and_parent_event": "parent_event_value",
"event_only": "event_value",
"parent_event_only": "parent_event_value"
"parent_event_only": "parent_event_value",
"external_pipeline_only": "external_pipeline_value"
},
"parameters": {
"build_only": "build_value",
Expand All @@ -2859,15 +2862,15 @@ func TestMetaWhenTriggeredFromExternalPipelineByORLogicWithParentBuildMeta(t *te
"event_only": "event_value",
"%d":{
"build_only": "build_value",
"event_only": "event_value"
}
"event_only": "event_value",
"external_pipeline_only": "external_pipeline_value"
},
"external_pipeline_only": "external_pipeline_value"
},
"parent_event_only": "parent_event_value",
"build_and_event_and_parent_event": "parent_event_value"
}`, TestBuildID, TestJobID, TestPipelineID, TestEnvVars["SD_SONAR_PROJECT_KEY"], TestEventCreator["username"], ExternalPipelineID)
if string(defaultMeta) != want {
// do nothing
}
assert.JSONEq(t, want, string(defaultMeta))

wantExternalMetaByte, _ := marshal(externalParentBuildMeta)
assert.JSONEq(t, string(wantExternalMetaByte), string(externalMeta))
Expand Down

0 comments on commit 5b24e2d

Please sign in to comment.