summaryrefslogtreecommitdiff
path: root/test/test-lib.bash
diff options
context:
space:
mode:
authorAnish Athalye <me@anishathalye.com>2020-01-03 15:20:00 -0500
committerAnish Athalye <me@anishathalye.com>2020-01-03 15:34:46 -0500
commit6d24613b0b453e546fa4e9defc695d8f982743c9 (patch)
tree7e5124b2606284ef761cd69fcb8892d0038d297d /test/test-lib.bash
parent1e1885c45a28190dc1cbde993a9ddcf1729ee4d1 (diff)
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.
Diffstat (limited to 'test/test-lib.bash')
-rw-r--r--test/test-lib.bash13
1 files changed, 5 insertions, 8 deletions
diff --git a/test/test-lib.bash b/test/test-lib.bash
index e4d9a4e..fba9aa0 100644
--- a/test/test-lib.bash
+++ b/test/test-lib.bash
@@ -1,6 +1,5 @@
DEBUG=${DEBUG:-false}
-USE_VAGRANT=${USE_VAGRANT:-true}
-DOTBOT_EXEC=${DOTBOT_EXEC:-"python /dotbot/bin/dotbot"}
+DOTBOT_EXEC="${BASEDIR}/bin/dotbot"
DOTFILES="/home/$(whoami)/dotfiles"
INSTALL_CONF='install.conf.yaml'
INSTALL_CONF_JSON='install.conf.json'
@@ -29,17 +28,15 @@ test_expect_failure() {
fi
}
-check_vm() {
- if [ "$(whoami)" != "vagrant" ]; then
- >&2 echo "test can't run outside vm!"
+check_env() {
+ if [ "${DOTBOT_TEST}" != "true" ]; then
+ >&2 echo "test must be run by test driver"
exit 1
fi
}
initialize() {
- if ${USE_VAGRANT}; then
- check_vm
- fi
+ check_env
echo "${test_description}"
mkdir -p "${DOTFILES}"
cd