feat(test): add pragmas to examples, add example tests to build
This commit is contained in:
parent
cce8671596
commit
b7d0b43fd2
8
Makefile
8
Makefile
|
@ -87,9 +87,15 @@ build-bundle: node_modules
|
|||
build-image: build-bundle
|
||||
docker build $(ROOT_PATH)
|
||||
|
||||
test: build-bundle
|
||||
test: test-mocha test-examples
|
||||
|
||||
test-mocha: ## run small (unit) tests
|
||||
test-mocha: build-bundle
|
||||
$(NODE_BIN)/mocha $(TARGET_PATH)/test.js
|
||||
|
||||
test-examples: ## run medium (feature) tests
|
||||
$(SCRIPT_PATH)/test-examples.sh
|
||||
|
||||
yarn-install: ## install dependencies from package and lock file
|
||||
yarn
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
# test rules kubernetes
|
||||
# test tags kubernetes
|
||||
# test exit-status 1
|
||||
|
||||
metadata:
|
||||
name: example
|
||||
labels: {}
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
# test rules kubernetes
|
||||
# test tags kubernetes
|
||||
# test exit-status 0
|
||||
|
||||
metadata:
|
||||
name: example
|
||||
labels: {}
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
# test rules kubernetes
|
||||
# test tags kubernetes
|
||||
# test exit-status 1
|
||||
|
||||
metadata:
|
||||
name: example
|
||||
spec:
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
# test rules kubernetes
|
||||
# test tags kubernetes
|
||||
# test exit-status 1
|
||||
|
||||
metadata:
|
||||
name: example
|
||||
spec:
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# for each file in examples
|
||||
EXAMPLES="$(find examples -name '*.yml')"
|
||||
#! /bin/bash
|
||||
|
||||
EXAMPLES="$(find ./examples -name '*.yml')"
|
||||
echo "Found examples: ${EXAMPLES}"
|
||||
|
||||
while read -r example;
|
||||
do
|
||||
|
@ -22,7 +24,7 @@ do
|
|||
echo "Expected errors: ${EXPECTED_ERRORS}"
|
||||
echo "Expected status: ${EXPECTED_STATUS}"
|
||||
|
||||
node out/index.js --rules rules/${USE_RULES}.yml --tag ${USE_TAGS} --source ${example}
|
||||
node out/index.js --rules "rules/${USE_RULES}.yml" --tag ${USE_TAGS} --source ${example}
|
||||
|
||||
ACTUAL_STATUS=$?
|
||||
|
||||
|
@ -32,8 +34,3 @@ do
|
|||
exit 1
|
||||
fi
|
||||
done <<< "${EXAMPLES}"
|
||||
# read pragmas:
|
||||
# rules
|
||||
# tags
|
||||
|
||||
# run
|
Loading…
Reference in New Issue