Testing and CI
Every repository runs its CI on every push. This page lists the jobs and how to run the same checks on your computer, preferably in the dev container of the workspace, which has the same ROS2 Jazzy base as the CI images.
CI Jobs
Repository |
Jobs |
Reproduce locally |
|---|---|---|
|
|
|
Components ( |
|
the VS Code tasks of the same names, or the commands in the component directory |
|
|
|
|
|
|
|
|
|
|
|
VS Code tasks Make html and Build public HTML, see Maintaining the Documentation |
All jobs keep their artifacts for 7 days. The full logs of run_gtest are in its logs/ artifact.
Running the Tests in the Dev Container
The dev container (cpm-lab-dev) contains the build and test dependencies of all packages, so the tests run as in
run_gtest without installing anything. Open the workspace in VS Code with Dev Containers: Reopen in Container
(see Developing in Docker), or open a shell with make terminal.
make test # all packages, like run_gtest
make test PACKAGES="cpm_lab_control_flow cpm_lab_bridge" # only these packages
colcon test-result --all --verbose # results of the last run
make test builds the workspace first if anything changed, runs colcon test with the output of failing tests
and prints the results; its exit code is non-zero if a test failed. The ament_lint_auto tests of each package run
the same linters as the component pipelines.
From the host, without opening a container:
make docker-test PACKAGES="cpm_lab_control_flow"
In VS Code, Tasks: Run Test Task runs Test workspace (like CI). Test packages asks for the packages,
Test results shows the results of the last run, and the tasks ament_uncrustify, ament_cpplint,
ament_flake8, ament_lint_cmake, ament_xmllint, ament_cppcheck and ament_copyright run the
linters of the component pipelines on src/. Uncrustify can fix the formatting:
ament_uncrustify --reformat src/<component>
Differences to the CI
The CI installs the dependencies with rosdep for every run; the dev container has them in the image. After changing a
package.xml, rebuild the container (Rebuild Container ormake image).The CI builds with
colcon buildwithout--symlink-install;make testuses the build ofmake build. If a test only fails in one of both, runmake cleanfirst.The IPS needs the pylon SDK, which the dev container and the CI (
bash/install-pylon.sh) both install.