Tests: run only on directories there are examples for

Signed-off-by: Silvio Moioli <silvio@moioli.net>
This commit is contained in:
Silvio Moioli
2022-05-23 13:12:54 +02:00
parent aed1efaf4b
commit 4eb268c81f

View File

@@ -18,28 +18,24 @@ if ! [ $(command -v fleet) ]; then
printf "Path to fleet binary: $FLEET_PATH\n" printf "Path to fleet binary: $FLEET_PATH\n"
fi fi
for i in ../single-cluster/*; do for fixture in ./expected/single-cluster/*; do
if [ ! -d $i ]; then case=${fixture#./expected/}
continue pushd ../$case
fi for env in dev test prod; do
pushd $i mkdir -p ../../tests/output/${case}
for j in dev test prod; do eval $FLEET_PATH test > ../../tests/output/${case}/${env}-output.yaml
mkdir -p ../../tests/output/garbage/${i} eval $FLEET_PATH apply -o - test > ../../tests/output/${case}/bundle.yaml
eval $FLEET_PATH test > ../../tests/output/garbage/${i}/${j}-output.yaml
eval $FLEET_PATH apply -o - test > ../../tests/output/garbage/${i}/bundle.yaml
done done
popd popd
done done
for i in ../multi-cluster/*; do for fixture in ./expected/multi-cluster/*; do
if [ ! -d $i ]; then case=${fixture#./expected/}
continue pushd ../$case
fi for env in dev test prod; do
pushd $i mkdir -p ../../tests/output/${case}
for j in dev test prod; do eval $FLEET_PATH test -l env=${env} > ../../tests/output/${case}/${env}-output.yaml
mkdir -p ../../tests/output/garbage/${i} eval $FLEET_PATH apply -n fleet-default -o - test > ../../tests/output/${case}/bundle.yaml
eval $FLEET_PATH test -l env=${j} > ../../tests/output/garbage/${i}/${j}-output.yaml
eval $FLEET_PATH apply -n fleet-default -o - test > ../../tests/output/garbage/${i}/bundle.yaml
done done
popd popd
done done