Skip to content

Commit 337d06a

Browse files
committed
split more audit for more speed
1 parent b662cad commit 337d06a

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ jobs:
8383
matrix:
8484
os: [ ubuntu, windows, macos ]
8585
suite:
86-
- name: 'General Suite (Jas, MultiTech, NoTech...)'
86+
- name: 'General Suite (Detection, MultiTech, NoTech...)'
8787
testFlags: '--test.audit'
88+
- name: 'JAS Suite'
89+
testFlags: '--test.audit.Jas'
8890
- name: 'Java Script Suite (Npm, Pnpm, Yarn)'
8991
testFlags: '--test.audit.JavaScript'
9092
- name: 'Python Suite (Pip, Pipenv, Poetry)'

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ go test -v github.com/jfrog/jfrog-cli-security [test-types] [flags]
7777
| `-test.artifactory` | [Optional] Artifactory integration tests |
7878
| `-test.xsc` | [Optional] XSC integration tests |
7979
| `-test.xray` | [Optional] Xray commands integration tests |
80-
| `-test.audit` | [Optional] Audit command general (Jas, MultiTech...) integration tests |
80+
| `-test.audit` | [Optional] Audit command general (Detection, NoTech, MultiTech...) integration tests |
81+
| `-test.audit.Jas` | [Optional] Audit command Jas integration tests |
8182
| `-test.audit.JavaScript` | [Optional] Audit command JavaScript technologies (Npm, Pnpm, Yarn)integration tests |
8283
| `-test.audit.Java` | [Optional] Audit command Java technologies (Maven, Gradle)integration tests |
8384
| `-test.audit.C` | [Optional] Audit command C/C++/C# technologies (Nuget/DotNet, Conan)integration tests |

tests/config.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var (
4545
TestGit *bool
4646

4747
TestAuditGeneral *bool
48+
TestAuditJas *bool
4849
TestAuditJavaScript *bool
4950
TestAuditJava *bool
5051
TestAuditCTypes *bool
@@ -94,7 +95,8 @@ func init() {
9495
TestEnrich = flag.Bool("test.enrich", false, "Run Enrich command integration tests")
9596
TestGit = flag.Bool("test.git", false, "Run Git commands integration tests")
9697

97-
TestAuditGeneral = flag.Bool("test.audit", false, "Run general (Jas, MultiTech...) audit integration tests")
98+
TestAuditGeneral = flag.Bool("test.audit", false, "Run general (Detection, NoTech, MultiTech...) audit integration tests")
99+
TestAuditJas = flag.Bool("test.audit.Jas", false, "Run Jas audit integration tests")
98100
TestAuditJavaScript = flag.Bool("test.audit.JavaScript", false, "Run JavaScript technologies (Npm, Pnpm, Yarn) audit integration tests")
99101
TestAuditJava = flag.Bool("test.audit.Java", false, "Run Java technologies (Maven, Gradle) audit integration tests")
100102
TestAuditCTypes = flag.Bool("test.audit.C", false, "Run C/C++/C# technologies (Nuget/DotNet, Conan) audit integration tests")
@@ -115,14 +117,15 @@ func init() {
115117
func InitTestFlags() {
116118
flag.Parse()
117119
// If no test types flags were set, run all types
118-
shouldRunAllTests := !isAtLeastOneFlagSet(TestUnit, TestArtifactory, TestXray, TestXsc, TestAuditGeneral, TestAuditJavaScript, TestAuditJava, TestAuditCTypes, TestAuditGo, TestAuditPython, TestScan, TestDockerScan, TestCuration, TestEnrich, TestGit)
120+
shouldRunAllTests := !isAtLeastOneFlagSet(TestUnit, TestArtifactory, TestXray, TestXsc, TestAuditGeneral, TestAuditJas, TestAuditJavaScript, TestAuditJava, TestAuditCTypes, TestAuditGo, TestAuditPython, TestScan, TestDockerScan, TestCuration, TestEnrich, TestGit)
119121
if shouldRunAllTests {
120122
log.Info("Running all tests. To run only specific tests, please specify the desired test flags.")
121123
*TestUnit = true
122124
*TestArtifactory = true
123125
*TestXray = true
124126
*TestXsc = true
125127
*TestAuditGeneral = true
128+
*TestAuditJas = true
126129
*TestAuditJavaScript = true
127130
*TestAuditJava = true
128131
*TestAuditCTypes = true

tests/testdata/projects/package-managers/go/missing-context/go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ module missing_context
22

33
go 1.22
44

5-
require github.com/hashicorp/consul v1.9.1
6-
7-
5+
require github.com/hashicorp/consul v1.9.1

tests/utils/integration/test_integrationutils.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ func InitAuditGeneralTests(t *testing.T, minVersion string) {
8989
testUtils.ValidateXrayVersion(t, minVersion)
9090
}
9191

92+
func InitAuditJasTest(t *testing.T, minVersion string) {
93+
if !*configTests.TestAuditJas {
94+
t.Skip(getSkipTestMsg("Audit command JFrog Artifactory Security integration", "--test.audit.Jas"))
95+
}
96+
testUtils.ValidateXrayVersion(t, minVersion)
97+
}
98+
9299
func InitAuditJavaScriptTest(t *testing.T, minVersion string) {
93100
if !*configTests.TestAuditJavaScript {
94101
t.Skip(getSkipTestMsg("Audit command JavaScript technologies (Npm, Pnpm, Yarn) integration", "--test.audit.JavaScript"))

0 commit comments

Comments
 (0)