From b6fd7ae829e2060a251fbe5cd06c7ab759f92e75 Mon Sep 17 00:00:00 2001 From: Matthew Rothenberg Date: Wed, 15 Oct 2014 14:12:24 -0400 Subject: [PATCH] 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. --- .travis.yml | 6 ++++++ run_tests.sh | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 30f5fa2..7abf0e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,12 @@ os: - linux - osx +env: + - TEST_SHELLS="zsh bash" + - TEST_SHELLS=bash + - TEST_SHELLS=zsh + - HI=mom + install: - ./test/support/travisci_deps.sh diff --git a/run_tests.sh b/run_tests.sh index fff4438..877f9ed 100755 --- a/run_tests.sh +++ b/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 \ No newline at end of file +fi