Set -x in the integration test (#522)

* Set -x in the integration test

The integration test has been flaking from time to time on Travis with
no obvious failures, indicating this is happening unexpectedly outside a
`fail` call.  `set -x` will help us diagnose when it happens again.

* Only show logs on test failure

* Correctly continue if test.sh fails

* Only cleanup the logfile on success.  The logfile should stick around on
failure for easier sharing of test results.  It will eventually get
cleaned up whenever the tmp directory gets cleaned.
This commit is contained in:
Jonathan Cohen 2019-10-24 14:45:35 -04:00 committed by GitHub
parent 2e3266d529
commit a9aef69d3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View file

@ -16,5 +16,20 @@
do_action shadowbox/docker/build
LOGFILE=$(mktemp)
echo "Running Shadowbox integration test. Logs at $LOGFILE"
cd src/shadowbox/integration_test
./test.sh
result=0
if ./test.sh > $LOGFILE 2>&1 ; then
echo "Test Passed!"
rm $LOGFILE
else
result=$?
echo "Test Failed! Logs:"
cat $LOGFILE
fi
exit $result

View file

@ -30,6 +30,8 @@
#
# Each node runs on a different Docker container.
set -x
export DOCKER_CONTENT_TRUST=${DOCKER_CONTENT_TRUST:-1}
readonly OUTPUT_DIR=$(mktemp -d)