From 05a7410f629756864644cc75bd2e616c3b250a0d Mon Sep 17 00:00:00 2001 From: Mario Manno Date: Tue, 23 Aug 2022 15:31:29 +0200 Subject: [PATCH] Print fleet binary version before running tests * remove interactive prompt for querying binary path * add proper quotes around variables * remove eval, not using FLEET_PATH to construct a command line --- tests/test.sh | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/tests/test.sh b/tests/test.sh index ad16032..d956ef2 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -3,39 +3,30 @@ set -e export COMMIT=fake -cd $(dirname $0) +cd "$(dirname "$0")" rm -rf output -FLEET_PATH=fleet -if ! [ $(command -v fleet) ]; then - printf "Not found in PATH: fleet\n" - read -p "Specify path to fleet binary (leave blank to exit): " TEMP_FLEET_PATH - if ! [ $TEMP_FLEET_PATH ]; then - exit 0 - fi - FLEET_PATH=$(realpath $TEMP_FLEET_PATH) - printf "Path to fleet binary: $FLEET_PATH\n" -fi +fleet -v for fixture in ./expected/single-cluster/*; do case=${fixture#./expected/} - pushd ../$case + pushd "../$case" for env in dev test prod; do - mkdir -p ../../tests/output/${case} - eval $FLEET_PATH test > ../../tests/output/${case}/${env}-output.yaml - eval $FLEET_PATH apply -o - test > ../../tests/output/${case}/bundle.yaml + mkdir -p ../../tests/output/"${case}" + fleet test > "../../tests/output/${case}/${env}-output.yaml" + fleet apply -o - test > "../../tests/output/${case}/bundle.yaml" done popd done for fixture in ./expected/multi-cluster/*; do case=${fixture#./expected/} - pushd ../$case + pushd "../$case" for env in dev test prod; do - mkdir -p ../../tests/output/${case} - eval $FLEET_PATH test -l env=${env} > ../../tests/output/${case}/${env}-output.yaml - eval $FLEET_PATH apply -n fleet-default -o - test > ../../tests/output/${case}/bundle.yaml + mkdir -p ../../tests/output/"${case}" + fleet test -l env="${env}" > "../../tests/output/${case}/${env}-output.yaml" + fleet apply -n fleet-default -o - test > "../../tests/output/${case}/bundle.yaml" done popd done