-
Notifications
You must be signed in to change notification settings - Fork 900
Running Travis CI Builds Locally
James Sutton edited this page Jul 25, 2017
·
1 revision
Recently, It's been hard to get a travis-ci built to complete successfully with 100% passing tests. In order to debug this, I found it useful to run the travis environment in a local docker container. This page outlines the steps necessary to test builds in a local travis environment. The steps have been lifted from this page and tweaked for this project:
- Download and run the docker image:
docker run --name travis-debug -dit travisci/ci-garnet:packer-1499451976 /sbin/init
- Open a login shell in the running container:
docker exec -it travis-debug bash -l
- Switch to the
travis
user:su - travis
- Clone this repository:
git clone --depth=50 --branch=develop https://github.com/eclipse/paho.mqtt.java.git
- (Optional) Check out the commit that you want to test:
git checkout ec51902
- Install dependencies:
sudo -E apt-add-repository -y "ppa:mosquitto-dev/mosquitto-ppa"
sudo -E apt-get -yq update &>> ~/apt-get-update.log
sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install mosquitto
- Set environment variables:
export TRAVIS_OS_NAME=linux && export PATH="/usr/sbin:$PATH"
- cd into the git repository:
cd paho.mqtt.java
- Run the
travis-install.sh
script:./travis-install.sh
. You may need to hit enter to return back to the console. - Run the tests:
mvn --projects org.eclipse.paho.client.mqttv3,org.eclipse.paho.client.mqttv3.test test -Dtest.server_ssl_port=18885 -Dtest.server_uri=tcp://localhost:1883 -Dtest.server_websocket_uri=ws://localhost:8080 -B