Running ansible's integration tests
9th December 2015
ansible is a great tool for deployments. While it doesn't ship that many unit tests it comes with heaps of integration tests that can be run using:
git submodule update --init
. hacking/env-setup
cd test/integration
make
after cloning the repo from here.
However when working on individual parts one often only wants to test a single role. This can be done via:
git submodule update --init
. hacking/env-setup
cd test/integration
ansible-playbook -e @integration_config.yml -i"testhost," -c local test_filters.yml
when e.g. working on some new filers or when you want to run one of the destructive modules, test_apt in this case:
git submodule update --init
. hacking/env-setup
cd test/integration
# Destructive tests usually need sudo
sudo ansible-playbook -e @integration_config.yml -i"testhost," -c local destructive.yml --tags=test_apt
The list of available tags can be ssen in test/integration/destructive.yml.
Just putting it here since I just found myself digging this out the second time.