33# SPDX-License-Identifier: Apache-2.0
44
55PROJECT_DIR = $(shell pwd)
6- BIN_DIR = $(PROJECT_DIR ) /bin
6+ BIN_DIR = $(PROJECT_DIR ) /bin
77SCANNERS_DIR = $(PROJECT_DIR ) /scanners
8- HOOKS_DIR = $(PROJECT_DIR ) /hooks
9- DEMO_TARGETS_DIR = $(PROJECT_DIR ) /demo-targets
8+ HOOKS_DIR = $(PROJECT_DIR ) /hooks
9+ DEMO_TARGETS_DIR = $(PROJECT_DIR ) /demo-targets
1010OPERATOR_DIR = $(PROJECT_DIR ) /operator
11- AUTO_DISCOVERY_DIR = $(PROJECT_DIR ) /auto-discovery
11+ PARSER_SDK_DIR = $(PROJECT_DIR ) /parser-sdk/nodejs
12+ HOOK_SDK_DIR = $(PROJECT_DIR ) /hook-sdk/nodejs
13+ AUTO_DISCOVERY_DIR = $(PROJECT_DIR ) /auto-discovery
1214HELM_DOCS_DIR = $(PROJECT_DIR ) /.helm-docs
1315TEMPLATES_DIR = $(PROJECT_DIR ) /.templates
1416
1517SCANNERS_CHART_LIST := $(sort $(wildcard $(SCANNERS_DIR ) /* /Chart.yaml) )
1618SCANNERS_TEST_LIST := $(sort $(wildcard $(SCANNERS_DIR ) /* /Makefile) )
17- HOOKS_CHART_LIST := $(sort $(wildcard $(HOOKS_DIR ) /* /Chart.yaml) )
18- HOOKS_TEST_LIST := $(sort $(wildcard $(HOOKS_DIR ) /* /Makefile) )
19- DEMO_TARGETS_CHART_LIST := $(sort $(wildcard $(DEMO_TARGETS_DIR ) /* /Chart.yaml) )
19+ HOOKS_CHART_LIST := $(sort $(wildcard $(HOOKS_DIR ) /* /Chart.yaml) )
20+ HOOKS_TEST_LIST := $(sort $(wildcard $(HOOKS_DIR ) /* /Makefile) )
21+ DEMO_TARGETS_CHART_LIST := $(sort $(wildcard $(DEMO_TARGETS_DIR ) /* /Chart.yaml) )
2022# This find construct is based on https://stackoverflow.com/questions/4210042/how-to-exclude-a-directory-in-find-command/4210072#4210072
2123PACKAGE_JSON_LIST := $(shell find $(PROJECT_DIR ) \( \
2224 -name .git -o \
@@ -41,26 +43,33 @@ all: help
4143
4244.PHONY : npm-ci-all
4345npm-ci-all : # # Runs npm ci in all node module subfolders.
46+ @echo " Installing all NPM dependencies"
4447 @for package in $(PACKAGE_JSON_LIST ) ; do \
45- cd $$(dirname $${package} ) && npm ci; \
48+ echo " 🧱 Installing dependencies for $$ {package} " && cd $$(dirname $${package} ) && npm ci; \
4649 done
4750
4851.PHONY : npm-test-all
4952npm-test-all : # # Runs all Jest based test suites.
50- npm test -- --testPathIgnorePatterns /integration-tests/
53+ npm test -- --ci --colors --coverage -- testPathIgnorePatterns /integration-tests/
5154
5255.PHONY : test-all
53- test-all : install-operator # # Runs all makefile based test suites.
56+ test-all : install-operator install-sdks # # Runs all makefile based test suites (unit + integration Tests) .
5457 @echo " Running make test for all scanner and hook modules..."
5558 @for dir in $(SCANNERS_TEST_LIST ) $(HOOKS_TEST_LIST ) ; do \
56- cd $$(dirname $$dir) && $(MAKE) -s test || exit 1; \
59+ echo "🧪 Test Suite for $${dir}" && cd $$(dirname $$dir) && $(MAKE) -s test || exit 1; \
5760 done
5861
5962.PHONY : install-operator
6063install-operator : # # Install the operator for makefile based testing.
6164 @echo " Installing the operator for makefile based testing..."
6265 cd $(OPERATOR_DIR ) && $(MAKE ) -s docker-build docker-export kind-import helm-deploy
6366
67+ .PHONY : install-sdks
68+ install-sdks : # # Install the SDKs for makefile based testing.
69+ @echo " Installing the SDKs (parser, hooks) for makefile based testing..."
70+ cd $(PARSER_SDK_DIR ) && $(MAKE ) -s docker-build
71+ cd $(HOOK_SDK_DIR ) && $(MAKE ) -s docker-build
72+
6473.PHONY : readme
6574readme : # # Generate README.md based on Chart.yaml and template.
6675 $(BIN_DIR ) /generate-helm-docs.sh --readme $(PROJECT_DIR ) $(HELM_DOCS_DIR )
0 commit comments