-
Notifications
You must be signed in to change notification settings - Fork 15
/
.travis.yml
116 lines (115 loc) · 4.71 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
dist: trusty
language: python
language: node_js
node_js:
- "12"
# qiita travis has set sudo to false
sudo: required
#addons:
# install chrome for testing purposes
# chrome: stable
group: deprecated-2017Q4
env:
- PYTHON_VERSION=3.5
# Disable if not needed
# - LABCONTROL_DEBUG_LEVEL=DEBUG
before_install:
- sudo apt-get install libevent-dev
- redis-server --port 7777 &
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- rm miniconda.sh
- df -h
- export PATH=/home/travis/miniconda3/bin:$PATH
# Add conda-forge to the list of channels to search for packages
# (May help with libgfortran not being found recently)
- conda config --append channels conda-forge
# Update conda itself
- conda update --yes conda
# node-qunit-puppeteer is a runner.js like interface for
# headless-chrome and qunit.
# node-qunit-puppeteer installs its own chromium as a dependency.
# hence, a separate chrome installation is not required.
#
# also, install "prettier" for front-end code auto formatting.
- npm install -g node-qunit-puppeteer prettier
install:
# Hard limit for transaction log, to prevent VHD from filling during tests
- psql -c "ALTER SYSTEM SET max_wal_size=2"
- psql -c "ALTER SYSTEM SET wal_keep_segments=0"
- psql -c "SELECT pg_reload_conf()"
# Verify log directory exists, postgresql processes exist, and postgresql is
# listening on port
- sudo find /var/lib/postgresql | grep -i log
- ps -A | grep post
- netstat -tulpn
# Create the Qiita environment
- travis_retry conda create -q --yes -n qiita python=3.6 pip libgfortran numpy nginx
- source activate qiita
- pip install sphinx sphinx-bootstrap-theme coveralls
- pip install https://github.com/biocore/qiita/archive/dev.zip --no-binary redbiom
# as we don't need redbiom we are going to use the default redis port
- sed 's/PORT = 7777/PORT = 6379/g' $HOME/miniconda3/envs/qiita/lib/python3.6/site-packages/qiita_core/support_files/config_test.cfg > config_test.cfg
- export QIITA_CONFIG_FP=${PWD}/config_test.cfg
# starting nginx
- mkdir /home/travis/miniconda3/envs/qiita/var/run/nginx/
- wget https://github.com/biocore/qiita/archive/dev.zip -O qiita-dev.zip
- unzip qiita-dev.zip
- nginx -c ${PWD}/qiita-dev/qiita_pet/nginx_example.conf
- qiita-env make --no-load-ontologies
- supervisord -c ${PWD}/qiita-dev/qiita_pet/supervisor_example.conf
- sleep 10 # give enough time to the webserver to start
- cat /tmp/supervisord.log
- source deactivate
- git clone https://github.com/nicolasff/webdis
- pushd webdis
- make
- ./webdis &
- popd
# Deactivate the Qiita environment
- conda deactivate
# Set the labcontrol config file
- sed "s#CERTIFICATE_FILEPATH=#CERTIFICATE_FILEPATH=$PWD/support_files/server.crt#g" labcontrol/db/support_files/skeleton_labcontrol.cfg > ~/.labcontrol.cfg.1
- sed "s#KEY_FILEPATH=#KEY_FILEPATH=$PWD/support_files/server.key#g" ~/.labcontrol.cfg.1 > ~/.labcontrol.cfg
# Install labcontrol
- travis_retry conda create --yes -n labcontrol python=$PYTHON_VERSION pip nose flake8 mock
- source activate labcontrol
- python --version
- travis_retry pip install -U pip
# print nosetests version:
# Note that this doesn't execute tests before LC has been installed.
- nosetests -V
- travis_retry pip install nose-exclude
- travis_retry pip install sphinx sphinx-bootstrap-theme coveralls
- travis_retry pip install https://github.com/qiita-spots/qiita_client/archive/master.zip
- travis_retry pip install .
- mkdir -p support_files
- openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout support_files/server.key -out support_files/server.crt -subj "/C=US/ST=CA/L=LaJolla/O=/CN=localhost"
# Apply the labcontrol patches to the database
- psql -d qiita_test -f labcontrol/db/support_files/db_patch.sql
- psql -d qiita_test -f labcontrol/db/support_files/db_patch_manual.sql
# Verify db population
# TODO: extend to labman schema
- psql -d qiita_test -c 'select * from qiita.study;'
- labcontrol patch
script:
- python labcontrol/gui/js_tests/js_tester.py all-tests
- nosetests --exclude-dir=labcontrol/gui/js_tests --with-doctest --with-coverage -v --cover-package=labcontrol
- flake8 labcontrol setup.py scripts/*
# Run prettier to verify that the JS/CSS ("front end") code doesn't need any
# stylistic adjustments.
- make festylecheck
- labcontrol/db/tests/tester.py integration_tests
- labcontrol/db/tests/tester.py stress_tests --num_plates_amplicon 2 --num_plates_shotgun 2
- labcontrol start-webserver &
- LABCONTROL_PID=$!
- sleep 10
- kill $LABCONTROL_PID
addons:
postgresql: "9.5"
services:
- redis-server
- postgresql
after_success:
- coveralls