Writing good tests for your existing deployments or distributed software infrastructure should be painless, and easily accomplishable without involving any time-consuming and complex testing setup. This is where goodplay comes into play.
goodplay instruments Ansible — “a radically simple IT automation platform” as it is advertized — and allows you to write your tests in the same simple and probably already familiar language you would write an Ansible playbook.
- define your test environments via Docker Compose and Ansible inventories
- write your tests as Ansible 2.x playbook tasks
- resolve and auto-install Ansible role dependencies prior to test run
- run your tests within Docker container(s), an already existing test environment, or on localhost
- built as a pytest plugin to have a solid test runner foundation, plus you can run your goodplay tests together with your other tests
goodplay will use Semantic Versioning when reaching v1.0.0. Until then, the minor version is used for backwards-incompatible changes.
goodplay vs. Other Software¶
In this section we compare goodplay to some of the other software options that are available to partly solve what goodplay can accomplish for you.
Ansible itself comes bundled with some testing facilities mentioned in the
Ansible Testing Strategies documentation.
It makes a low-level
assert module available which helps to verify that
some condition holds true, e.g. some output from a previous task which has
been stored in a variable contains an expected value.
Although it can be sometimes necessary to use something low-level as Ansible’s
assert, goodplay enables you to use high-level modules for describing
your test cases.
Besides the actual testing, goodplay takes care of setting up and tearing down the test environment as well as collecting the test results – both being something Ansible was not made for.
pytest-ansible is as the name already implies a pytest plugin just like goodplay. But instead of being used for testing Ansible playbooks or roles, it provides pytest fixtures that allow you to execute Ansible modules from your Python-based tests.
goodplay is open source software released under the Apache License 2.0:
Copyright 2015-2016 Benjamin Schwarze
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.