diff --git a/plugins/github-integration/fixtures/handleCommandRun_args.golden b/plugins/github-integration/fixtures/handleCommandRun_args.golden index 17eab5c..09c3207 100644 --- a/plugins/github-integration/fixtures/handleCommandRun_args.golden +++ b/plugins/github-integration/fixtures/handleCommandRun_args.golden @@ -13,15 +13,15 @@ "trigger": "TRIGGER_MANUAL", "annotations": [ { - "key": "updateGitHubStatus", - "value": "csweichel/test-repo" + "key": "arg1" }, { "key": "foo", "value": "bar" }, { - "key": "arg1" + "key": "updateGitHubStatus", + "value": "csweichel/test-repo" } ] }, diff --git a/plugins/github-integration/main_test.go b/plugins/github-integration/main_test.go index 1b6509e..d44e6f0 100644 --- a/plugins/github-integration/main_test.go +++ b/plugins/github-integration/main_test.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "os" "path/filepath" + "sort" "strings" "testing" @@ -91,6 +92,9 @@ func TestHandleCommandRun(t *testing.T) { client.EXPECT().StartJob2(gomock.Any(), gomock.Any(), gomock.Any()). MinTimes(1). DoAndReturn(func(ctx context.Context, creq *v1.StartJobRequest2) (*v1.StartJobResponse, error) { + sort.Slice(creq.Metadata.Annotations, func(i, j int) bool { + return creq.Metadata.Annotations[i].Key < creq.Metadata.Annotations[j].Key + }) act.StartRequest = creq return &v1.StartJobResponse{ Status: &v1.JobStatus{