From e7c56c7647ea491da3ecd13c80456c6f8b11d76a Mon Sep 17 00:00:00 2001 From: Matthew Rothenberg Date: Wed, 15 Oct 2014 16:36:43 -0400 Subject: [PATCH] only install zsh on boxes that need it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit don’t bother on macosx (preinstalled) or if the test matrix for that box isn’t going to be testing in zsh. this should speed up test runs for most cases, and later we can define fast_failure and not have to wait for the longer ones. --- test/support/travisci_deps.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/test/support/travisci_deps.sh b/test/support/travisci_deps.sh index d4523ee..83cc32e 100755 --- a/test/support/travisci_deps.sh +++ b/test/support/travisci_deps.sh @@ -7,8 +7,26 @@ # # Note: $TRAVIS_OS_NAME will only be set on text boxes with multi-os enabled, # so use negation test so it will fail gracefully on normal Travis linux setup. -# -# TODO: also perhaps later only on ZSH test box if we split those if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then - sudo apt-get install zsh + + # okay, so we know we're probably on a linux box (or at least not an osx box) + # at this point. do we need to install zsh? let's say the default case is no: + needs_zsh=false + + # check if zsh is listed in the TEST_SHELLS environment variable, set by + # our travis-ci build matrix. + if [[ $TEST_SHELLS =~ zsh ]]; then needs_zsh=true; fi + + # if there is NO $TEST_SHELLS env variable persent (which should never happen, + # but maybe someone has been monkeying with the .travis.yml), run_tests.sh is + # going to fall back onto the default of testing everything, so we need zsh. + if [[ -z "$TEST_SHELLS" ]]; then needs_zsh=true; fi + + # finally, we install zsh if needed! + if $needs_zsh ; then + sudo apt-get install zsh + else + echo "No deps required." + fi + fi