summaryrefslogtreecommitdiff
path: root/test/README.md
blob: 80ccf9936708ef88d51d844ed3e854040a0eb347 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Testing
=======

Dotbot testing code uses [Vagrant][vagrant] to run all tests inside a virtual
machine to have tests be completely isolated from the host machine. The test
driver relies on the [Sahara][sahara] plugin to snapshot and roll back virtual
machine state. The tests are deterministic, and each test is run in a virtual
machine with fresh state, ensuring that tests that modify system state are
easily repeatable.

Installing the Test environnement
---------------------------------

### Debian-based distributions

- Install the test requirements

```bash
sudo apt install vagrant virtualbox
```

- Install the [Sahara][sahara] Vagrant plugin

```bash
vagrant plugin install sahara
```

- Install Dotbot dependencies

```bash
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`.

When finished with testing, it is good to shut down the virtual machine by
running `vagrant halt`.

[vagrant]: https://www.vagrantup.com/
[sahara]: https://github.com/jedi4ever/sahara