Skip to content

Commit

Permalink
test: add ANSIBLE_ROLES_PATH to tox and update contribution guide
Browse files Browse the repository at this point in the history
  • Loading branch information
trfore committed May 5, 2024
1 parent 43556c9 commit 73bf3fc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ pre-commit install

```sh
pre-commit run --all-files

# list environments and test
tox list
# lint all files
tox -e lint run
# run a specific test environment
tox -e py-ansible2.16-ubuntu20 run
# run all test in parallel
tox run-parallel
```

- For iterative development and testing, the tox molecule environments are written to accept `molecule` arguments. This allows for codebase changes to be tested as you write across multiple distros and versions of `ansible-core`.

```sh
# molecule converge
tox -e py-ansible2.16-ubuntu20 run -- converge -s default
# molecule test w/o destroying the container
tox -r -e py-ansible2.16-ubuntu20-jre8 -- test -s ubuntu20-jre8 --destroy=never
```

## Additional References
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ commands =
default: molecule {posargs:test -s default}
jre8: molecule {posargs:test -s ubuntu-jre8}
setenv =
ANSIBLE_ROLES_PATH={work_dir}/{env_name}/.ansible/roles
MOLECULE_EPHEMERAL_DIRECTORY={work_dir}/{env_name}/.cache/molecule
MOLECULE_NAME={env_name}
centos: MOLECULE_IMAGE=trfore/docker-centos8-systemd
Expand Down

0 comments on commit 73bf3fc

Please sign in to comment.