Skip to content

Commit

Permalink
Remove molecule tests
Browse files Browse the repository at this point in the history
Molecule is :
- difficult to setup / update,
- not so easy to use,
- really slow to execute,
- and the project is not very active.
  • Loading branch information
marcwrobel committed Feb 20, 2021
1 parent ac505fd commit 224200e
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 418 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,3 @@ jobs:
ansible --version
ansible-lint --version
ansible-lint
molecule:
name: 'Molecule'
runs-on: 'ubuntu-latest'
strategy:
matrix:
distro: [ 'debian10' ]
steps:
- name: 'Check out the codebase'
uses: 'actions/checkout@v2'
- name: 'Set up Python 3'
uses: 'actions/setup-python@v2'
with:
python-version: '3.x'
- name: 'Install test dependencies'
run: 'pip3 install ansible molecule[docker]==3.1.5 molecule-docker==0.2.4 docker'
- name: 'Run Molecule tests'
run: |
molecule --version
cd ansible_collections/marcwrobel/debian_basics
molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_DISTRO: ${{ matrix.distro }}
41 changes: 3 additions & 38 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ The following instructions assume you have Python 3 and Docker installed. On Deb

## Prepare development environment

This project needs [Ansible](https://www.ansible.com/), [YAMLlint](https://yamllint.readthedocs.io/en/stable/), [Ansible-lint](https://github.com/ansible/ansible-lint)
and [Molecule](https://molecule.readthedocs.io/en/stable/).
This project needs [Ansible](https://www.ansible.com/), [YAMLlint](https://yamllint.readthedocs.io/en/stable/) and
[Ansible-lint](https://github.com/ansible/ansible-lint).

The best and easiest way to install those dependencies is to use [`pipenv`](https://pipenv.pypa.io).

Expand All @@ -16,7 +16,6 @@ The best and easiest way to install those dependencies is to use [`pipenv`](http
ansible --version
yamllint --version
ansible-lint --version
molecule --version

## Run linting

Expand All @@ -26,41 +25,7 @@ Linting is performed at repository level using YAMLlint and Ansible-lint :
yamllint .
ansible-lint

## Run integration tests

Integration tests are executed by Molecule using [Jeff Geerling's](https://www.jeffgeerling.com/) Docker images. Any `docker-xxx-ansible` images listed on his
profile on [Docker Hub](https://hub.docker.com/u/geerlingguy/) can be used with the `xxx` identifier passed as the `MOLECULE_DISTRO` environment variable. For
instance, to run the integration tests on CentOS 8:

cd ansible_collections/marcwrobel/assertions
MOLECULE_DISTRO=debian9 molecule test

The default distribution is `debian10`.

If you want to launch integration tests on multiple distributions :

cd ansible_collections/marcwrobel/assertions
for distro in debian9 debian10; do
MOLECULE_DISTRO=$distro molecule test
done

## Run integration tests during the development lifecycle

During the development lifecycle you may prefer to keep the docker containers running and run `molecule` commands individually:

# Creates and configures instances
molecule converge

# Runs automated tests against instances
molecule verify

# Runs the converge step a second time and check that no tasks are marked as changed
molecule idempotence

## Continuous integration

The GitHub Action workflow [`CI`](https://github.com/marcwrobel/ansible-collection-assertions/actions?query=workflow%3ACI) is executed for each commit, on merge
request (targeting the `main` branch) and at least once a week on saturday morning. This workflow runs :

- linting with YAMLlint and Ansible-lint,
- integration tests on collections with Molecule.
request (targeting the `main` branch) and at least once a week on saturday morning. This workflow runs linting with YAMLlint and Ansible-lint.
5 changes: 0 additions & 5 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ ansible = "~=2.10"
ansible-lint = "~=4.3"
yamllint = "~=1.25"
setuptools = "*"
molecule-docker = "==0.2.4"

[dev-packages]

[requires]
python_version = "3.7"

[packages.molecule]
extras = [ "docker",]
version = "==3.1.5"

0 comments on commit 224200e

Please sign in to comment.