Skip to content

Commit 40f074c

Browse files
committed
fix ignore creation
1 parent 8deb9c0 commit 40f074c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xsc_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,15 @@ func TestXscAuditViolationsWithIgnoreRule(t *testing.T) {
7070
defer cleanUpWatch()
7171
// Run the audit command with git repo and verify violations are reported to the platform.
7272
output := testAuditCommand(t, cliToRun, auditCommandTestParams{Format: string(format.SimpleJson), WithLicense: true, WithVuln: true})
73-
validations.VerifySimpleJsonResults(t, output, validations.ValidationParams{Total: &validations.TotalCount{Licenses: 100, Violations: 100, Vulnerabilities: 100}})
73+
validations.VerifySimpleJsonResults(t, output, validations.ValidationParams{Total: &validations.TotalCount{Licenses: 3, Violations: 26, Vulnerabilities: 39}})
7474
// Create an ignore rule for the git repo
75-
securityTestUtils.CreateTestIgnoreRule(t, utils.IgnoreFilters{
75+
cleanUpIgnoreRule := securityTestUtils.CreateTestIgnoreRule(t, utils.IgnoreFilters{
7676
GitRepositories: []string{validations.TestMockGitInfo.GitRepoHttpsCloneUrl},
7777
Exposures: []utils.ExposuresFilterName{{Categories: []utils.ExposuresCategories{{Secrets: true, Iac: true}}}},
7878
Sast: []utils.SastFilterName{{Rule: []string{"any"}}},
7979
CVEs: []string{"any"},
8080
})
81+
defer cleanUpIgnoreRule()
8182
// Run the audit command and verify no issues.
8283
output = testAuditCommand(t, cliToRun, auditCommandTestParams{Format: string(format.SimpleJson)})
8384
validations.VerifySimpleJsonResults(t, output, validations.ValidationParams{ExactResultsMatch: true, Total: &validations.TotalCount{}})

0 commit comments

Comments
 (0)