Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unfrobulate "cleanup" in integration test #1170

Merged
merged 1 commit into from
Nov 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions _integration-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ trap_with_arg() {
done
}

DID_CLEAN_UP=0
# the cleanup function will be the exit point
cleanup () {
if [ "$DID_CLEAN_UP" -eq 1 ]; then
DID_TEAR_DOWN=0
# the teardown function will be the exit point
teardown() {
if [ "$DID_TEAR_DOWN" -eq 1 ]; then
return 0;
fi
DID_CLEAN_UP=1
DID_TEAR_DOWN=1

if [ "$1" != "EXIT" ]; then
echo "An error occurred, caught SIG$1 on line $2";
fi

echo "Cleaning up..."
echo "Tearing down ..."
rm $COOKIE_FILE
echo "Done."
}
trap_with_arg cleanup ERR INT TERM EXIT
trap_with_arg teardown ERR INT TERM EXIT
echo "${_endgroup}"

echo "${_group}Starting Sentry for tests ..."
Expand Down