2828#
2929# IMG_TAG: Tag used to tag the newly created image. Defaults to the shortend commit hash
3030# prefixed with `sha-` e.g. `sha-ef8de4b7`
31+ #
32+ # JEST_VERSION Defines the jest version used for executing the tests. Defaults to latest
3133
3234SHELL = /bin/sh
3335
3436IMG_NS ?= securecodebox
3537BASE_IMG_TAG ?= latest
3638IMG_TAG ?= sha-$$(git rev-parse --short HEAD )
39+ JEST_VERSION ?= latest
3740
3841hook = finding-post-processing
3942hook-prefix =
4043
41- all : | install-deps unit-tests build-images images-export kind-import deploy deploy-demo-apps integration-tests
44+ all : | install-deps unit-tests build-images images-export kind-import deploy deploy-test-deps integration-tests
4245
43- .PHONY : unit-tests install-deps build-images images-export kind-import deploy deploy-demo-apps integration-tests all
46+ .PHONY : unit-tests install-deps build-images images-export kind-import deploy deploy-test-deps integration-tests all
4447
4548unit-tests :
46- npm test -- --ci --colors --modulePathIgnorePatterns $( hook ) .test.js
49+ cd hook && npx --yes --package jest@ $( JEST_VERSION ) jest
4750
4851install-deps :
49- npm ci
52+ cd hook && npm ci
5053
5154build-images :
5255 @echo Build With BASE_IMG_TAG: $(BASE_IMG_TAG )
53- docker build --build-arg=baseImageTag=$(BASE_IMG_TAG ) --build-arg=namespace=$(IMG_NS ) -t $(IMG_NS ) /$(hook-prefix )$(hook ) :$(IMG_TAG ) .
56+ docker build --build-arg=baseImageTag=$(BASE_IMG_TAG ) --build-arg=namespace=$(IMG_NS ) -t $(IMG_NS ) /$(hook-prefix )$(hook ) :$(IMG_TAG ) -f ./hook/Dockerfile ./hook
5457
5558images-export :
5659 docker save $(IMG_NS ) /$(hook-prefix )$(hook ) :$(IMG_TAG ) -o $(hook-prefix )$(hook ) .tar
@@ -65,14 +68,15 @@ deploy:
6568 --set=" image.tag=$( IMG_TAG) "
6669
6770deploy-test-deps :
68- helm -n integration-tests upgrade --install test-scan ../../scanners/test-scan/
71+ helm -n integration-tests upgrade --install test-scan ../../scanners/test-scan/ \
72+ --set=" image.tag=$( BASE_IMG_TAG) " \
73+ --set=" parserImage.tag=$( BASE_IMG_TAG) "
6974
7075install-integration-test-deps :
71- cd ../../tests/integration && npm ci
7276
7377integration-tests :
7478 kubectl -n integration-tests delete scans --all
75- cd ../../tests/ integration/ && npm test -- --ci --colors $( hook ) .test.js
79+ cd integration-tests && npx --yes --package jest@ $( JEST_VERSION ) jest
7680
7781clean :
7882 rm ./$(hook-prefix )$(hook ) .tar
0 commit comments