Skip to content

Commit 132ac35

Browse files
dallonfTimer
authored andcommitted
Update local-test.sh to return test exit code (facebook#6179)
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.
1 parent c8a540d commit 132ac35

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tasks/local-test.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,15 @@ ${apply_changes}
9898
node --version
9999
npm --version
100100
set +x
101-
${test_command} && echo -e "\n\e[1;32m✔ Job passed\e[0m" || echo -e "\n\e[1;31m✘ Job failed\e[0m"
101+
${test_command}
102+
result_code=\$?
103+
if [ \$result_code == 0 ]; then
104+
echo -e "\n\e[1;32m✔ Job passed\e[0m"
105+
else
106+
echo -e "\n\e[1;31m✘ Job failed\e[0m"
107+
fi
102108
$([[ ${interactive} == 'true' ]] && echo 'bash')
109+
exit \$result_code
103110
CMD
104111

105112
docker run \

0 commit comments

Comments
 (0)