summaryrefslogtreecommitdiffstats
path: root/docs/docsite/rst/community/collection_contributors/collection_test_pr_locally.rst
blob: 7b01e2df8cea4e7c299a9ccea76c34693c88a463 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.. _collection_pr_test:

****************************
How to test a collection PR
****************************

Reviewers and issue authors can verify a PR fixes the reported bug by testing the PR locally.

.. contents::
   :local:

.. _collection_prepare_environment:

Prepare your environment
========================

We assume that you use Linux as a work environment (you can use a virtual machine as well) and have ``git`` installed.


1. :ref:`Install Ansible <installation_guide>` or ansible-core.

2. Create the following directories in your home directory:

  .. code:: bash

    mkdir -p ~/ansible_collections/NAMESPACE/COLLECTION_NAME

  For example, if the collection is ``community.general``:

  .. code:: bash

    mkdir -p ~/ansible_collections/community/general

  If the collection is ``ansible.posix``:

  .. code:: bash

    mkdir -p ~/ansible_collections/ansible/posix


3. Clone the forked repository from the author profile to the created path:

  .. code:: bash

    git clone https://github.com/AUTHOR_ACC/COLLECTION_REPO.git ~/ansible_collections/NAMESPACE/COLLECTION_NAME

4. Go to the cloned repository.

  .. code:: bash

    cd ~/ansible_collections/NAMESPACE/COLLECTION_NAME

5. Checkout the PR branch (it can be retrieved from the PR's page):

  .. code:: bash

    git checkout pr_branch


Test the Pull Request
=====================

1. Include `~/ansible_collections` in `COLLECTIONS_PATHS`. See :ref:`COLLECTIONS_PATHS` for details.

2. Run your playbook using the PR branch and verify the PR fixed the bug.

3. Give feedback on the pull request or the linked issue(s).