From 5b24e2d8d033ef90aeb1a3fea2e20aac44cf7daa Mon Sep 17 00:00:00 2001 From: Vonny Jap Date: Wed, 8 Jan 2025 16:21:49 -0800 Subject: [PATCH] fix tests (#489) --- launch_test.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/launch_test.go b/launch_test.go index 95ed56f..03ee2a3 100644 --- a/launch_test.go +++ b/launch_test.go @@ -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", @@ -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" }, @@ -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", @@ -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))