We use molecule with docker test our collection, those tests are automatically executed on the sr.ht CI. You can view the configuration under the .build directory.
If you want to use Molecule, you should install those dependencies:
- Ansible
- Molecule
- Docker driver for molecule
You can install them by running those commands :
pip install ansible
pip install molecule
pip install 'molecule-driver'
You can also run those tests locally with molecule:
$ molecule test
You can also run those test and keep the container up after executing
the tests, for that you should add the flag --destroy
to never
.
Or run (almost) each steps by hand:
-
Create the container
$ molecule create
-
Apply converge playbook (Basically install Dolibarr dependencies and Dolibarr itself) :
$ molecule converge -s install
-
Then get a shell within the created container :
molecule login -s install
-
And finally debug :-)