Skip to content

Commit

Permalink
Update local-test.sh to return test exit code (#6179)
Browse files Browse the repository at this point in the history
The `e2e:docker` command can run tests in a Docker container, but it always returns exit code 0 even if the tests failed. This PR resolves that and returns the exit code from the test command.
  • Loading branch information
dallonf authored and Timer committed Jan 11, 2019
1 parent c8a540d commit 132ac35
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tasks/local-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,15 @@ ${apply_changes}
node --version
npm --version
set +x
${test_command} && echo -e "\n\e[1;32m✔ Job passed\e[0m" || echo -e "\n\e[1;31m✘ Job failed\e[0m"
${test_command}
result_code=\$?
if [ \$result_code == 0 ]; then
echo -e "\n\e[1;32m✔ Job passed\e[0m"
else
echo -e "\n\e[1;31m✘ Job failed\e[0m"
fi
$([[ ${interactive} == 'true' ]] && echo 'bash')
exit \$result_code
CMD

docker run \
Expand Down

0 comments on commit 132ac35

Please sign in to comment.