This repository has been archived by the owner on Sep 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
executable file
·72 lines (61 loc) · 3.29 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
# Docker on Travis requires sudo.
sudo: required
# Based on http://lmjohns3.com/2015/06/using-travis-ci-with-miniconda-scipy-and-nose.html
# Tweaked to specify versions on everything for stability.
language: python
python:
- "2.7"
services:
- docker
cache: apt # I don't think caching happens with sudo turned on, so this is a no-op.
addons:
apt:
packages: # Since we've turned on sudo, apt-get is available, but this works, too.
- libatlas-dev
- libatlas-base-dev
- liblapack-dev
- gfortran
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda2-4.2.12-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
# Prefer stability to having the latest
#- conda update --yes conda
install:
- conda install --yes python=$TRAVIS_PYTHON_VERSION cython==0.25.2 numpy=1.11.2
- pip install clodius==0.3.2
- pip install -r requirements.txt
- python manage.py migrate
script:
- set -e
### Build and test from the inside out:
### 1) Unit tests
- COOL=dixon2012-h1hesc-hindiii-allreps-filtered.1000kb.multires.cool
- MM9COOL=Dixon2012-J1-NcoI-R1-filtered.100kb.multires.cool
- HITILE=wgEncodeCaltechRnaSeqHuvecR1x75dTh1014IlnaPlusSignalRep2.hitile
- ANNO=gene_annotations.short.db
- HIBED=cnv_short.hibed
- AHBED=arrowhead_domains_short.txt.multires.db
- HLBED=hiccups_loops_short.txt.multires.db
- wget https://s3.amazonaws.com/pkerp/public/$COOL && mv $COOL data/
- wget https://s3.amazonaws.com/pkerp/public/$HITILE && mv $HITILE data/
- wget https://s3.amazonaws.com/pkerp/public/$ANNO && mv $ANNO data/
- wget https://s3.amazonaws.com/pkerp/public/$HIBED && mv $HIBED data/
- wget https://s3.amazonaws.com/pkerp/public/$AHBED && mv $AHBED data/
- wget https://s3.amazonaws.com/pkerp/public/$HLBED && mv $HLBED data/
- wget https://s3.amazonaws.com/pkerp/public/$MM9COOL && mv $MM9COOL data/
- echo 'foo bar' > data/tiny.txt
- python manage.py test tilesets
### 2) Django server
- PORT=6000
- echo "from django.contrib.auth.models import User; User.objects.filter(username='admin').delete(); User.objects.create_superuser('admin', '[email protected]', 'nimda')" | python manage.py shell
- python manage.py runserver localhost:$PORT &
- URL="http://localhost:$PORT/api/v1/tilesets/"
- until $(curl --output /dev/null --silent --fail --globoff $URL); do echo '.'; sleep 1; done
- curl -u admin:nimda -F "datafile=@data/$COOL" -F "filetype=cooler" -F "datatype=matrix" -F "uid=aa" -F "coordSystem=hg19" $URL
- curl -u admin:nimda -F "datafile=@data/$HITILE" -F "filetype=hitile" -F "datatype=vector" -F "uid=bb" -F "coordSystem=hg19" $URL
# TODO: Check that the output is what we expect?
- JSON=`curl $URL`
- echo $JSON
- 'EXPECTED="{\"count\": 2, \"results\": [{\"uuid\": \"aa\", \"filetype\": \"cooler\", \"datatype\": \"matrix\", \"private\": false, \"name\": \"dixon2012-h1hesc-hindiii-allreps-filtered.1000kb.multires.cool\", \"coordSystem\": \"hg19\", \"coordSystem2\": \"\"}, {\"uuid\": \"bb\", \"filetype\": \"hitile\", \"datatype\": \"vector\", \"private\": false, \"name\": \"wgEncodeCaltechRnaSeqHuvecR1x75dTh1014IlnaPlusSignalRep2.hitile\", \"coordSystem\": \"hg19\", \"coordSystem2\": \"\"}]}"'
- '[ "$JSON" == "$EXPECTED" ] && echo "Got expected response. Yay!"'