forked from sdss/marvin
/
.travis.yml
91 lines (76 loc) · 3 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
language: python
cache: pip
sudo: false
python:
- '2.7'
- '3.4'
- '3.5'
- '3.6'
os:
- linux
services:
- postgresql
- memcached
addons:
postgresql: '9.4'
apt:
packages:
xvfb
nano
env:
globals:
- MANGA_LOCALHOST=1
- DISPLAY=:99.0
matrix:
fast_finish: true
allow_failures:
- python: '3.6'
notifications:
slack:
secure: FZXERPoPv4n52hBx3bvEjJ5T0Ey2Es7Sa7sd/MA4AMr7l1771YZ1VTLpVtpw4qJR8vrt4NtSFbBowJiovDmx6FCjEb/2N6RipjbLowAtFRqjalOGO3KZOi3UPeiytP/IYD1DG7YmeYJOL8aof2awns8ckAWRSz6HO3cDpqg+hycDXasZQdQfIKgY17UZvONBJZCZGeC3lMw4IrbhkfhW7aQvhUhcXDtfEyObNt2+FGE6y7WDeOEjtfArKc/Iz4gybWLkYPpA6rtQfQciQvpZv94sanxli8vq4mXIpu/dxn73jfKSYsYIl7+OYrXKJQBy/8muwwuSe2et15mG90KGUsDOJ+PXKCLOSl8JohO/pH0l3hZKno6nX7byL6orEbBuQjpMJO0QFUs7o6hLSv3q4tgtuV0M99I8UHcIgmBYL9oXI4BHIsSwreTXHfV/8LiuZfyaB2NzwKuRHQTZQfCD+ujqXaspyQX70Xew2L7rruRuBuKLTntgklMFtAPYJYbW/4z6HsZ//X6Z2BHwe0Etv4FZaKsf8IK81p//oYi/3kw2ENRYNARu0HzU0Edba6ugBPjzw6wFyWsL35IFTSosby50iAWo7xYfRXBv1kH0tPOcmPoJzFcrdAmvEqt6K8bNwqgx72/qsBp4fhmGfQM5G07dkyQM+hu+e9OPEfTwOo4=
# repo branches to test
branches:
- master
before_install:
# Set up the .netrc file we need to download test data
- openssl aes-256-cbc -K $encrypted_4e487599227c_key -iv $encrypted_4e487599227c_iv -in etc/.netrc.enc -out ~/.netrc -d
- chmod 600 ~/.netrc
# install and use Miniconda environment
- 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 update --yes conda
install:
- conda create --yes -n test_env python=$TRAVIS_PYTHON_VERSION pip numpy scipy matplotlib ipython --quiet
- source activate test_env
- pip install -r requirements.txt --quiet
- pip install psycopg2 --quiet
- pip install blinker --quiet
- pip install pytest --quiet
- pip install pytest-cov --quiet
- pip install pytest-sugar --quiet
- python setup.py install
before_script:
- export PYTHONPATH=$PYTHONPATH:$TRAVIS_BUILD_DIR/python
# Needed to handle GUI or QT based tests (e.g. matplotlib.pyplot import)
- sh -e /etc/init.d/xvfb start
- sleep 3
# Run script to download test data files and db
- sh $TRAVIS_BUILD_DIR/bin/setup_travis
# Create unique web server port based on travis python version
- export LOCAL_MARVIN_PORT=50${TRAVIS_PYTHON_VERSION/.}
- echo $LOCAL_MARVIN_PORT
# Start the web server on port 50XX and allow enough time to start up
- export MARVIN_DIR=$TRAVIS_BUILD_DIR
- $TRAVIS_BUILD_DIR/bin/run_marvin -l -d -p $LOCAL_MARVIN_PORT &
- sleep 20
# Various checks to ensure things properly start up
- lsof -Pnl +M -i4
- echo $MANGA_LOCALHOST
- curl http://localhost:$LOCAL_MARVIN_PORT/marvin2/api/general/getroutemap/
- python -c "from marvin import config, marvindb; print(config.db, marvindb.db); from brain.utils.general.general import getDbMachine; print(getDbMachine()); import marvin.db.models.DataModelClasses as datadb;"
- python -c "from matplotlib import pyplot as plt;"
script:
- py.test python/marvin/tests -v --cov python/marvin --cov-report html
after_success:
- coveralls