deckhand/tools/run_pifpaf.sh
Felipe Monteiro ba1fe1c9ec Fix pifpaf not returning error code upon test failure
For whatever reason, the following command:

   pifpaf run postgresql -- <test command>

is not returning a non-zero error code on test failure.

(An example print out is included below.)

This PS updates pretty_tox.sh to forcibly raise a non-zero error
code in the event of test failure. It also renames the script
to run_pifpaf.sh to be more intuitive.

Example:

======
Totals
======
Ran: 7 tests in 5.7673 sec.
 - Passed: 6
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 1
Sum of execute time for each test: 2.6962 sec.

==============
Worker Balance
==============
 - Worker 0 (7 tests) => 0:00:02.698323
+ exit 0

  py35: commands succeeded
  congratulations :)

Change-Id: I7b1fa9d42295d06752997f251a0ec14082b44d03
2018-01-15 17:01:34 -05:00

24 lines
491 B
Bash
Executable File

#!/usr/bin/env bash
# This script is used for guaranteeing that `pifpaf` returns non-zero codes
# upon test failure.
function cleanup {
pifpaf_stop
}
trap cleanup EXIT
# Instantiate an ephemeral PostgreSQL DB and print out the `pifpaf` environment
# variables for debugging purposes.
set -ex
eval `pifpaf run postgresql`
env | grep PIFPAF
set +ex
set -eo pipefail
TESTRARGS=$1
python setup.py testr --slowest --testr-args="--subunit --concurrency=1 $TESTRARGS" | subunit-trace -f