Skip to content

Commit

Permalink
Use install space by default (addresses ros-industrial#54).
Browse files Browse the repository at this point in the history
Omit entire catkin build section when devel space is not choosed to be used.
  • Loading branch information
130s committed Jun 23, 2016
1 parent 610a5ab commit fc22604
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 27 deletions.
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ FAQ
What are checked?
------------------------------------

List of the checked items, in the actual order to be run.
List of the checked items by default, in the actual order to be run. See the `list of optional environment variables <https://github.com/ros-industrial/industrial_ci/blob/master/README.rst#optional-environment-variables>`_ to customize the items.

1. If your package builds.
2. If available tests in the given package pass. Because tests use software from `install` space, it is important that the building step ends without issues (otherwise the tests may not be reached).
1. If your package builds (into `install` space by default).
2. If available tests pass in the package. Because tests use software from `install` space, it is important the building step ends without issues (otherwise tests may not be reached).
3. If your package gets installed (i.e. built artifact goes into the `install` space).
4. If downstream packages are designated, the tests in those packages pass.

Expand Down Expand Up @@ -166,6 +166,7 @@ Note that some of these currently tied only to a single option, but we still lea
* `TARGET_PKGS` (default: not set): Used to fill `PKGS_DOWNSTREAM` if it is not set. If not set packages are set using the output of `catkin_topological_order` for the source space.
* `UPSTREAM_WORKSPACE` (default: debian): When this is set `file`, the dependended packages that need to be built from source are downloaded based on a `.rosinstall` file in your repository. Use `$ROSINSTALL_FILENAME` to specify the file name. See more in `this section <https://github.com/ros-industrial/industrial_ci/blob/master/README.rst#optional-build-depended-packages-from-source>`_.
* `USE_DEB` (*DEPRECATED*: use `UPSTREAM_WORKSPACE` instead. default: true): if `true`, `UPSTREAM_WORKSPACE` will be set as `debian`. if `false`, `file` will be set. See `UPSTREAM_WORKSPACE` section for more info.
* `USE_DEVEL_SPACE` (default: false): If `true`, `devel space <http://wiki.ros.org/catkin/workspaces#Development_.28Devel.29_Space>`_ will be used for checking if packages can be built, separately from checking installability.

Note: You see some `*PKGS*` variables. These make things very flexible but in normal usecases you don't need to be bothered with them - just keep them blank.

Expand Down
60 changes: 36 additions & 24 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ travis_time_start init_travis_environment
BUILDER=catkin
ROSWS=wstool
export DOWNSTREAM_REPO_NAME=${PWD##*/}
if [ ! "$USE_DEVEL_SPACE" == "true" ]; then export CATKIN_TOOLS_CONFIG_ARGS="--install"; fi # when using devel space, nothing will be set.
if [ ! "$CATKIN_PARALLEL_JOBS" ]; then export CATKIN_PARALLEL_JOBS="-p4"; fi
if [ ! "$CATKIN_PARALLEL_TEST_JOBS" ]; then export CATKIN_PARALLEL_TEST_JOBS="$CATKIN_PARALLEL_JOBS"; fi
if [ ! "$ROS_PARALLEL_JOBS" ]; then export ROS_PARALLEL_JOBS="-j8"; fi
Expand Down Expand Up @@ -248,45 +249,56 @@ cd ../

travis_time_end # wstool_info

travis_time_start catkin_build
if [ "$USE_DEVEL_SPACE" == "true" ]; then
travis_time_start catkin_build

## BEGIN: travis' script: # All commands must exit with code 0 on success. Anything else is considered failure.
source /opt/ros/$ROS_DISTRO/setup.bash # re-source setup.bash for setting environmet vairable for package installed via rosdep
# for catkin
if [ "${_TARGET_PKGS// }" == "" ]; then export _TARGET_PKGS=`catkin_topological_order ${CI_SOURCE_PATH} --only-names`; fi # `_TARGET_PKGS` (default: not set): If not set, the packages in the output of `catkin_topological_order` from the source space of your repo are to be set. This is also used to fill `PKGS_DOWNSTREAM` if it is not set.
if [ "${_PKGS_DOWNSTREAM// }" == "" ]; then export _PKGS_DOWNSTREAM=$( [ "${BUILD_PKGS_WHITELIST// }" == "" ] && echo "$_TARGET_PKGS" || echo "$BUILD_PKGS_WHITELIST"); fi
if [ "$BUILDER" == catkin ]; then catkin build -i -v --summarize --no-status $BUILD_PKGS_WHITELIST $CATKIN_PARALLEL_JOBS --make-args $ROS_PARALLEL_JOBS ; fi

travis_time_end # catkin_build

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

# Patches for rostest that are only available in newer codes.
# Some are already available via DEBs so that patches for them are not needed, but because EOLed distros (e.g. Hydro) where those patches are not released into may be still tested, all known patches are applied here.
if [ "$ROS_DISTRO" == "hydro" ]; then
(cd /opt/ros/$ROS_DISTRO/lib/python2.7/dist-packages; wget --no-check-certificate https://patch-diff.githubusercontent.com/raw/ros/ros_comm/pull/611.diff -O - | sudo patch -f -p4 || echo "ok" )
(cd /opt/ros/$ROS_DISTRO/lib/python2.7/dist-packages; wget --no-check-certificate https://patch-diff.githubusercontent.com/raw/ros/ros/pull/82.diff -O - | sudo patch -p4)
(cd /opt/ros/$ROS_DISTRO/share; wget --no-check-certificate https://patch-diff.githubusercontent.com/raw/ros/ros_comm/pull/611.diff -O - | sed s@.cmake.em@.cmake@ | sed 's@/${PROJECT_NAME}@@' | sed 's@ DEPENDENCIES ${_rostest_DEPENDENCIES})@)@' | sudo patch -f -p2 || echo "ok")
## BEGIN: travis' script: # All commands must exit with code 0 on success. Anything else is considered failure.
source /opt/ros/$ROS_DISTRO/setup.bash # re-source setup.bash for setting environmet vairable for package installed via rosdep
# for catkin
if [ "${_TARGET_PKGS// }" == "" ]; then export _TARGET_PKGS=`catkin_topological_order ${CI_SOURCE_PATH} --only-names`; fi # `_TARGET_PKGS` (default: not set): If not set, the packages in the output of `catkin_topological_order` from the source space of your repo are to be set. This is also used to fill `PKGS_DOWNSTREAM` if it is not set.
if [ "${_PKGS_DOWNSTREAM// }" == "" ]; then export _PKGS_DOWNSTREAM=$( [ "${BUILD_PKGS_WHITELIST// }" == "" ] && echo "$_TARGET_PKGS" || echo "$BUILD_PKGS_WHITELIST"); fi
if [ "$BUILDER" == catkin ]; then
catkin init
catkin config $CATKIN_TOOLS_CONFIG_ARGS
catkin build -i -v --summarize --no-status $BUILD_PKGS_WHITELIST $CATKIN_PARALLEL_JOBS --make-args $ROS_PARALLEL_JOBS
fi

travis_time_end # catkin_build

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

# Patches for rostest that are only available in newer codes.
# Some are already available via DEBs so that patches for them are not needed, but because EOLed distros (e.g. Hydro) where those patches are not released into may be still tested, all known patches are applied here.
if [ "$ROS_DISTRO" == "hydro" ]; then
(cd /opt/ros/$ROS_DISTRO/lib/python2.7/dist-packages; wget --no-check-certificate https://patch-diff.githubusercontent.com/raw/ros/ros_comm/pull/611.diff -O - | sudo patch -f -p4 || echo "ok" )
(cd /opt/ros/$ROS_DISTRO/lib/python2.7/dist-packages; wget --no-check-certificate https://patch-diff.githubusercontent.com/raw/ros/ros/pull/82.diff -O - | sudo patch -p4)
(cd /opt/ros/$ROS_DISTRO/share; wget --no-check-certificate https://patch-diff.githubusercontent.com/raw/ros/ros_comm/pull/611.diff -O - | sed s@.cmake.em@.cmake@ | sed 's@/${PROJECT_NAME}@@' | sed 's@ DEPENDENCIES ${_rostest_DEPENDENCIES})@)@' | sudo patch -f -p2 || echo "ok")
fi

if [ "$BUILDER" == catkin ]; then
source devel/setup.bash ; rospack profile # force to update ROS_PACKAGE_PATH for rostest
catkin run_tests -iv --no-deps --no-status $PKGS_DOWNSTREAM $CATKIN_PARALLEL_TEST_JOBS --make-args $ROS_PARALLEL_TEST_JOBS --
catkin_test_results build || error
fi

if [ "$BUILDER" == catkin ]; then
source devel/setup.bash ; rospack profile # force to update ROS_PACKAGE_PATH for rostest
catkin run_tests -iv --no-deps --no-status $_PKGS_DOWNSTREAM $CATKIN_PARALLEL_TEST_JOBS --make-args $ROS_PARALLEL_TEST_JOBS --
catkin_test_results build || error
fi

travis_time_end # catkin_run_tests
fi
travis_time_end # catkin_run_tests
fi
fi # if [ "$USE_DEVEL_SPACE" == "true" ]

if [ "$NOT_TEST_INSTALL" != "true" ]; then

travis_time_start catkin_install_build

# Test if the packages in the downstream repo build.
if [ "$BUILDER" == catkin ]; then
if [ "$BUILDER" == catkin ] && [ "$USE_DEVEL_SPACE" == "true" ]; then
catkin clean --yes
catkin config --install
catkin config --install $CATKIN_TOOLS_CONFIG_ARGS
catkin build -i -v --summarize --no-status $BUILD_PKGS_WHITELIST $CATKIN_PARALLEL_JOBS --make-args $ROS_PARALLEL_JOBS
source install/setup.bash
rospack profile
Expand Down

0 comments on commit fc22604

Please sign in to comment.