Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions auto-discovery/kubernetes/pull-secret-extractor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ IMG ?= auto-discovery-secret-extractor
# Tag used for the image
IMG_TAG ?= sha-$$(git rev-parse --short HEAD)

JEST_VERSION ?= 27.0.6


##@ General

Expand Down Expand Up @@ -52,7 +50,7 @@ integration-test: docker-build docker-export kind-import
./integration-test/test-pod.sh ${IMG_NS}/${IMG}:${IMG_TAG}
kubectl wait --for=condition=ready --timeout=60s -n integration-test pod/init-container-test

cd integration-test && npm ci && npx --yes --package jest@$(JEST_VERSION) jest --ci --colors --coverage --passWithNoTests
cd integration-test && npm ci && npm run test:integration

##@ Build

Expand Down
8,744 changes: 8,066 additions & 678 deletions auto-discovery/kubernetes/pull-secret-extractor/integration-test/package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
"version": "1.0.0",
"description": "",
"scripts": {
"test": "pull-secret-extraction.test.js"
"test": "pull-secret-extraction.test.js",
"test:integration": "jest --verbose --ci --colors --coverage --passWithNoTests"
},
"author": "iteratec GmbH",
"license": "Apache-2.0",
"dependencies": {
"@kubernetes/client-node": "^0.18.1"
},
"devDependencies": {
"jest": "^29.3.1",
"jest-runner-eslint": "^1.1.0"
}
}
2 changes: 1 addition & 1 deletion hooks.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ integration-tests: ## 🩺 Start integration test for this module in the namespa
@if [ -d "$(hook-prefix)/integration-tests" ]; then \
kubectl -n integration-tests delete scans --all; \
npm ci --prefix $(TESTS_HELPERS_DIR); \
cd $(hook-prefix)/integration-tests && npm ci && npm run test --package jest@$(JEST_VERSION); \
cd $(hook-prefix)/integration-tests && npm ci && npm run test:integration \
else \
echo ".: 🚫 Integration tests folder for $(name) does not exist, skipped."; \
fi
Expand Down
3 changes: 2 additions & 1 deletion hooks/cascading-scans/hook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"main": "hook.js",
"scripts": {
"build": "npx tsc hook.ts --sourceMap --esModuleInterop",
"test": "npm run build && jest --verbose --ci --colors --coverage --passWithNoTests"
"test:unit": "jest --verbose --testPathIgnorePatterns /integration-tests/ --ci --colors --coverage --passWithNoTests",
"test:integration": "jest --verbose --ci --colors --coverage --passWithNoTests"
},
"keywords": [
"secureCodeBox",
Expand Down
3 changes: 2 additions & 1 deletion hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"example": "example"
},
"scripts": {
"test": "jest --verbose --ci --colors --coverage --passWithNoTests"
"test:unit": "jest --verbose --testPathIgnorePatterns /integration-tests/ --ci --colors --coverage --passWithNoTests",
"test:integration": "jest --verbose --ci --colors --coverage --passWithNoTests"
},
"keywords": [
"secureCodeBox",
Expand Down
2 changes: 1 addition & 1 deletion scanners.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ deploy-with-scanner:
integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd $(SCANNERS_DIR) && npm ci && cd $(scanner)/integration-tests && npm run test --yes --package jest@$(JEST_VERSION) $(scanner)/integration-tests
cd $(SCANNERS_DIR) && npm ci && cd $(scanner)/integration-tests && npm run test:integration -- $(scanner)/integration-tests
2 changes: 1 addition & 1 deletion scanners/ffuf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
kubectl apply -f ./integration-tests/configmap-wordlist.yaml -n integration-tests
cd $(SCANNERS_DIR) && npm ci && cd $(scanner)/integration-tests && npm run test --yes --package jest@$(JEST_VERSION) $(scanner)/integration-tests
cd $(SCANNERS_DIR) && npm ci && cd $(scanner)/integration-tests && npm run test:integration -- $(scanner)/integration-tests
2 changes: 1 addition & 1 deletion scanners/git-repo-scanner/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ integration-tests:
#kubectl -n integration-tests delete scans --all
#cd ../../tests/integration/ && npm ci
#cd ../../scanners/${scanner}
#npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
#npm run test:integration -- ${scanner}/integration-tests
3 changes: 2 additions & 1 deletion scanners/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"main": "index.js",
"scripts": {
"test": "jest --verbose --ci --colors --coverage --passWithNoTests"
"test:unit": "jest --verbose --testPathIgnorePatterns /integration-tests/ --ci --colors --coverage --passWithNoTests",
"test:integration": "jest --verbose --ci --colors --coverage --passWithNoTests"
},
"keywords": [
"secureCodeBox",
Expand Down
2 changes: 1 addition & 1 deletion scanners/semgrep/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ integration-tests:
cd $(PROJECT_DIR)/tests/integration/ && npm ci
cd $(SCANNERS_DIR)/${scanner}
kubectl -n integration-tests create configmap semgrep-test-file --from-file=integration-tests/testfile.py
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
npm run test:integration -- ${scanner}/integration-tests
kubectl -n integration-tests delete configmap semgrep-test-file
2 changes: 1 addition & 1 deletion scanners/test-scan/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ deploy-with-scanner:
integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd $(PROJECT_DIR)/tests/integration/ && npm ci && npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests generic/findings-validation.test.js
cd $(PROJECT_DIR)/tests/integration/ && npm ci && npm run test:integration -- generic/findings-validation.test.js
2 changes: 1 addition & 1 deletion scanners/zap-advanced/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
kubectl apply -f ./integration-tests/scantype-configMap.yaml -n integration-tests
cd $(SCANNERS_DIR) && npm ci && cd $(scanner)/integration-tests && npm run test --yes --package jest@$(JEST_VERSION) $(scanner)/integration-tests
cd $(SCANNERS_DIR) && npm ci && cd $(scanner)/integration-tests && npm run test:integration -- $(scanner)/integration-tests
2 changes: 1 addition & 1 deletion scanners/zap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ integration-tests:
--set="parser.image.repository=docker.io/$(IMG_NS)/$(parser-prefix)-zap" \
--set="parser.image.tag=$(IMG_TAG)"
kubectl apply -f ./integration-tests/automation-framework-configMap.yaml -n integration-tests
cd $(SCANNERS_DIR) && npm ci && cd $(scanner)/integration-tests && npm run test --yes --package jest@$(JEST_VERSION) $(scanner)/integration-tests
cd $(SCANNERS_DIR) && npm ci && cd $(scanner)/integration-tests && npm run test:integration -- $(scanner)/integration-tests
7 changes: 2 additions & 5 deletions test-base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ endif
# IMG_TAG: Tag used to tag the newly created image. Defaults to the shortened commit hash
# prefixed with `sha-` e.g. `sha-ef8de4b7`
#
# JEST_VERSION: Defines the jest version used for executing the tests. Defaults to latest
#
# KIND_CLUSTER_NAME: Defines the name of the kind cluster (created by kind create cluster --name cluster-name)
#
# Examples:
Expand All @@ -53,7 +51,6 @@ IMG_NS ?= securecodebox
GIT_TAG ?= $$(git rev-parse --short HEAD)
BASE_IMG_TAG ?= sha-$(GIT_TAG)
IMG_TAG ?= "sha-$(GIT_TAG)"
JEST_VERSION ?= 29.3.1
KIND_CLUSTER_NAME ?= kind

parser-prefix = parser
Expand All @@ -75,8 +72,8 @@ install-deps-js:

.PHONY: unit-test-js
unit-test-js: install-deps-js
@echo ".: 🧪 Starting unit-tests for '$(name)' $(module) with 'jest@$(JEST_VERSION)'."
npx --yes --package jest@$(JEST_VERSION) jest --ci --colors --coverage --passWithNoTests ${name}/${module}/ --testPathIgnorePatterns /integration-tests/
@echo ".: 🧪 Starting unit-tests for '$(name)' $(module)."
npm run test:unit -- ${name}/${module}/

.PHONY: install-deps-py
install-deps-py:
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Integration Tests running on a real k8s cluster",
"main": "helpers",
"scripts": {
"test": "jest"
"test:unit": "jest --verbose --testPathIgnorePatterns /integration-tests/ --ci --colors --coverage --passWithNoTests",
"test:integration": "jest --verbose --ci --colors --coverage --passWithNoTests"
},
"keywords": [],
"author": "iteratec GmbH",
Expand Down