Skip to content

Commit 9ee0826

Browse files
author
Sebastian Gumprich
committed
clarify linting
1 parent a5a368d commit 9ee0826

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## Local Development and testing
2+
13
We accept all kinds of contributions, whether they are bug fixes, pull requests or documentation updates!
24

35
If you want to develop new content for this collection or improve what is already here, the easiest way to work on the collection is to clone it into one of the configured [`COLLECTIONS_PATH`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths), and work on it there.
@@ -11,3 +13,33 @@ export COLLECTIONS_PATH=$(pwd)/collections:$COLLECTIONS_PATH
1113
```
1214

1315
You can find more information in the [developer guide for collections](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections), and in the [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html).
16+
17+
18+
### Linting with tox
19+
20+
After making code changes, please run the linters and fix all errors:
21+
22+
```
23+
> tox -elinters
24+
```
25+
26+
### Updating the tests and examples
27+
28+
If you add new features or arguments to the existing modules, please add them to the examples in the module itself.
29+
The integration tests and examples in our documentation are then generated from the module-examples.
30+
31+
To trigger this generation, you need to run the script `hacking/update_examples_and_tests.sh` from the root of the repository. For this you need to have yq in version 3 installed (see https://mikefarah.gitbook.io/yq/v/v3.x/).
32+
33+
### Integration tests with docker
34+
35+
```
36+
# run icinga in a container and forward port 80
37+
> docker run -d -p 80:80 schurzi/icinga2
38+
39+
# run ansible-test
40+
> ansible-test integration
41+
42+
# alternatively run the test playbooks against the container
43+
> ansible-playbook tests/integration/targets/icinga/normalmode.yml
44+
> ansible-playbook tests/integration/targets/icinga/checkmode.yml
45+
```

0 commit comments

Comments
 (0)