From 50b668db91a425167eb426e9f8a64b1afc346704 Mon Sep 17 00:00:00 2001 From: LeeW Date: Mon, 17 Feb 2025 14:39:04 +0100 Subject: [PATCH] adds another test --- verify/test.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/verify/test.sh b/verify/test.sh index eaa293b..e487457 100755 --- a/verify/test.sh +++ b/verify/test.sh @@ -15,8 +15,6 @@ test -e "${secrets_file}" || (yq -n '.demo.credentials.secret = "hunter2"' > "${ set -x # SAMPLE COMMANDS - manually uncomment to try out -# TEST: induce error: invalid file -# ../bin/update_sops.sh "${secrets_file}" -s non_existing_secrets.yaml set +x # Special Case: Add caveat header @@ -83,6 +81,21 @@ else >&2 echo "# INFO: skipping ...." fi +# --- +if [[ 1 -eq 1 ]]; then + >&2 echo -e "# ---\n# TEST: induce error: invalid file" + # dev note: ':' is a noop operator; could also just temporarily disable strict errors + set -x + ../bin/update_sops.sh "${secrets_file}" -s non_existing_secrets.yaml > /dev/null 2>&1 || : + set +x + # teardown + # not necessary, all tracked in git + # enmesh: restore, since this particular one is checked in + git checkout "${PWD}/.sops.yaml" > /dev/null 2>&1 +else + >&2 echo "# INFO: skipping ...." +fi + # --- echo "TESTCASES PASSED"