@@ -7,7 +7,6 @@ package workapplier
77
88import (
99 "context"
10- "fmt"
1110 "testing"
1211
1312 "github.com/google/go-cmp/cmp"
@@ -1002,7 +1001,6 @@ func TestServiceExportAvailability(t *testing.T) {
10021001 weight string
10031002 status fleetnetworkingv1alpha1.ServiceExportStatus
10041003 wantManifestProcessingAvailabilityResultType ManifestProcessingAvailabilityResultType
1005- err error
10061004 }{
10071005 {
10081006 name : "available svcExport (annotation weight is 0)" ,
@@ -1018,7 +1016,6 @@ func TestServiceExportAvailability(t *testing.T) {
10181016 },
10191017 },
10201018 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeAvailable ,
1021- err : nil ,
10221019 },
10231020 {
10241021 name : "unavailable svcExport (ServiceExportValid is false)" ,
@@ -1034,7 +1031,6 @@ func TestServiceExportAvailability(t *testing.T) {
10341031 },
10351032 },
10361033 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1037- err : nil ,
10381034 },
10391035 {
10401036 name : "unavailable svcExport (different generation, annotation weight is 0)" ,
@@ -1050,7 +1046,6 @@ func TestServiceExportAvailability(t *testing.T) {
10501046 },
10511047 },
10521048 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1053- err : nil ,
10541049 },
10551050 {
10561051 name : "available svcExport with no conflict (annotation weight is 1)" ,
@@ -1072,7 +1067,6 @@ func TestServiceExportAvailability(t *testing.T) {
10721067 },
10731068 },
10741069 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeAvailable ,
1075- err : nil ,
10761070 },
10771071 {
10781072 name : "unavailable svcExport with conflict (annotation weight is 1)" ,
@@ -1094,7 +1088,6 @@ func TestServiceExportAvailability(t *testing.T) {
10941088 },
10951089 },
10961090 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1097- err : nil ,
10981091 },
10991092 {
11001093 name : "unavailable invalid svcExport (annotation weight is 1)" ,
@@ -1110,7 +1103,6 @@ func TestServiceExportAvailability(t *testing.T) {
11101103 },
11111104 },
11121105 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1113- err : nil ,
11141106 },
11151107 {
11161108 name : "unavailable svcExport (different generation, annotation weight is 1)" ,
@@ -1132,7 +1124,6 @@ func TestServiceExportAvailability(t *testing.T) {
11321124 },
11331125 },
11341126 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1135- err : nil ,
11361127 },
11371128 {
11381129 name : "unavailable svcExport (no annotation weight, no conflict condition)" ,
@@ -1148,7 +1139,6 @@ func TestServiceExportAvailability(t *testing.T) {
11481139 },
11491140 },
11501141 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1151- err : nil ,
11521142 },
11531143 {
11541144 name : "available svcExport (no annotation weight)" ,
@@ -1170,7 +1160,6 @@ func TestServiceExportAvailability(t *testing.T) {
11701160 },
11711161 },
11721162 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeAvailable ,
1173- err : nil ,
11741163 },
11751164 {
11761165 name : "unavailable svcExport (no annotation weight with conflict)" ,
@@ -1192,7 +1181,6 @@ func TestServiceExportAvailability(t *testing.T) {
11921181 },
11931182 },
11941183 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1195- err : nil ,
11961184 },
11971185 {
11981186 name : "unavailable svcExport (no annotation weight, different generation)" ,
@@ -1214,7 +1202,6 @@ func TestServiceExportAvailability(t *testing.T) {
12141202 },
12151203 },
12161204 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1217- err : nil ,
12181205 },
12191206 {
12201207 name : "unavailable svcExport (no annotation weight, invalid service export)" ,
@@ -1230,7 +1217,6 @@ func TestServiceExportAvailability(t *testing.T) {
12301217 },
12311218 },
12321219 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1233- err : nil ,
12341220 },
12351221 {
12361222 name : "unavailable svcExport (invalid weight)" ,
@@ -1246,7 +1232,6 @@ func TestServiceExportAvailability(t *testing.T) {
12461232 },
12471233 },
12481234 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1249- err : fmt .Errorf ("the weight annotation is not a valid integer: a" ),
12501235 },
12511236 {
12521237 name : "unavailable svcExport (out of range weight)" ,
@@ -1262,7 +1247,6 @@ func TestServiceExportAvailability(t *testing.T) {
12621247 },
12631248 },
12641249 wantManifestProcessingAvailabilityResultType : ManifestProcessingAvailabilityResultTypeNotYetAvailable ,
1265- err : fmt .Errorf ("the weight annotation is not in the range [0, 1000]: 1002" ),
12661250 },
12671251 }
12681252
@@ -1274,14 +1258,8 @@ func TestServiceExportAvailability(t *testing.T) {
12741258 }
12751259 svcExport .Status = tc .status
12761260 gotResTyp , err := trackServiceExportAvailability (toUnstructured (t , svcExport ))
1277-
1278- // Check for errors
12791261 if err != nil {
1280- if tc .err == nil || err .Error () != tc .err .Error () {
1281- t .Fatalf ("trackServiceExportAvailability() = %v, want %v" , err , tc .err )
1282- }
1283- } else if tc .err != nil {
1284- t .Fatalf ("trackServiceExportAvailability() = nil, want error: %v" , tc .err )
1262+ t .Fatalf ("trackServiceExportAvailability() = %v, want no error" , err )
12851263 }
12861264
12871265 // Check the result type
0 commit comments