From c08c2c4d4e02220d22de4dbdbf817a36dcecf162 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Fri, 26 Apr 2019 20:24:55 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20e2e=20yaml=20false=20success=20report=20?= =?UTF-8?q?=F0=9F=9B=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even if a `TaskRun`, or a `PipelineRun` fails, the script will return an exit code 0, which will show in CI as success. This fixes that. Signed-off-by: Vincent Demeester --- test/e2e-common.sh | 22 +++++++++------------- test/e2e-tests-yaml.sh | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/test/e2e-common.sh b/test/e2e-common.sh index 3da429824f9..d944eee5d11 100755 --- a/test/e2e-common.sh +++ b/test/e2e-common.sh @@ -103,21 +103,17 @@ function run_yaml_tests() { done # Wait for tests to finish. - echo ">> Waiting for tests to finish" - for test in taskrun pipelinerun; do - if validate_run ${test}; then - echo "ERROR: tests timed out" - fi - done + echo ">> Waiting for tests to finish for ${test}" + if validate_run $1; then + echo "ERROR: tests timed out" + fi # Check that tests passed. - echo ">> Checking test results" - for test in taskrun pipelinerun; do - if check_results ${test}; then - echo ">> All YAML tests passed" - return 0 - fi - done + echo ">> Checking test results for ${test}" + if check_results $1; then + echo ">> All YAML tests passed" + return 0 + fi return 1 } diff --git a/test/e2e-tests-yaml.sh b/test/e2e-tests-yaml.sh index 8e63c5cd225..d2143b8b2c3 100755 --- a/test/e2e-tests-yaml.sh +++ b/test/e2e-tests-yaml.sh @@ -37,9 +37,9 @@ for test in taskrun pipelinerun; do header "Running YAML e2e tests for ${test}s" if ! run_yaml_tests ${test}; then echo "ERROR: one or more YAML tests failed" - failed=1 output_yaml_test_results ${test} output_pods_logs ${test} + failed=1 fi done