Run integration tests in parallel when possible.
This commit is contained in:
1 parent
4da999ba86
commit
669a0db528
12 files changed
+260
-31
No files matched your search
+8
-28
@@ -10,37 +10,17 @@ if ! bash "$DIR/sanity_check.sh"; then
|
||||
fi
|
||||
whitely echo ...ok
|
||||
|
||||
# Modified version of _assert_cleanup from assert.sh that
|
||||
# prints overall status
|
||||
check_test_status() {
|
||||
if [ $? -ne 0 ]; then
|
||||
redly echo "---= !!!ABNORMAL TEST TERMINATION!!! =---"
|
||||
elif [ $tests_suite_status -ne 0 ]; then
|
||||
redly echo "---= !!!SUITE FAILURES - SEE ABOVE FOR DETAILS!!! =---"
|
||||
exit $tests_suite_status
|
||||
else
|
||||
greenly echo "---= ALL SUITES PASSED =---"
|
||||
fi
|
||||
}
|
||||
# Overwrite assert.sh _assert_cleanup trap with our own
|
||||
trap check_test_status EXIT
|
||||
|
||||
TESTS="${@:-*_test.sh}"
|
||||
TESTS="${@:-$(find . -name '*_test.sh')}"
|
||||
RUNNER_ARGS=""
|
||||
|
||||
# If running on circle, use the scheduler to work out what tests to run
|
||||
if [ -n "$CIRCLECI" -a -z "$NO_SCHEDULER" ]; then
|
||||
TESTS=$(echo $TESTS | "$DIR/sched" sched integration-$CIRCLE_BUILD_NUM $CIRCLE_NODE_TOTAL $CIRCLE_NODE_INDEX)
|
||||
RUNNER_ARGS="$RUNNER_ARGS -scheduler"
|
||||
fi
|
||||
|
||||
echo Running $TESTS
|
||||
# If running on circle or PARALLEL is not empty, run tests in parallel
|
||||
if [ -n "$CIRCLECI" -o -z "$PARALLEL" ]; then
|
||||
RUNNER_ARGS="$RUNNER_ARGS -parallel"
|
||||
fi
|
||||
|
||||
for t in $TESTS; do
|
||||
echo
|
||||
greyly echo "---= Running $t =---"
|
||||
. $t
|
||||
|
||||
# Report test runtime when running on circle, to help scheduler
|
||||
if [ -n "$CIRCLECI" -a -z "$NO_SCHEDULER" ]; then
|
||||
"$DIR/sched" time $t $(bc -l <<< "$tests_time/1000000000")
|
||||
fi
|
||||
done
|
||||
../testing/runner/runner $RUNNER_ARGS $TESTS
|
||||
Reference in new issue
Block a user