Skip to content

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:

  1. Download and run the docker image: docker run --name travis-debug -dit travisci/ci-garnet:packer-1499451976 /sbin/init
  2. Open a login shell in the running container: docker exec -it travis-debug bash -l
  3. Switch to the travis user: su - travis
  4. Clone this repository: git clone --depth=50 --branch=develop https://github.com/eclipse/paho.mqtt.java.git
  5. (Optional) Check out the commit that you want to test: git checkout ec51902
  6. 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
  1. Set environment variables: export TRAVIS_OS_NAME=linux && export PATH="/usr/sbin:$PATH"
  2. cd into the git repository: cd paho.mqtt.java
  3. Run the travis-install.sh script: ./travis-install.sh. You may need to hit enter to return back to the console.
  4. 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
Clone this wiki locally