Skip to content

Commit

Permalink
WIP: Add catkin_lint feature.
Browse files Browse the repository at this point in the history
An enhancement mentioned in ros-industrial#98

Some considerations:
- By default `catkin_lint` is run with `--strict` option, which makes the job fail even when there's only warning returned by catkin_lint. I'm not sure if we want to allow disabling --strict option on CI (those who just want the result without failing the CI job can run catkin_lint locally IMO).
- `catkin_lint` runs between build-install and tests, which I'm not sure is the best location.
  • Loading branch information
130s committed Oct 17, 2017
1 parent 222d61e commit d87d0da
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ env:
- ROS_DISTRO=kinetic DOCKER_BASE_IMAGE="ros:kinetic-ros-base" NOT_TEST_BUILD='true' DEBUG_BASH='true' VERBOSE_OUTPUT='false'
- ROS_DISTRO=kinetic APTKEY_STORE_SKS=hkp://ha.pool.sks-keyservers.vet # Passing wrong SKS URL as a break test. Should still pass.
- ROS_DISTRO=lunar ROS_REPO=ros-shadow-fixed USE_MOCKUP='industrial_ci/mockups/industrial_ci_testpkg'
- ROS_DISTRO=kinetic _EXTERNAL_REPO='ros-industrial/industrial_core#kinetic-devel'
- ROS_DISTRO=kinetic _EXTERNAL_REPO='ros-industrial/motoman_experimental#kinetic-devel' UPSTREAM_WORKSPACE=file BEFORE_SCRIPT='touch $CATKIN_WORKSPACE/src/ros-industrial/industrial_experimental/IRC_v2/CATKIN_IGNORE'
- ROS_DISTRO=kinetic _EXTERNAL_REPO='ros-controls/ros_control#kinetic-devel' UPSTREAM_WORKSPACE=file ROSINSTALL_FILENAME=ros_control.rosinstall ROS_PARALLEL_TEST_JOBS=-j1
- ROS_DISTRO=kinetic _EXTERNAL_REPO='ros-industrial/industrial_core#kinetic-devel' CATKIN_LINT=true CATKIN_LINT_ARGS='--explain'
- ROS_DISTRO=kinetic _EXTERNAL_REPO='ros-industrial/motoman_experimental#kinetic-devel' UPSTREAM_WORKSPACE=file BEFORE_SCRIPT='touch $CATKIN_WORKSPACE/src/ros-industrial/industrial_experimental/IRC_v2/CATKIN_IGNORE' CATKIN_LINT=true
- ROS_DISTRO=kinetic _EXTERNAL_REPO='ros-controls/ros_control#kinetic-devel' UPSTREAM_WORKSPACE=file ROSINSTALL_FILENAME=ros_control.rosinstall ROS_PARALLEL_TEST_JOBS=-j1 CATKIN_LINT=true
- ROS_DISTRO=kinetic _EXTERNAL_REPO='ipa320/cob_calibration_data#c0922cc6f87f31641add6ba4e0fb88c93f9a7c6c' ROS_REPO=ros UPSTREAM_WORKSPACE=file AFTER_SCRIPT='./.travis.xacro_test.sh'
matrix:
allow_failures:
Expand Down
2 changes: 2 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ Note that some of these currently tied only to a single option, but we still lea
* `BUILD_PKGS_WHITELIST` (default: not set): Packages to be built can be explicitly specified with this, in ROS package name format (i.e. using underscore. No hyphen). This is useful when your repo contains some packages that you don't want to be used upon testing. Downstream packages, if necessary, should be also specified using this. Also these packages are to be built when `NOT_TEST_INSTALL` is set. Finally, packages specified with this will be built together with those speicified using unimplmented `USE_DEB`.
* `BUILDER` (default: catkin): Currently only `catkin` is implemented (and with that `catkin_tools` is used instead of `catkin_make`. See `this discussion <https://github.com/ros-industrial/industrial_ci/issues/3>`_).
* `CATKIN_CONFIG` (default: not set): `catkin config --install` is used by default and with this variable you can 1) pass additional config options, or 2) overwrite `--install` by `--no-install`. See more in `this section <https://github.com/ros-industrial/industrial_ci/blob/master/doc/index.rst#optional-customize-catkin-config>`_.
* `CATKIN_LINT` (default: not set): If true, run `catkin_lint <http://fkie.github.io/catkin_lint/>`_ with `--strict` option, which means if there's any warning the job fails. It runs between build and install.
* `CATKIN_LINT_ARGS` (default: not set): If true, you can pass whatever argument(s) `catkin_lint` takes, except `--strict` that is set by default. Delimit by space if passing multiple.
* `CATKIN_PARALLEL_JOBS` (default: -p4): Maximum number of packages to be built in parallel that is passed to underlining build tool. As of Jan 2016, this is only enabled with `catkin_tools`. See for more detail about `number of build jobs <http://catkin-tools.readthedocs.org/en/latest/verbs/catkin_build.html#controlling-the-number-of-build-jobs>`_ and `documentation of catkin_tools <https://catkin-tools.readthedocs.org/en/latest/verbs/catkin_build.html#full-command-line-interface>`_ that this env variable is passed to internally in `catkin-tools`.
* `CATKIN_PARALLEL_TEST_JOBS` (default: -p4): Maximum number of packages which could be examined in parallel during the test run. If not set it's filled by `ROS_PARALLEL_JOBS`.
* `CCACHE_DIR` (default: not set): If set, `ccache <https://en.wikipedia.org/wiki/Ccache>`_ gets enabled for your build to speed up the subsequent builds in the same job if anything. See `detail. <https://github.com/ros-industrial/industrial_ci/blob/master/doc/index.rst#cache-build-artifacts-to-speed-up-the-subsequent-builds-if-any>`_
Expand Down
8 changes: 8 additions & 0 deletions industrial_ci/src/tests/source_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ if [ "$BUILDER" == catkin ]; then catkin build $OPT_VI --summarize --no-status

ici_time_end # catkin_build

if [ "$CATKIN_LINT" = "true" ]; then
ici_time_start catkin_lint
if [ "$BUILDER" == catkin ]; then
catkin_lint --strict $CATKIN_LINT_ARGS && echo "catkin_lint passed." || error "`catkin_lint --strict` failed by either/both errors and/or warnings"
fi
ici_time_end # catkin_lint
fi

if [ "$NOT_TEST_BUILD" != "true" ]; then
ici_time_start catkin_run_tests

Expand Down

0 comments on commit d87d0da

Please sign in to comment.