|
| 1 | +.. BuildFarmTesting: |
| 2 | +
|
| 3 | +Testing Your Code with the ROS Build Farm |
| 4 | +========================================= |
| 5 | + |
| 6 | +The `ROS 2 Build Farm <https://build.ros2.org/>`_ is incredibly powerful. |
| 7 | +In addition to creating binaries, it will also test pull requests by compiling and running all the tests for your ROS packages before the PR is merged. |
| 8 | + |
| 9 | +There are four prerequisites. |
| 10 | + |
| 11 | + * The GitHub user `@ros-pull-request-builder <https://github.com/ros-pull-request-builder>`_ must have access to the repository. |
| 12 | + * The GitHub repository must have the webhooks set up. |
| 13 | + * `Your package must be indexed in rosdistro </How-To-Guides/Releasing/Index-Your-Packages>` |
| 14 | + * The ``test_pull_requests`` flag must be true. |
| 15 | + |
| 16 | + |
| 17 | +GitHub Access |
| 18 | +------------- |
| 19 | + |
| 20 | +You can give access to the PR Builder either at the GitHub organization level OR just to the single GitHub repository. |
| 21 | + |
| 22 | +GitHub Organization |
| 23 | +^^^^^^^^^^^^^^^^^^^ |
| 24 | + |
| 25 | +#. Open `https://github.com/orgs/%YOUR_ORG%/people <https://github.com/orgs/%YOUR_ORG%/people>`_ |
| 26 | + (while replacing ``%YOUR_ORG%`` with the appropriate organization) |
| 27 | +#. Click ``Invite Member`` and enter ``ros-pull-request-builder`` |
| 28 | + |
| 29 | + |
| 30 | +GitHub Repository |
| 31 | +^^^^^^^^^^^^^^^^^ |
| 32 | + |
| 33 | +#. Open `https://github.com/%YOUR_ORG%/%YOUR_REPO%/settings/access <https://github.com/%YOUR_ORG%/%YOUR_REPO%/settings/access>`_ |
| 34 | + (while replacing ``%YOUR_ORG%/%YOUR_REPO$`` with the appropriate organization/repo) |
| 35 | +#. Click ``Add people`` and enter ``ros-pull-request-builder`` |
| 36 | +#. Select ``Admin`` or ``Write`` for their role. (see next section) |
| 37 | + |
| 38 | + |
| 39 | +WebHooks |
| 40 | +-------- |
| 41 | + |
| 42 | +If you grant full administrative rights to ``ros-pull-request-builder``, it will automatically setup the hooks. |
| 43 | + |
| 44 | +Alternatively, you can avoid the need for full administrative rights by setting them up with only **write** permissions. |
| 45 | + |
| 46 | +#. Open `https://github.com/%YOUR_ORG%/%YOUR_REPO%/settings/hooks/new <https://github.com/%YOUR_ORG%/%YOUR_REPO%/settings/hooks/new>`_) |
| 47 | +#. Enter ``"https://build.ros2.org/ghprbhook/`` as the Payload URL |
| 48 | +#. Check the following options: |
| 49 | + * Let me select individual events. |
| 50 | + * Issue comments |
| 51 | + * Pull requests |
| 52 | + |
| 53 | + |
| 54 | +test_pull_requests |
| 55 | +------------------ |
| 56 | + |
| 57 | +For each ROS distro that you want pull request testing for, you must enable the ``test_pull_requests`` flag in the appropriate section of the `rosdistro <https://github.com/ros/rosdistro/>`_. |
| 58 | + |
| 59 | + * **Option 1** - You have the option when running `bloom </How-To-Guides/Releasing/Releasing-a-Package>` to turn on pull request testing. |
| 60 | + * **Option 2** - You can **carefully** manually edit the appropriate file in the rosdistro repo, and make a new pull request. |
| 61 | + `Example <https://github.com/ros/rosdistro/blob/3c295f76b0755989e9ed526c0b5f28a5f6a94da3/rolling/distribution.yaml#L4708>`_. |
| 62 | + `Documented in REP 143 <http://docs.ros.org/en/independent/api/rep/html/rep-0143.html#distribution-file>`_. |
| 63 | + |
| 64 | +Note that after the pull request has been added, the job will usually not be created until the nightly Jenkins reconfiguration. |
0 commit comments