Merge pull request #1209 from paulfantom/test-sh

scripts: move test.sh script into scripts dir
This commit is contained in:
Damien Grisonnet 2021-06-15 11:10:16 +02:00 committed by GitHub
commit 836fa4f086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -55,7 +55,7 @@ lint: $(JSONNETLINT_BIN) vendor
.PHONY: test
test: $(JB_BIN)
$(JB_BIN) install
./test.sh
./scripts/test.sh
.PHONY: test-e2e
test-e2e:

View File

@ -5,6 +5,8 @@ set -o pipefail
# Make sure to use project tooling
PATH="$(pwd)/tmp/bin:${PATH}"
TESTFILE="$(pwd)/tmp/test.jsonnet"
mkdir -p "$(pwd)/tmp"
for i in examples/jsonnet-snippets/*.jsonnet; do
[ -f "$i" ] || break
@ -14,13 +16,13 @@ for i in examples/jsonnet-snippets/*.jsonnet; do
snippet="local kp = $fileContent;
$(<examples/jsonnet-build-snippet/build-snippet.jsonnet)"
echo "${snippet}" > "test.jsonnet"
echo "${snippet}" > "${TESTFILE}"
echo "\`\`\`"
echo "${snippet}"
echo "\`\`\`"
echo ""
jsonnet -J vendor "test.jsonnet" > /dev/null
rm -rf "test.jsonnet"
jsonnet -J vendor "${TESTFILE}" > /dev/null
rm -rf "${TESTFILE}"
done
for i in examples/*.jsonnet; do