Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Continue to run test suite even if one test fails #375

@mike-nguyen

Description

@mike-nguyen

Problem

Ansible will fail if any task fails by default. This is great if using Ansible as a configuration tool, but not so great if using Ansible as a test framework. In Ansible 2.0, the block/rescue/always concept was introduced--allowing us to catch errors and continue to do other things. So why not do that with a set of tests?

Benefits Over Current Approach

  • By catching errors and continuing to run tests, users are able to get more test results and could find more bugs sooner. This is especially true when there is a bug that is being fixed but not yet put into a compose.
  • All done natively in Ansible

Proposal

  1. Separate tests into individual yml files
  2. Create a role that will import the above yml files in a block/rescue that will save the test status in a dictionary.
  3. Create an entry point playbook, that calls the above role for each of the tests and pass/fail based on whats in the dictionary.

See simple example here: master...mike-nguyen:tester_poc

Potential Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions