Add molecule jobs to test the modules

Change-Id: I0b252e2fc7d34f54f739199bdce450b1bef8d20b
This commit is contained in:
Bhagyashri Shewale 2021-09-01 15:07:30 +05:30 committed by Sorin Sbarnea
parent f482d7a6a6
commit f1e7092812
6 changed files with 57 additions and 1 deletions

4
ansible.cfg Normal file
View File

@ -0,0 +1,4 @@
# Used for testing to avoid using one from outside repository
[defaults]
# Avoid noise which can make debugging test failures harder
deprecation_warnings=False

View File

@ -0,0 +1,14 @@
---
- name: Converge
hosts: all
tasks:
- name: "Test yum_config repo"
tripleo.repos.yum_config:
type: repo
name: appstream
enabled: true
tags:
# TODO: fix yum_config to correctly report changed state and uncomment
# the line below which disables molecule idemptotence test.
- molecule-idempotence-notest

View File

@ -0,0 +1,12 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: instance
image: quay.io/centos/centos:stream8
provisioner:
name: ansible
verifier:
name: ansible

View File

@ -0,0 +1,10 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Example assertion
assert:
that: true

17
tox.ini
View File

@ -7,7 +7,9 @@ requires =
[testenv]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
setenv =
ANSIBLE_FORCE_COLOR={tty:1:0}
VIRTUAL_ENV={envdir}
passenv =
HOME
deps =
@ -81,6 +83,19 @@ commands =
whitelist_externals =
sh
[testenv:molecule]
description = Used by all molecule jobs (tox-ansible)
deps =
ansible-core
molecule>=3.3.0,<3.4.0 # bug with collection install
molecule-docker
usedevelop = False
skip_install = true
commands =
ansible-galaxy collection install -v 'community.docker:>=1.8.0'
ansible-galaxy collection install -v --force .
molecule test
[flake8]
ignore = H803
show-source = True

View File

@ -21,6 +21,7 @@
vars:
tox_envlist: pep8,packaging
- openstack-tox-py39
- tripleo-tox-molecule
- tripleo-buildimage-overcloud-full-centos-8:
dependencies: &deps_unit_lint_cprovider
- openstack-tox-pep8