diff options
author | Anish Athalye <me@anishathalye.com> | 2020-01-03 15:20:00 -0500 |
---|---|---|
committer | Anish Athalye <me@anishathalye.com> | 2020-01-03 15:34:46 -0500 |
commit | 6d24613b0b453e546fa4e9defc695d8f982743c9 (patch) | |
tree | 7e5124b2606284ef761cd69fcb8892d0038d297d /test/README.md | |
parent | 1e1885c45a28190dc1cbde993a9ddcf1729ee4d1 (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/README.md')
-rw-r--r-- | test/README.md | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/test/README.md b/test/README.md index 993a753..9ec79f5 100644 --- a/test/README.md +++ b/test/README.md @@ -36,14 +36,24 @@ git submodule update --init --recursive Running the Tests ----------------- -Before running the tests, the virtual machine must be running. It can be -started by running `vagrant up`. - -The test suite can be run by running `./test`. Selected tests can be run by -passing paths to the tests as arguments to `./test`. - -Tests can be run with a specific Python version by running `./test --version -<version>` - for example, `./test --version 3.4.3`. +Before running the tests, you must SSH into the VM. Start it with `vagrant up` +and SSH in with `vagrant ssh`. All following commands must be run inside the +VM. + +First, you must install a version of Python to test against, using `pyenv +install -s {version}`. You can choose any version you like, e.g. `3.8.1`. It +isn't particularly important to test against all supported versions of Python +in the VM, because they will be tested by CI. Once you've installed a specific +version of Python, activate it with `pyenv global {version}`. + +The VM mounts the Dotbot directory in `/dotbot` as read-only (you can make +edits on your host machine). You can run the test suite by `cd /dotbot/test` +and then running `./test`. Selected tests can be run by passing paths to the +tests as arguments, e.g. `./test tests/create.bash tests/defaults.bash`. + +To debug tests, you can prepend the line `DEBUG=true` as the first line to any +individual test (a `.bash` file inside `test/tests`). This will enable printing +stdout/stderr. When finished with testing, it is good to shut down the virtual machine by running `vagrant halt`. |