From 784ab78c29d3473844417199102f927cc956f514 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Tue, 21 Apr 2015 15:01:18 -0700 Subject: [PATCH] Cat watchman logs if test fails --- scripts/e2e-test.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/e2e-test.sh b/scripts/e2e-test.sh index cbac436f1..dcafbf2be 100755 --- a/scripts/e2e-test.sh +++ b/scripts/e2e-test.sh @@ -18,8 +18,17 @@ export REACT_PACKAGER_LOG="$TEMP/server.log" MARKER=$(mktemp $ROOT/Examples/SampleApp/XXXXXXXX) function cleanup { + EXIT_CODE=$? set +e - [ -f $REACT_PACKAGER_LOG ] && cat $REACT_PACKAGER_LOG + + if [ $EXIT_CODE -ne 0 ]; + then + WATCHMAN_LOGS=/usr/local/Cellar/watchman/3.1/var/run/watchman/$USER.log + [ -f $WATCHMAN_LOGS ] && cat $WATCHMAN_LOGS + + [ -f $REACT_PACKAGER_LOG ] && cat $REACT_PACKAGER_LOG + fi + rm $MARKER [ $SINOPIA_PID ] && kill -9 $SINOPIA_PID [ -f ~/.npmrc.bak ] && mv ~/.npmrc.bak ~/.npmrc