Skip to content

Commit 76771f0

Browse files
committed
Scan result assertion message is inverted
It was mixing up the expected and actual result of the scan.
1 parent bf5fa89 commit 76771f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/e2e/framework/common.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ func (f *Framework) AssertScanIsCompliant(name, namespace string) error {
12311231
return err
12321232
}
12331233
if cs.Status.Result != compv1alpha1.ResultCompliant {
1234-
return fmt.Errorf("scan result was %s instead of %s", compv1alpha1.ResultCompliant, cs.Status.Result)
1234+
return fmt.Errorf("scan result was %s instead of %s", cs.Status.Result, compv1alpha1.ResultCompliant)
12351235
}
12361236
return nil
12371237
}
@@ -1309,7 +1309,7 @@ func (f *Framework) AssertScanIsNonCompliant(name, namespace string) error {
13091309
return err
13101310
}
13111311
if cs.Status.Result != compv1alpha1.ResultNonCompliant {
1312-
return fmt.Errorf("scan result was %s instead of %s", compv1alpha1.ResultNonCompliant, cs.Status.Result)
1312+
return fmt.Errorf("scan result was %s instead of %s", cs.Status.Result, compv1alpha1.ResultNonCompliant)
13131313
}
13141314
return nil
13151315
}
@@ -1322,7 +1322,7 @@ func (f *Framework) AssertScanIsNotApplicable(name, namespace string) error {
13221322
return err
13231323
}
13241324
if cs.Status.Result != compv1alpha1.ResultNotApplicable {
1325-
return fmt.Errorf("scan result was %s instead of %s", compv1alpha1.ResultNotApplicable, cs.Status.Result)
1325+
return fmt.Errorf("scan result was %s instead of %s", cs.Status.Result, compv1alpha1.ResultNotApplicable)
13261326
}
13271327
return nil
13281328
}
@@ -1335,7 +1335,7 @@ func (f *Framework) AssertScanIsInError(name, namespace string) error {
13351335
return err
13361336
}
13371337
if cs.Status.Result != compv1alpha1.ResultError {
1338-
return fmt.Errorf("scan result was %s instead of %s", compv1alpha1.ResultError, cs.Status.Result)
1338+
return fmt.Errorf("scan result was %s instead of %s", cs.Status.Result, compv1alpha1.ResultError)
13391339
}
13401340
if cs.Status.ErrorMessage == "" {
13411341
return fmt.Errorf("scan 'errormsg' is empty, but it should be set")

0 commit comments

Comments
 (0)