How to write dist-git tests
in Fedora with Ansible
Stef Walter
Red Hat
Goal: Curate tests
like we curate source code
Goal: Tests validate a complete system
Goal: Make the tests as easy
to update as the package
Goal: Curate tests
like we curate source code
Goal: We find and fix bugs while the code is fresh
in our mind rather than months or years later.
We're storing our tests in dist-git
We share responsibility for the tests
Tests are updated together with source
Tests are distinct from the testing system
Testing system is responsible to:
- Build test subject (package, container, image, tree)
- Decide which test suites
- Schedule job(s)
- Stage the test suites
- Invoke the test suites in a standard way
- Gather the test results and test artifacts
- Relay test results
Standard interface describes how to:
- Uniquely identify a test suite
- Stage a test suite and its dependencies
- Provide test subject to test suite
- Invoke a test suite in a consistent way
- Gather test results and test artifacts
Test suite is responsible to:
- Install dependencies such as a test framework
- Execute the test framework as necessary
- Provision (usually locally) any containers or virtual machines
- Provide test results and test artifacts
Ansiballz!
________________________
< TASK [Gathering Facts] >
------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
$ sudo dnf install standard-test-roles
Hackfest:
Adding inventory
Hackfest:
Non-Ansible stuff
Hackfest:
Executing upstream Tests
Questions?
#fedora-ci on Freenode
fedora-ci@lists.fedoraproject.org
Credits: stichlily on Flicker, memegenerator.net, Cowsay