ansible-collection-php_roles icon indicating copy to clipboard operation
ansible-collection-php_roles copied to clipboard

Configure automated integration tests

Open geerlingguy opened this issue 5 years ago • 5 comments

I would like to have a few demo playbooks... well at least one or two for starters:

  1. Show a demo LAMP (Apache + MySQL + Memcached) stack using these roles.
  2. Show a demo LEPP (Nginx + Postgres + Redis) stack using these roles.

I'm considering using molecule, though some have suggested ansible-test would be a good fit?

geerlingguy avatar Aug 06 '19 20:08 geerlingguy

Also document how to run tests locally in the README under 'Development' (there's a TODO there right now).

geerlingguy avatar Aug 06 '19 21:08 geerlingguy

That setup (if not using molecule) is... extremely ambitious because ansible-test doesn't allow dependent role installation (I'd have to do this manually), doesn't clean up between integration tests (I'd need to parse those out manually), doesn't do idempotence tests (I'd have to build a runme.sh shell script to do it for me), and is generally not as simple as molecule to integrate in different ways.

geerlingguy avatar Aug 07 '19 21:08 geerlingguy

I'm thinking maybe just one test that installs each of the roles then tests that support is there for each of the relevant extensions or extra bits. php_versions would be the special case...

geerlingguy avatar Aug 07 '19 21:08 geerlingguy

Left a blog post based on today's learnings: https://www.jeffgeerling.com/blog/2019/how-add-integration-tests-ansible-collection-ansible-test

geerlingguy avatar Aug 07 '19 21:08 geerlingguy

I think before closing this issue I'd like to make the integration test do all of the individual roles... maybe have one target for each, and the last target would be the actual tests? Or just do them all in one target.

geerlingguy avatar Aug 07 '19 21:08 geerlingguy