Skip to content

Commit 5f520be

Browse files
author
Enrique Fernandez
committed
Add support to check tests on Travis CI
1 parent 5d3de7f commit 5f520be

File tree

1 file changed

+56
-24
lines changed

1 file changed

+56
-24
lines changed

.travis.yml

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,80 @@
11
# Travis Continuous Integration Configuration File For ROS Control Projects
2-
# Author: Dave Coleman
3-
language:
4-
- cpp
5-
- python
6-
python:
7-
- "2.7"
2+
# Author: Dave Coleman, Enrique Fernandez
3+
sudo: required
4+
dist: trusty
5+
language: generic
86
compiler:
97
- gcc
8+
env:
9+
global:
10+
- ROS_DISTRO=jade
11+
1012
notifications:
1113
email:
1214
recipients:
1315
1416
17+
1518
on_success: change #[always|never|change] # default: change
1619
on_failure: change #[always|never|change] # default: always
17-
before_install: # Use this to prepare the system to install prerequisites or dependencies
18-
# Define some config vars
19-
- export ROS_DISTRO=hydro
20+
21+
before_install:
2022
- export CI_SOURCE_PATH=$(pwd)
2123
- export REPOSITORY_NAME=${PWD##*/}
2224
- echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
23-
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
25+
# Add ROS repositories
26+
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" >
27+
/etc/apt/sources.list.d/ros-latest.list'
2428
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
2529
- sudo apt-get update -qq
26-
- sudo apt-get install -qq -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin ros-$ROS_DISTRO-ros
27-
# Setup rosdep
28-
- sudo rosdep init
30+
# Install and initialize rosdep
31+
- sudo apt-get install -qq -y python-dev
32+
python-catkin-pkg
33+
python-rosdep
34+
python-wstool
35+
ros-$ROS_DISTRO-catkin
36+
ros-$ROS_DISTRO-ros
37+
python-rosinstall
38+
python-catkin-tools
39+
python-catkin-pkg
40+
python-rospkg
41+
python-vcstools
42+
- sudo `which rosdep` init
2943
- rosdep update
30-
install: # Use this to install any prerequisites or dependencies necessary to run your build
44+
# Use rosdep to install dependencies
45+
- rosdep install -y -q --from-paths ./ --rosdistro $ROS_DISTRO
46+
47+
install:
3148
# Create workspace
32-
- mkdir -p ~/ros/ws_ros_controls/src
33-
- cd ~/ros/ws_ros_controls/src
49+
- mkdir -p ~/ros/ws_$REPOSITORY_NAME
50+
- cd ~/ros/ws_$REPOSITORY_NAME
51+
- catkin config --init --mkdirs
52+
- cd src
3453
- wstool init .
3554
# Download non-debian stuff
3655
- wstool merge https://raw.github.com/ros-controls/ros_control/$ROS_DISTRO-devel/ros_control.rosinstall
3756
- wstool update
38-
# Delete the ros_control.rosinstall version of this repo and use the one of the branch we are testing
57+
# Delete the ros_control.rosinstall version of this repo and use the one of
58+
# the branch we are testing
3959
- rm -rf $REPOSITORY_NAME
40-
- ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace
41-
- cd ../
60+
# Link the repo we are testing to the new workspace
61+
- ln -s $CI_SOURCE_PATH .
62+
- cd ..
4263
# Install dependencies for source repos
43-
- rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
44-
before_script: # Use this to prepare your build for testing e.g. copy database configurations, environment variables, etc.
45-
- source /opt/ros/$ROS_DISTRO/setup.bash
46-
script: # All commands must exit with code 0 on success. Anything else is considered failure.
47-
- catkin_make -j2
64+
- rosdep install -y -q --from-paths src --ignore-src --rosdistro $ROS_DISTRO
65+
66+
before_script:
67+
- source /opt/ros/$ROS_DISTRO/setup.bash
68+
- rospack profile
69+
70+
script:
71+
- cd ~/ros/ws_$REPOSITORY_NAME
72+
- catkin build -j8 --no-status --summary
73+
# Run tests
74+
# Note that we have to run only 1 test at a time to ensure that rostest
75+
# instances don't collide
76+
- catkin run_tests -j1 --no-status --summary
77+
# Note that catkin run_tests always returns 0, so we use catkin_test_results
78+
# to check for errors; see: https://github.com/catkin/catkin_tools/issues/245
79+
- catkin_test_results
4880

0 commit comments

Comments
 (0)