How to test a collection PR
Reviewers and issue authors can verify a PR fixes the reported bug by testing the PR locally.
Prepare your environment
We assume that you use Linux as a work environment (you can use a virtual machine as well) and have
Install Ansible or ansible-core.
Create the following directories in your home directory:
mkdir -p ~/ansible_collections/NAMESPACE/COLLECTION_NAME
For example, if the collection is
community.general:mkdir -p ~/ansible_collections/community/general
If the collection is
ansible.posix:mkdir -p ~/ansible_collections/ansible/posix
Clone the forked repository from the author profile to the created path:
git clone https://github.com/AUTHOR_ACC/COLLECTION_REPO.git ~/ansible_collections/NAMESPACE/COLLECTION_NAME
Go to the cloned repository.
Checkout the PR branch (it can be retrieved from the PR’s page):
git checkout pr_branch
Test the Pull Request
Include ~/ansible_collections in COLLECTIONS_PATHS. See COLLECTIONS_PATHS for details.
Run your playbook using the PR branch and verify the PR fixed the bug.
Give feedback on the pull request or the linked issue(s).