Skip to content

Commit

Permalink
Fix e2e yaml false success report 🛃
Browse files Browse the repository at this point in the history
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 <vdemeest@redhat.com>
  • Loading branch information
vdemeester committed Apr 26, 2019
1 parent 639b300 commit e222c62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 6 additions & 7 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function check_results() {
fi
done

echo "failed $failed"
return ${failed}
}

Expand All @@ -106,18 +107,16 @@ function run_yaml_tests() {
echo ">> Waiting for tests to finish"
for test in taskrun pipelinerun; do
if validate_run ${test}; then
echo "ERROR: tests timed out"
echo "ERROR: tests timed out"
fi
done

# 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
if check_results ${test}; then
echo ">> All YAML tests passed"
return 0
fi

return 1
}
Expand Down
4 changes: 3 additions & 1 deletion test/e2e-tests-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ 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

echo "failed $failed"

(( failed )) && fail_test

success

0 comments on commit e222c62

Please sign in to comment.