split tests up by shell for concurrency
More parallelism = faster tests. Also better isolation for changes that might only break on zsh or bash respectively. This is defined via env variable, so someone running locally will have all tests run sequentially as before.
This commit is contained in:
11
run_tests.sh
11
run_tests.sh
@@ -3,8 +3,15 @@
|
||||
|
||||
failed=false
|
||||
|
||||
# allow list of shells to run tests in to be overriden by environment variable
|
||||
# if empty or null, use defaults
|
||||
if [ -z "$TEST_SHELLS" ]; then
|
||||
TEST_SHELLS="bash zsh"
|
||||
fi
|
||||
|
||||
echo "== Will run all tests with following shells: ${TEST_SHELLS}"
|
||||
for test in $(find test/lib -name *_test.sh); do
|
||||
for shell in bash zsh; do
|
||||
for shell in $TEST_SHELLS; do
|
||||
echo "== Running tests with [$shell]: $test"
|
||||
$shell $test || failed=true
|
||||
done
|
||||
@@ -16,4 +23,4 @@ if [ "$failed" = "true" ]; then
|
||||
else
|
||||
echo "All tests passed!"
|
||||
return 0;
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user