Skip to content

Commit

Permalink
Set -x in the integration test (#522)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Jonathan Cohen authored Oct 24, 2019
1 parent 2e3266d commit a9aef69
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/shadowbox/integration_test/run_action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/shadowbox/integration_test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a9aef69

Please sign in to comment.