diff --git a/pkg/reconciler/pipelinerun/resources/apply_test.go b/pkg/reconciler/pipelinerun/resources/apply_test.go index 3aa82220857..ab92a183131 100644 --- a/pkg/reconciler/pipelinerun/resources/apply_test.go +++ b/pkg/reconciler/pipelinerun/resources/apply_test.go @@ -138,7 +138,7 @@ func TestApplyParameters(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got := ApplyParameters(&tt.original.Spec, tt.run) - if d := cmp.Diff(got, &tt.expected.Spec); d != "" { + if d := cmp.Diff(&tt.expected.Spec, got); d != "" { t.Errorf("ApplyParameters() got diff %s", diff.PrintWantGot(d)) } }) @@ -211,7 +211,7 @@ func TestApplyTaskResults_MinimalExpression(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ApplyTaskResults(tt.args.targets, tt.args.resolvedResultRefs) - if d := cmp.Diff(tt.args.targets, tt.want); d != "" { + if d := cmp.Diff(tt.want, tt.args.targets); d != "" { t.Fatalf("ApplyTaskResults() %s", diff.PrintWantGot(d)) } }) @@ -284,7 +284,7 @@ func TestApplyTaskResults_EmbeddedExpression(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ApplyTaskResults(tt.args.targets, tt.args.resolvedResultRefs) - if d := cmp.Diff(tt.args.targets, tt.want); d != "" { + if d := cmp.Diff(tt.want, tt.args.targets); d != "" { t.Fatalf("ApplyTaskResults() %s", diff.PrintWantGot(d)) } }) @@ -378,7 +378,7 @@ func TestApplyTaskResults_Conditions(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ApplyTaskResults(tt.args.targets, tt.args.resolvedResultRefs) - if d := cmp.Diff(tt.args.targets[0].ResolvedConditionChecks, tt.want[0].ResolvedConditionChecks, cmpopts.IgnoreUnexported(v1beta1.TaskRunSpec{}, ResolvedConditionCheck{})); d != "" { + if d := cmp.Diff(tt.want[0].ResolvedConditionChecks, tt.args.targets[0].ResolvedConditionChecks, cmpopts.IgnoreUnexported(v1beta1.TaskRunSpec{}, ResolvedConditionCheck{})); d != "" { t.Fatalf("ApplyTaskResults() %s", diff.PrintWantGot(d)) } }) diff --git a/pkg/reconciler/taskrun/resources/apply_test.go b/pkg/reconciler/taskrun/resources/apply_test.go index 3fd2acc1ef6..b51ecbbdb54 100644 --- a/pkg/reconciler/taskrun/resources/apply_test.go +++ b/pkg/reconciler/taskrun/resources/apply_test.go @@ -480,7 +480,7 @@ func TestApplyArrayParameters(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got := resources.ApplyParameters(tt.args.ts, tt.args.tr, tt.args.dp...) - if d := cmp.Diff(got, tt.want); d != "" { + if d := cmp.Diff(tt.want, got); d != "" { t.Errorf("ApplyParameters() got diff %s", diff.PrintWantGot(d)) } }) @@ -544,7 +544,7 @@ func TestApplyParameters(t *testing.T) { spec.Sidecars[0].Container.Env[0].Value = "world" }) got := resources.ApplyParameters(simpleTaskSpec, tr, dp...) - if d := cmp.Diff(got, want); d != "" { + if d := cmp.Diff(want, got); d != "" { t.Errorf("ApplyParameters() got diff %s", diff.PrintWantGot(d)) } } @@ -616,7 +616,7 @@ func TestApplyResources(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got := resources.ApplyResources(tt.args.ts, tt.args.r, tt.args.rStr) - if d := cmp.Diff(got, tt.want); d != "" { + if d := cmp.Diff(tt.want, got); d != "" { t.Errorf("ApplyResources() %s", diff.PrintWantGot(d)) } }) @@ -737,7 +737,7 @@ func TestApplyWorkspaces(t *testing.T) { EmptyDir: &corev1.EmptyDirVolumeSource{}, }} got := resources.ApplyWorkspaces(ts, w, wb) - if d := cmp.Diff(got, want); d != "" { + if d := cmp.Diff(want, got); d != "" { t.Errorf("TestApplyWorkspaces() got diff %s", diff.PrintWantGot(d)) } } @@ -773,7 +773,7 @@ func TestTaskResults(t *testing.T) { spec.Steps[1].Script = "#!/usr/bin/env bash\ndate | tee /tekton/results/current-date-human-readable" }) got := resources.ApplyTaskResults(ts) - if d := cmp.Diff(got, want); d != "" { + if d := cmp.Diff(want, got); d != "" { t.Errorf("ApplyTaskResults() got diff %s", diff.PrintWantGot(d)) } }