From 377de97c29cd900639f8de9d6f9d6675237bd6a7 Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Molins Date: Fri, 22 Mar 2024 12:26:20 +0100 Subject: [PATCH] Fail step if test command fails (system flags) --- scripts/test-system-test-flags.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/test-system-test-flags.sh b/scripts/test-system-test-flags.sh index c2aca5ae0..7c5f2075e 100755 --- a/scripts/test-system-test-flags.sh +++ b/scripts/test-system-test-flags.sh @@ -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 \ @@ -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 \ @@ -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}" \