1
0
Fork 0
mirror of synced 2024-11-22 16:25:34 -05:00
dotbot/test
2017-03-26 16:57:39 +03:00
..
tests Allow empty link sources 2016-11-23 14:11:45 -05:00
.editorconfig Add tests for more Python versions 2017-03-06 15:20:27 -05:00
.gitignore Add testing framework and tests 2015-05-05 20:11:46 -04:00
driver-lib.bash Add ability to test with specific Python versions 2015-10-22 22:08:35 -04:00
README.md added script to run tests with docker; changed test/README.md accordingly 2017-03-26 16:57:39 +03:00
test Add ability to test with specific Python versions 2015-10-22 22:08:35 -04:00
test-lib.bash added script to run tests with docker; changed test/README.md accordingly 2017-03-26 16:57:39 +03:00
test_docker added script to run tests with docker; changed test/README.md accordingly 2017-03-26 16:57:39 +03:00
test_travis Travis: add guard to test_travis 2016-01-18 13:14:56 +09:00
Vagrantfile Switch to Debian for testing in Vagrant 2016-03-05 02:07:01 -05:00

Testing

Dotbot testing code can use Docker or Vagrant to run all tests inside a virtual environment to have tests be completely isolated from the host machine. The tests are deterministic, and each test is run in a virtual environment with fresh state, ensuring that tests that modify system state are easily repeatable.

NOTE: Vagrant test driver relies on the Sahara plugin to snapshot and roll back virtual machine state.

Running the Tests

Vagrant

Before running the tests, the virtual machine must be running. It can be started by running vagrant up.

The test suite can be executed by running ./test.

Selected tests can be run by passing paths to the tests as arguments to ./test. Example: ./test defaults.bash

Tests can be run with a specific Python version by passing it's version as argument with key --version or -v. Examples: ./test --version 2.7.13, ./test -v 3.5.

You can also combine both of this for sure. Example: ./test --version 3.6.0 clean-outsude.bash.

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

Docker

Before running the tests, ensure that you have Docker installed.

The test suite can be executed by running ./test_docker (with appropriate rights for running docker binary).

Selected tests can be run by passing paths to the tests as arguments to ./test_docker. Example: ./test defaults.bash

Tests can be run with a specific Python version by passing it's version as argument with key --version or -v. Examples: ./test_docker --version 2.7.13, ./test_docker -v 3.5.

You can also combine both of this for sure. Example: ./test_docker --version 3.6.0 clean-outsude.bash.

When finished, container will be deleted. But you have to manually remove unnecessary docker images (docker rmi python:tag), where tag - version of Python, that you've passed to the script (docker rmi python:2.7.9 by default, if no version was specified).