Introduce tox-ansible to validations-common

This patch adds basic configuration for tox-ansible[1].

Tox-ansible is a plugin for tox which auto-generates tox environments
for running quality assurance tools like ansible-test or molecule. This
tool is rather tightly integrated for the official Molecule testing tool
that integrates with Ansible.

At first, it will allow us to list very quickly all the Ansible Molecule
tests for each roles with their scenario(s):

Example:

    $ tox -l
    ...
    validations_common-roles-advanced_format_512e_support-default
    validations_common-roles-check_cpu-default
    validations_common-roles-check_disk_space-default
    validations_common-roles-check_latest_packages_version-default
    validations_common-roles-check_ram-default
    validations_common-roles-check_selinux_mode-default
    validations_common-roles-dns-default
    validations_common-roles-haproxy-default
    validations_common-roles-ntp-default
    validations_common-roles-service_status-default
    validations_common-roles-service_status-docker
    validations_common-roles-service_status-podman
    validations_common-roles-service_status-systemd
    validations_common-roles-validate_selinux-default
    validations_common-roles-xfs_check_ftype-default
    ...

However, we won't be able to execute them as it for now without to make
some small manual modifications in the molecule.yml file first before to
execute them. This will be covered as soon as possible in a following-patch.

[1] - https://github.com/ansible-community/tox-ansible

Change-Id: Ia876bb1634f98e378345939788280e71738d03c2
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud (Strider) 2021-03-19 15:20:05 +01:00
parent dbacdea3cb
commit 3f80ee6266
No known key found for this signature in database
GPG Key ID: 4119D0305C651D66
1 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,8 @@
minversion = 3.2.0 minversion = 3.2.0
envlist = linters,docs,py38,molecule envlist = linters,docs,py38,molecule
skipdist = True skipdist = True
requires =
tox-ansible >= 1.0.5
# Automatic envs (pyXX) will only use the python version appropriate to that # Automatic envs (pyXX) will only use the python version appropriate to that
# env and ignore basepython inherited from [testenv] if we set # env and ignore basepython inherited from [testenv] if we set
@ -145,3 +147,8 @@ commands =
# Settings for doc8: # Settings for doc8:
extensions = .rst extensions = .rst
ignore = D001 ignore = D001
[ansible]
description = Used as base for all tox-ansible environments
molecule_opts =
--debug