File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,8 +13,6 @@ IMG ?= auto-discovery-secret-extractor
1313# Tag used for the image
1414IMG_TAG ?= sha-$$(git rev-parse --short HEAD )
1515
16- JEST_VERSION ?= 27.0.6
17-
1816
1917# #@ General
2018
@@ -52,7 +50,7 @@ integration-test: docker-build docker-export kind-import
5250 ./integration-test/test-pod.sh ${IMG_NS} /${IMG} :${IMG_TAG}
5351 kubectl wait --for=condition=ready --timeout=60s -n integration-test pod/init-container-test
5452
55- cd integration-test && npm ci && npx --yes --package jest@$(JEST_VERSION) jest --ci --colors --coverage --passWithNoTests
53+ cd integration-test && npm ci && npm run test:integration
5654
5755# #@ Build
5856
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ integration-tests: ## 🩺 Start integration test for this module in the namespa
4646 @if [ -d " $( hook-prefix) /integration-tests" ]; then \
4747 kubectl -n integration-tests delete scans --all; \
4848 npm ci --prefix $(TESTS_HELPERS_DIR ) ; \
49- cd $(hook-prefix ) /integration-tests && npm ci && npm run test --package jest@ $( JEST_VERSION ) ; \
49+ cd $(hook-prefix ) /integration-tests && npm ci && npm run test:integration \
5050 else \
5151 echo " .: 🚫 Integration tests folder for $( name) does not exist, skipped." ; \
5252 fi
Original file line number Diff line number Diff line change @@ -89,4 +89,4 @@ deploy-with-scanner:
8989integration-tests :
9090 @echo " .: 🩺 Starting integration test in kind namespace 'integration-tests'."
9191 kubectl -n integration-tests delete scans --all
92- cd $(SCANNERS_DIR ) && npm ci && cd $(scanner ) /integration-tests && npm run test --yes --package jest@ $( JEST_VERSION ) $(scanner ) /integration-tests
92+ cd $(SCANNERS_DIR ) && npm ci && cd $(scanner ) /integration-tests && npm run test:integration -- $(scanner ) /integration-tests
Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ integration-tests:
1717 @echo " .: 🩺 Starting integration test in kind namespace 'integration-tests'."
1818 kubectl -n integration-tests delete scans --all
1919 kubectl apply -f ./integration-tests/configmap-wordlist.yaml -n integration-tests
20- cd $(SCANNERS_DIR ) && npm ci && cd $(scanner ) /integration-tests && npm run test --yes --package jest@ $( JEST_VERSION ) $(scanner ) /integration-tests
20+ cd $(SCANNERS_DIR ) && npm ci && cd $(scanner ) /integration-tests && npm run test:integration -- $(scanner ) /integration-tests
Original file line number Diff line number Diff line change @@ -22,4 +22,4 @@ integration-tests:
2222 # kubectl -n integration-tests delete scans --all
2323 # cd ../../tests/integration/ && npm ci
2424 # cd ../../scanners/${scanner}
25- # npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
25+ # npm run test:integration -- ${scanner}/integration-tests
Original file line number Diff line number Diff line change @@ -12,5 +12,5 @@ integration-tests:
1212 cd $(PROJECT_DIR ) /tests/integration/ && npm ci
1313 cd $(SCANNERS_DIR ) /${scanner}
1414 kubectl -n integration-tests create configmap semgrep-test-file --from-file=integration-tests/testfile.py
15- npx --yes --package jest@ $( JEST_VERSION ) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner} /integration-tests
15+ npm run test:integration -- ${scanner} /integration-tests
1616 kubectl -n integration-tests delete configmap semgrep-test-file
Original file line number Diff line number Diff line change @@ -24,4 +24,4 @@ deploy-with-scanner:
2424integration-tests :
2525 @echo " .: 🩺 Starting integration test in kind namespace 'integration-tests'."
2626 kubectl -n integration-tests delete scans --all
27- cd $(PROJECT_DIR ) /tests/integration/ && npm ci && npx --yes --package jest@ $( JEST_VERSION ) jest --verbose --ci --colors --coverage --passWithNoTests generic/findings-validation.test.js
27+ cd $(PROJECT_DIR ) /tests/integration/ && npm ci && npm run test:integration -- generic/findings-validation.test.js
Original file line number Diff line number Diff line change @@ -43,4 +43,4 @@ integration-tests:
4343 @echo " .: 🩺 Starting integration test in kind namespace 'integration-tests'."
4444 kubectl -n integration-tests delete scans --all
4545 kubectl apply -f ./integration-tests/scantype-configMap.yaml -n integration-tests
46- cd $(SCANNERS_DIR ) && npm ci && cd $(scanner ) /integration-tests && npm run test --yes --package jest@ $( JEST_VERSION ) $(scanner ) /integration-tests
46+ cd $(SCANNERS_DIR ) && npm ci && cd $(scanner ) /integration-tests && npm run test:integration -- $(scanner ) /integration-tests
Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ integration-tests:
2121 --set=" parser.image.repository=docker.io/$( IMG_NS) /$( parser-prefix) -zap" \
2222 --set=" parser.image.tag=$( IMG_TAG) "
2323 kubectl apply -f ./integration-tests/automation-framework-configMap.yaml -n integration-tests
24- cd $(SCANNERS_DIR ) && npm ci && cd $(scanner ) /integration-tests && npm run test --yes --package jest@ $( JEST_VERSION ) $(scanner ) /integration-tests
24+ cd $(SCANNERS_DIR ) && npm ci && cd $(scanner ) /integration-tests && npm run test:integration -- $(scanner ) /integration-tests
Original file line number Diff line number Diff line change 3636# IMG_TAG: Tag used to tag the newly created image. Defaults to the shortened commit hash
3737# prefixed with `sha-` e.g. `sha-ef8de4b7`
3838#
39- # JEST_VERSION: Defines the jest version used for executing the tests. Defaults to latest
40- #
4139# KIND_CLUSTER_NAME: Defines the name of the kind cluster (created by kind create cluster --name cluster-name)
4240#
4341# Examples:
@@ -53,7 +51,6 @@ IMG_NS ?= securecodebox
5351GIT_TAG ?= $$(git rev-parse --short HEAD )
5452BASE_IMG_TAG ?= sha-$(GIT_TAG )
5553IMG_TAG ?= "sha-$(GIT_TAG ) "
56- JEST_VERSION ?= 29.3.1
5754KIND_CLUSTER_NAME ?= kind
5855
5956parser-prefix = parser
@@ -74,9 +71,9 @@ install-deps-js:
7471 cd ${module} / && npm ci
7572
7673.PHONY : unit-test-js
77- unit-test-js : install-deps-js
78- @echo " .: 🧪 Starting unit-tests for '$( name) ' $( module) with 'jest@ $( JEST_VERSION ) ' ."
79- npx --yes --package jest@ $( JEST_VERSION ) jest --ci --colors --coverage --passWithNoTests ${name} /${module} / --testPathIgnorePatterns /integration-tests/
74+ unit-test-js :
75+ @echo " .: 🧪 Starting unit-tests for '$( name) ' $( module) ."
76+ npm run test:unit -- ${name} /${module} /
8077
8178.PHONY : install-deps-py
8279install-deps-py :
You can’t perform that action at this time.
0 commit comments