使用 ROS Build Farm 测试您的代码

ROS 2 Build Farm 功能非常强大。

除了创建二进制文件之外,它还将通过在 PR 合并之前编译和运行 ROS 包的所有测试来测试拉取请求。

有四个先决条件。

GitHub 访问

您可以在 GitHub 组织级别授予对 PR Builder 的访问权限,也可以仅授予对单个 GitHub 存储库的访问权限。

GitHub 组织

  1. Open https://github.com/orgs/%YOUR_ORG%/people (while replacing %YOUR_ORG% with the appropriate organization)

  2. Click Invite Member and enter ros-pull-request-builder

GitHub 存储库

  1. Open https://github.com/%YOUR_ORG%/%YOUR_REPO%/settings/access (while replacing %YOUR_ORG%/%YOUR_REPO$ with the appropriate organization/repo)

  2. Click Add people and enter ros-pull-request-builder

  3. Select Admin or Write for their role. (see next section)

WebHooks

如果您授予“ros-pull-request-builder”完全管理权限,它将自动设置钩子。

或者,您可以通过仅使用**write**权限进行设置来避免对完全管理权限的需求。

  1. Open https://github.com/%YOUR_ORG%/%YOUR_REPO%/settings/hooks/new)

  2. Enter "https://build.ros2.org/ghprbhook/ as the Payload URL

  3. Check the following options:
    • Let me select individual events.

    • Issue comments

    • Pull requests

test_pull_requests

对于您想要进行拉取请求测试的每个 ROS 发行版,您必须在 rosdistro 的相应部分中启用 test_pull_requests 标志。

  • Option 1 - You have the option when running bloom to turn on pull request testing.

  • Option 2 - You can carefully manually edit the appropriate file in the rosdistro repo, and make a new pull request. Example. Documented in REP 143.

请注意,添加拉取请求后,通常直到夜间 Jenkins 重新配置后才会创建作业。