@@ -117,8 +108,10 @@ You can test this locally using **DIND (docker in docker)** at your own computer
...
@@ -117,8 +108,10 @@ You can test this locally using **DIND (docker in docker)** at your own computer
- ### Testing requirements
- ### Testing requirements
You need docker installed at your system and the [ansible molecule](https://ansible.readthedocs.io/projects/molecule/installation/).
You need docker installed at your system and the [ansible molecule](https://ansible.readthedocs.io/projects/molecule/installation/).
You might have to set DIND at your system, for linux, you can create the file **/etc/docker/daemon.json**
- #### Setting *DIND (docker in docker)*
You might have to set *DIND (docker in docker)* at your system, for linux, you can create the file **/etc/docker/daemon.json**
- ##### Enabling DIND at your system
And add the content and restart docker.
And add the content and restart docker.
```json
```json
...
@@ -132,11 +125,17 @@ You can test this locally using **DIND (docker in docker)** at your own computer
...
@@ -132,11 +125,17 @@ You can test this locally using **DIND (docker in docker)** at your own computer
}
}
```
```
- ### Using molecule
- ### Using the molecule tests
Just go to the root of the role **roles/dependencies** and run the command:
- #### Configuring the *HOST_VAR_FILE_NAME* variable
For using the molecule tests you should pass the **HOST_VAR_FILE_NAME** environment variable, or the default value for testing is: **example_printer.yml**
For the values that can be used, you can lool at the files at the **inventories/host_vars** folder.
- ##### Molecule test example
Just go to the root of the role **roles/x3infodesk-deployment-role-dependencies** and run the command, here is an example for using the **HOST_VAR_FILE_NAME** as *example_buttons.yml*:
```bash
```bash
molecule test
HOST_VAR_FILE_NAME="example_buttons.yml" molecule test