Skip to content

Commit 54ca2d2

Browse files
authored
chore(e2e): skip feature-level FixedBy assertions (#2491)
1 parent 8edc3aa commit 54ca2d2

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

e2etests/grpc_full_test.go

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"context"
1010
"fmt"
1111
"sort"
12-
"strings"
1312
"testing"
1413

1514
"github.com/stackrox/scanner/api/v1/features"
@@ -96,22 +95,14 @@ func verifyImage(t *testing.T, imgScan *v1.Image, test testCase) {
9695
assert.Truef(t, foundMatch, "Expected to find %s in scan results\nFound the following: %s", expectedVuln.Name, matching.Vulnerabilities)
9796
}
9897
}
99-
// Check feature FixedBy, and provide the related vulnerability if they differ.
100-
if feature.GetFixedBy() != matching.GetFixedBy() {
101-
var vulns []string
102-
for _, v := range matching.GetVulnerabilities() {
103-
if strings.Contains(v.GetFixedBy(), matching.GetFixedBy()) {
104-
vulns = append(vulns, fmt.Sprintf("%s (FixedBy: %s)", v.GetName(), v.GetFixedBy()))
105-
}
106-
}
107-
assert.Equalf(t, len(vulns), 0, "FixedBy: expecting %q, but found %q: Probably due to the following "+
108-
"vulnerabilities (verify if test case needs an update, or if it's a bug): %v)",
109-
feature.GetFixedBy(), matching.GetFixedBy(), vulns)
110-
}
111-
11298
feature.Vulnerabilities = nil
11399
matching.Vulnerabilities = nil
114100

101+
// Clear FixedBy as it changes frequently when new advisories are published.
102+
// The per-vulnerability FixedBy is still checked above via checkGRPCMatch().
103+
feature.FixedBy = ""
104+
matching.FixedBy = ""
105+
115106
// Ensure the parts of the feature aside from the provided executables and vulnerabilities are equal, too.
116107
assert.Equal(t, *feature, *matching)
117108
})

e2etests/sanity_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ func verifyImageHasExpectedFeatures(t *testing.T, client *client.Clairify, test
144144
feature.Vulnerabilities = nil
145145
matching.Vulnerabilities = nil
146146

147+
// Clear FixedBy as it changes frequently when new advisories are published.
148+
// The per-vulnerability FixedBy is still checked above via checkMatch().
149+
feature.FixedBy = ""
150+
matching.FixedBy = ""
151+
147152
// Ensure the parts of the feature aside from the provided executables and vulnerabilities are equal, too.
148153
assert.Equal(t, feature, *matching)
149154
})

0 commit comments

Comments
 (0)