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 authored and tekton-robot committed Apr 27, 2019
1 parent 0dd031e commit c08c2c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
22 changes: 9 additions & 13 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-tests-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c08c2c4

Please sign in to comment.