From 6d24613b0b453e546fa4e9defc695d8f982743c9 Mon Sep 17 00:00:00 2001 From: Anish Athalye Date: Fri, 3 Jan 2020 15:20:00 -0500 Subject: Unify Vagrant and Travis-CI tests This patch makes the tests (including the test driver) run entirely inside Vagrant, which avoids calling the very slow `vagrant` driver many times for running the tests. On my machine, `./test` runs in 22 seconds, down from hundreds of seconds prior to this patch. This also has the nice side effect of matching how the Travis CI tests were run, so there's no need for a separate `test_travis` anymore. --- test/test | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'test/test') diff --git a/test/test b/test/test index c018c32..f944512 100755 --- a/test/test +++ b/test/test @@ -1,37 +1,21 @@ #!/usr/bin/env bash set -e -BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cd "${BASEDIR}" +export BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "${BASEDIR}/test" . "./driver-lib.bash" +date_stamp="$(date --rfc-3339=ns)" start="$(date +%s)" -check_prereqs || die "prerequisites unsatsfied." - -# command line options -while [[ $# > 1 ]] -do - key="${1}" - case $key in - -v|--version) - VERSION="${2}" - shift && shift - ;; - *) - # unknown option - break - ;; - esac -done -VERSION="${VERSION:-3.6.4}" +check_env declare -a tests=() if [ $# -eq 0 ]; then while read file; do tests+=("${file}") - done < <(find tests -type f -name '*.bash') + done < <(find tests -type f -name '*.bash' | sort) else tests=("$@") fi -- cgit v1.2.3