Introduction to ansible-test

Click for: original source

As automation becomes crucial for more and more business cases, there is an increased need to test the automation code itself. This is where ansible-test comes in: developers who want to test their Ansible Content Collections for sanity, unit and integration tests can use ansible-test to achieve testing workflows that integrate with source code repositories. By Anshul Behl.

Both ansible-core and ansible-base come packaged with a cli tool called ansible-test, which can be used by collection developers to test their Collection and its content. The ansible-test knows how to perform a wide variety of testing-related tasks, from linting module documentation and code to running unit and integration tests.

The article explains the following:

  • How to run ansible-test?
  • How to test your collection using ansible-test?
  • Sanity tests
  • How to ignore sanity tests?
  • Unit tests
  • Code coverage
  • Integration tests

As shown above, ansible-test can provide a lot of value testing Ansible Content Collections thoroughly. You will get further learning resources in the article as well. Good read!

[Read More]

Tags devops ansible tdd cloud