11package argocd
22
33import (
4- "context"
54 "reflect"
65 "strings"
76 "testing"
@@ -51,7 +50,7 @@ func TestUpgradeSchemaApplication_V0V1_Default_SkipCrds(t *testing.T) {
5150 },
5251 }
5352
54- actual , _ := resourceArgoCDApplicationStateUpgradeV0 (context . TODO (), v0 , nil )
53+ actual , _ := resourceArgoCDApplicationStateUpgradeV0 (t . Context (), v0 , nil )
5554
5655 if ! reflect .DeepEqual (v1 , actual ) {
5756 t .Fatalf ("\n \n expected:\n \n %#v\n \n got:\n \n %#v\n \n " , v1 , actual )
@@ -77,7 +76,7 @@ func TestUpgradeSchemaApplication_V0V1_Default_SkipCrds_NoChange(t *testing.T) {
7776 },
7877 }
7978
80- actual , _ := resourceArgoCDApplicationStateUpgradeV0 (context . TODO (), v0 , nil )
79+ actual , _ := resourceArgoCDApplicationStateUpgradeV0 (t . Context (), v0 , nil )
8180
8281 if ! reflect .DeepEqual (v0 , actual ) {
8382 t .Fatalf ("\n \n expected:\n \n %#v\n \n got:\n \n %#v\n \n " , v0 , actual )
@@ -108,7 +107,7 @@ func TestUpgradeSchemaApplication_V1V2_Default_NoChange(t *testing.T) {
108107 },
109108 }
110109
111- actual , _ := resourceArgoCDApplicationStateUpgradeV1 (context . TODO (), v1 , nil )
110+ actual , _ := resourceArgoCDApplicationStateUpgradeV1 (t . Context (), v1 , nil )
112111
113112 if ! reflect .DeepEqual (v1 , actual ) {
114113 t .Fatalf ("\n \n expected:\n \n %#v\n \n got:\n \n %#v\n \n " , v1 , actual )
@@ -140,7 +139,7 @@ func TestUpgradeSchemaApplication_V1V2_WithKsonnet(t *testing.T) {
140139 },
141140 }
142141
143- _ , err := resourceArgoCDApplicationStateUpgradeV1 (context . TODO (), v1 , nil )
142+ _ , err := resourceArgoCDApplicationStateUpgradeV1 (t . Context (), v1 , nil )
144143
145144 if err == nil || ! strings .Contains (err .Error (), "'ksonnet' support has been removed" ) {
146145 t .Fatalf ("\n \n expected error during state migration was not found - err returned was: %v" , err )
@@ -177,7 +176,7 @@ func TestUpgradeSchemaApplication_V2V3_Default_NoChange(t *testing.T) {
177176 },
178177 }
179178
180- actual , _ := resourceArgoCDApplicationStateUpgradeV2 (context . TODO (), v2 , nil )
179+ actual , _ := resourceArgoCDApplicationStateUpgradeV2 (t . Context (), v2 , nil )
181180
182181 if ! reflect .DeepEqual (v2 , actual ) {
183182 t .Fatalf ("\n \n expected:\n \n %#v\n \n got:\n \n %#v\n \n " , v2 , actual )
@@ -550,7 +549,7 @@ func TestUpgradeSchemaApplication_V3V4(t *testing.T) {
550549 t .Run (tc .name , func (t * testing.T ) {
551550 t .Parallel ()
552551
553- actualState , err := resourceArgoCDApplicationStateUpgradeV3 (context . TODO (), tc .sourceState , nil )
552+ actualState , err := resourceArgoCDApplicationStateUpgradeV3 (t . Context (), tc .sourceState , nil )
554553 if err != nil {
555554 t .Fatalf ("error migrating state: %s" , err )
556555 }
0 commit comments