@@ -961,6 +961,9 @@ func testAuditCommandNewSca(t *testing.T, project string, params auditCommandTes
961961 params .CustomExclusion = []string {"*.git*" , "*node_modules*" , "*target*" , "*venv*" , "dist" }
962962 // Configure a new server named "default"
963963 cleanUpHome := securityIntegrationTestUtils .UseTestHomeWithDefaultXrayConfig (t )
964+ if params .Threads <= 0 {
965+ params .Threads = 5
966+ }
964967 defer cleanUpHome ()
965968 return securityTests .PlatformCli .WithoutCredentials ().RunCliCmdWithOutput (t , append ([]string {"audit" }, getAuditCmdArgs (params )... )... )
966969}
@@ -969,7 +972,6 @@ func TestAuditNewScaCycloneDxNpm(t *testing.T) {
969972 securityIntegrationTestUtils .InitAuditNewScaTests (t , scangraph .GraphScanMinXrayVersion )
970973 output := testAuditCommandNewSca (t , filepath .Join ("jas" , "jas-npm" ), auditCommandTestParams {
971974 WithSbom : true ,
972- Threads : 5 ,
973975 Format : format .CycloneDx ,
974976 })
975977 validations .VerifyCycloneDxResults (t , output , validations.ValidationParams {
@@ -986,6 +988,7 @@ func TestAuditNewScaCycloneDxNpm(t *testing.T) {
986988func TestAuditNewScaSimpleJsonViolations (t * testing.T ) {
987989 securityIntegrationTestUtils .InitAuditNewScaTests (t , scangraph .GraphScanMinXrayVersion )
988990
991+ // TODO:
989992 policyName , cleanUpPolicy := securityTestUtils .CreateTestSecurityPolicy (t , "static-sca-policy" , xrayUtils .High , false , false )
990993 defer cleanUpPolicy ()
991994 watchName , deleteWatch := securityTestUtils .CreateWatchOnArtifactoryRepos (t , policyName , "static-sca-watch" , "cli-scan-results" )
@@ -995,7 +998,6 @@ func TestAuditNewScaSimpleJsonViolations(t *testing.T) {
995998 WithSbom : true ,
996999 WithVuln : true ,
9971000 WithLicense : true ,
998- Threads : 5 ,
9991001 Format : format .SimpleJson ,
10001002 Watches : []string {watchName },
10011003 })
@@ -1006,8 +1008,9 @@ func TestAuditNewScaSimpleJsonViolations(t *testing.T) {
10061008 ValidateScan : & validations.ScanCount {Sca : 3 , Sast : 2 , Secrets : 1 },
10071009 ValidateApplicabilityStatus : & validations.ApplicabilityStatusCount {NotCovered : 2 , NotApplicable : 1 },
10081010 },
1011+ // SAST violations require git-repo watch to be created, so only SCA and Secrets violations are expected here
10091012 Violations : & validations.ViolationCount {
1010- ValidateScan : & validations.ScanCount {Sca : 3 , Sast : 1 , Secrets : 1 }, ValidateType : & validations.ScaViolationCount {Security : 3 },
1013+ ValidateScan : & validations.ScanCount {Sca : 3 , Secrets : 1 }, ValidateType : & validations.ScaViolationCount {Security : 3 },
10111014 },
10121015 })
10131016}
@@ -1034,7 +1037,6 @@ func TestAuditNewScaCycloneDxGradle(t *testing.T) {
10341037 securityIntegrationTestUtils .InitAuditNewScaTests (t , scangraph .GraphScanMinXrayVersion )
10351038 output := testAuditCommandNewSca (t , filepath .Join ("package-managers" , "gradle" , "gradle-lock" ), auditCommandTestParams {
10361039 WithSbom : true ,
1037- Threads : 5 ,
10381040 Format : format .CycloneDx ,
10391041 })
10401042 validations .VerifyCycloneDxResults (t , output , validations.ValidationParams {
@@ -1052,7 +1054,6 @@ func TestAuditNewScaCycloneDxGo(t *testing.T) {
10521054 securityIntegrationTestUtils .InitAuditNewScaTests (t , scangraph .GraphScanMinXrayVersion )
10531055 output := testAuditCommandNewSca (t , filepath .Join ("package-managers" , "go" , "simple-project" ), auditCommandTestParams {
10541056 WithSbom : true ,
1055- Threads : 5 ,
10561057 Format : format .CycloneDx ,
10571058 })
10581059 validations .VerifyCycloneDxResults (t , output , validations.ValidationParams {
@@ -1068,7 +1069,6 @@ func TestAuditNewScaCycloneDxYarn(t *testing.T) {
10681069 securityIntegrationTestUtils .InitAuditNewScaTests (t , scangraph .GraphScanMinXrayVersion )
10691070 output := testAuditCommandNewSca (t , filepath .Join ("package-managers" , "yarn" , "yarn-v3" ), auditCommandTestParams {
10701071 WithSbom : true ,
1071- Threads : 5 ,
10721072 Format : format .CycloneDx ,
10731073 })
10741074 validations .VerifyCycloneDxResults (t , output , validations.ValidationParams {
@@ -1086,7 +1086,6 @@ func TestAuditNewScaCycloneDxPip(t *testing.T) {
10861086 securityIntegrationTestUtils .InitAuditNewScaTests (t , scangraph .GraphScanMinXrayVersion )
10871087 output := testAuditCommandNewSca (t , filepath .Join ("jas" , "jas" ), auditCommandTestParams {
10881088 WithSbom : true ,
1089- Threads : 5 ,
10901089 Format : format .CycloneDx ,
10911090 })
10921091 validations .VerifyCycloneDxResults (t , output , validations.ValidationParams {
@@ -1103,7 +1102,6 @@ func TestAuditNewScaCycloneDxPoetry(t *testing.T) {
11031102 securityIntegrationTestUtils .InitAuditNewScaTests (t , scangraph .GraphScanMinXrayVersion )
11041103 output := testAuditCommandNewSca (t , filepath .Join ("package-managers" , "python" , "poetry" , "poetry-project" ), auditCommandTestParams {
11051104 WithSbom : true ,
1106- Threads : 5 ,
11071105 Format : format .CycloneDx ,
11081106 })
11091107 validations .VerifyCycloneDxResults (t , output , validations.ValidationParams {
@@ -1121,7 +1119,6 @@ func TestAuditNewScaCycloneDxPipenv(t *testing.T) {
11211119 securityIntegrationTestUtils .InitAuditNewScaTests (t , scangraph .GraphScanMinXrayVersion )
11221120 output := testAuditCommandNewSca (t , filepath .Join ("package-managers" , "python" , "pipenv" , "pipenv-lock" ), auditCommandTestParams {
11231121 WithSbom : true ,
1124- Threads : 5 ,
11251122 Format : format .CycloneDx ,
11261123 })
11271124 validations .VerifyCycloneDxResults (t , output , validations.ValidationParams {
@@ -1139,7 +1136,6 @@ func TestAuditNewScaCycloneDxNuget(t *testing.T) {
11391136 securityIntegrationTestUtils .InitAuditNewScaTests (t , scangraph .GraphScanMinXrayVersion )
11401137 output := testAuditCommandNewSca (t , filepath .Join ("package-managers" , "nuget" , "single4.0" ), auditCommandTestParams {
11411138 WithSbom : true ,
1142- Threads : 5 ,
11431139 Format : format .CycloneDx ,
11441140 })
11451141 validations .VerifyCycloneDxResults (t , output , validations.ValidationParams {
0 commit comments