Skip to content

Commit 5bfa05d

Browse files
committed
.
1 parent ea2b732 commit 5bfa05d

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

commands/audit/audit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ func ProcessResultsAndOutput(auditResults *results.SecurityCommandResults, outpu
222222
return
223223
}
224224
// Only in case Xray's context was given (!auditCmd.IncludeVulnerabilities), and the user asked to fail the build accordingly, do so.
225-
// TODO eran fix the failBuild condition here as well and fix all relevant tests accordingly (run in CI)
226-
if failBuild && !auditResults.ResultContext.IncludeVulnerabilities && results.CheckIfFailBuild(auditResults.GetScaScansXrayResults()) {
225+
// TODO eran fix the failBuild condition here as well and fix all relevant tests accordingly (run in CI) - fixed
226+
if failBuild && auditResults.HasViolationContext() && results.CheckIfFailBuild(auditResults.GetScaScansXrayResults()) {
227227
err = results.NewFailBuildError()
228228
}
229229
return

git_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package main
22

33
import (
4-
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
54
"path/filepath"
65
"testing"
76

@@ -89,9 +88,12 @@ func TestGitAuditSimpleJson(t *testing.T) {
8988

9089
// TODO eran fix this flaky test - remove Ubuntu restriction in local
9190
func TestGitAuditViolationsWithIgnoreRule(t *testing.T) {
92-
if !coreutils.IsLinux() {
93-
t.Skip("Skipping test. This test only runs on Linux to avoid flaky tests when running in parallel tests.")
94-
}
91+
/*
92+
if !coreutils.IsLinux() {
93+
t.Skip("Skipping test. This test only runs on Linux to avoid flaky tests when running in parallel tests.")
94+
}
95+
96+
*/
9597
xrayVersion, xscVersion, testCleanUp := integration.InitGitTest(t, services.MinXrayVersionGitRepoKey)
9698
defer testCleanUp()
9799

@@ -106,7 +108,7 @@ func TestGitAuditViolationsWithIgnoreRule(t *testing.T) {
106108
// Run the audit command with git repo and verify violations are reported to the platform.
107109
createTestProjectRunGitAuditAndValidate(t, projectPath,
108110
auditCommandTestParams{Format: string(format.SimpleJson), WithLicense: true, WithVuln: true},
109-
xrayVersion, xscVersion, "",
111+
xrayVersion, xscVersion, "One or more of the detected violations are configured to fail the build that including them",
110112
validations.ValidationParams{
111113
Total: &validations.TotalCount{Licenses: 3, Violations: 12, Vulnerabilities: 12},
112114
// Check that we have at least one violation for each scan type. (IAC is not supported yet)

0 commit comments

Comments
 (0)