Skip to content

Commit

Permalink
Streamline TravisCI build
Browse files Browse the repository at this point in the history
This makes the Nengo GUI TravisCI build more similar to Nengo's.
A few important differences:

- Tests on both Python 2 and 3.
- Uses Miniconda instead of the built-in Python
  (should have a faster NumPy than the built-in).
- Doesn't use `sudo` (allows us to use container infrastructure,
  which should make starting up builds much faster).
- Doesn't start Nengo GUI server twice.
- Doesn't install Chrome webdriver (since it's not used -- selenium
  comes with the Firefox driver and TravisCI has Firefox installed).
  • Loading branch information
tbekolay committed Nov 15, 2016
1 parent 48941c2 commit 16d8670
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 25 deletions.
56 changes: 35 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
language: python
sudo: required
python:
- "2.7"
language: c
sudo: false

env:
global:
- CONDA_DEPS="numpy pytest"
- PIP_DEPS="selenium pyimgur"

matrix:
include:
- env: PYTHON="2.7"
- env: PYTHON="3.5"

before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p "$HOME/miniconda"
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n test python="$PYTHON" pip
- source activate test
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1920x1080x16

install:
- eval conda install "$CONDA_DEPS"
- eval pip install "$PIP_DEPS"

install:
- "pip install -r requirements.txt"
- "pip install -r requirements-test.txt"
before_script:
- "cd nengo_gui"
- wget http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- "cd .."
- "python setup.py develop"
- "export DISPLAY=:99.0"
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/cucumber_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1920x1080x16
- sleep 3 # give xvfb some time to start
- "wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar"
- "java -jar selenium-server-standalone-2.31.0.jar > /dev/null &"
- "nengo_gui --no-browser --auto-shutdown 0 &"#starts up nengo_gui
- sleep 2
# command to run tests
script:
- wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
- java -jar selenium-server-standalone-2.53.1.jar > /dev/null &
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb and some time to start

script:
- python setup.py -q develop
- py.test
3 changes: 0 additions & 3 deletions requirements-test.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ def read(*filenames, **kwargs):
install_requires=[
"nengo",
],
tests_require=[
"pytest",
"selenium",
"pyimgur",
],
classifiers=[ # https://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
Expand Down

0 comments on commit 16d8670

Please sign in to comment.