Skip to content

Commit

Permalink
Fail step if test command fails (system flags)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodm committed Mar 22, 2024
1 parent c40a1c2 commit 377de97
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions scripts/test-system-test-flags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,13 @@ run_tests_for_package() {
pushd "${package_folder}" > /dev/null

echo "--- [${package_name} - ${variant}] Setup service without tear-down"
elastic-package test system -v \
if ! elastic-package test system -v \
--report-format xUnit --report-output file \
--config-file "${config_file}" \
${variant_flag} \
--setup
--setup ; then
return 1
fi

# Tests after --setup
if ! tests_for_setup \
Expand All @@ -221,9 +223,11 @@ run_tests_for_package() {
echo "--- [${package_name} - ${variant}] Run tests without provisioning"
for i in $(seq 2); do
echo "--- Iteration #${i} --no-provision"
elastic-package test system -v \
if ! elastic-package test system -v \
--report-format xUnit --report-output file \
--no-provision
--no-provision ; then
return 1
fi

# Tests after --no-provision
if ! tests_for_no_provision \
Expand All @@ -235,9 +239,11 @@ run_tests_for_package() {
done

echo "--- [${package_name} - ${variant}] Run tear-down process"
elastic-package test system -v \
if ! elastic-package test system -v \
--report-format xUnit --report-output file \
--tear-down
--tear-down ; then
return 1
fi

if ! tests_for_tear_down \
"${service_deployer_type}" \
Expand Down

0 comments on commit 377de97

Please sign in to comment.