forked from sorgerlab/indra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
131 lines (131 loc) · 5.9 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
language: python
cache:
directories:
- $HOME/.cache/pip
- $HOME/.pybel
- $HOME/build/bgyori/indra/cache/geonames/index
python:
- "3.6"
services:
# Enable plotting on fake display
- xvfb
before_install:
- sudo apt-get update
- sudo apt-get install openjdk-8-jdk
- sudo apt-get install libstdc++6 graphviz
install:
# Install test/Travis-specific dependencies not covered elsewhere
- pip install pydot jsonschema coverage
nose-timer doctest-ignore-unicode awscli pycodestyle
- mkdir -p $HOME/.pybel/data
- aws s3 cp s3://bigmech/travis/pybel_cache.db $HOME/.pybel/data/ --no-sign-request --source-region us-east-1
- mkdir -p $HOME/.indra/bio_ontology/1.1
- aws s3 cp s3://bigmech/travis/mock_ontology.pkl $HOME/.indra/bio_ontology/1.1/bio_ontology.pkl --no-sign-request --source-region us-east-1
# PySB and dependencies
- wget "https://github.com/RuleWorld/bionetgen/releases/download/BioNetGen-2.4.0/BioNetGen-2.4.0-Linux.tgz" -O bionetgen.tar.gz -nv
- tar xzf bionetgen.tar.gz
- export BNGPATH=`pwd`/BioNetGen-2.4.0
- pip install git+https://github.com/pysb/pysb.git
# Temporary fix. Ensure cython is installed before pyjnius
- pip install cython
# Now install INDRA with all its extras
- pip install .[all]
- aws s3 cp s3://bigmech/travis/reach-82631d-biores-e9ee36.jar . --no-sign-request --source-region us-east-1
- export REACHPATH=$TRAVIS_BUILD_DIR/reach-82631d-biores-e9ee36.jar
- aws s3 cp s3://bigmech/travis/eidos.jar . --no-sign-request --source-region us-east-1
- export EIDOSPATH=$TRAVIS_BUILD_DIR/eidos.jar
- aws s3 cp s3://bigmech/travis/Phosphorylation_site_dataset.tsv indra/resources/ --no-sign-request --source-region us-east-1
# Run slow tests only if we're in the cron setting
- |
if [[ $TRAVIS_EVENT_TYPE == "cron" ]]; then
export RUN_SLOW=true;
fi
# Install TEES only if slow tests are being run
- |
if [[ $RUN_SLOW == "true" ]]; then
sudo pip2 install numpy
sudo apt-get --yes install ruby;
aws s3 cp s3://bigmech/travis/TEES.tar.bz2 . --no-sign-request --no-sign-request;
tar xjf TEES.tar.bz2;
mv TEES ~/TEES;
export TEES_SETTINGS=~/TEES/tees_local_settings.py
fi
# Install nose notify
- mkdir $HOME/.nose_notify;
- git clone https://github.com/pagreene/nose-notify.git $HOME/.nose_notify;
- export PYTHONPATH=$PYTHONPATH:$HOME/.nose_notify;
# Download adeft models
- python -m adeft.download
script:
# Credit: https://graysonkoonce.com/getting-the-current-branch-name-during-a-pull-request-in-travis-ci/
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
- echo "$TRAVIS_EVENT_TYPE"
- export TEES_PATH=~/TEES
- export PYTHONPATH=$PYTHONPATH:$TRAVIS_BUILD_DIR
- export _JAVA_OPTIONS="-Xmx4g -Xms1g"
# These are files that are ignored so that doctests don't fail
- export NOSE_IGNORE_FILES="find_full_text_sentence.py";
# Set nose attributes based on the context in which we are running
- export NOSEATTR="!notravis";
- if [[ $TRAVIS_PULL_REQUEST != "false" ]]; then
export NOSEATTR="!nonpublic,$NOSEATTR";
fi
- if [[ $RUN_SLOW != "true" ]]; then
export NOSEATTR="!slow,$NOSEATTR";
fi
- if [[ $TRAVIS_EVENT_TYPE != "cron" ]]; then
export NOSEATTR="!cron,$NOSEATTR";
fi
- echo $NOSEATTR
# Now run all INDRA tests
- cd $TRAVIS_BUILD_DIR
- python -u -m nose_notify --slack_hook $SLACK_NOTIFY_HOOK --label "$TRAVIS_REPO_SLUG - $TRAVIS_BRANCH"
indra -v -a $NOSEATTR --exclude='.*tees.*' --exclude='.*eidos.*' --exclude='.*isi.*'
--ignore-files='.*test_reach.py' --ignore-files='.*test_live_curation.py'
--with-coverage --cover-inclusive --cover-package=indra
--with-doctest --with-doctest-ignore-unicode --with-timer --timer-top-n 10
--processes=0
# First run TEES and Eidos tests separately for technical reasons
- python -m nose_notify indra/tests/test_tees.py --slack_hook $SLACK_NOTIFY_HOOK
--label "$TRAVIS_REPO_SLUG - $TRAVIS_BRANCH" -v -a $NOSEATTR --process-restartworker;
- python -m nose_notify indra/tests/test_eidos.py --slack_hook $SLACK_NOTIFY_HOOK
--label "$TRAVIS_REPO_SLUG - $TRAVIS_BRANCH" -v -a $NOSEATTR;
- python -m nose_notify indra/tests/test_live_curation.py
--slack_hook $SLACK_NOTIFY_HOOK
--label "$TRAVIS_REPO_SLUG - $TRAVIS_BRANCH" -v -a $NOSEATTR;
- python -m nose_notify indra/tests/test_reach.py
--slack_hook $SLACK_NOTIFY_HOOK
--label "$TRAVIS_REPO_SLUG - $TRAVIS_BRANCH" -v -a $NOSEATTR;
# Run NL model examples only when the environmental variable
# RUN_NL_MODELS is set to true in the Travis build
# NOTE: if blocks in Travis DO NOT FAIL even if there is
# and error in one of the commands inside. Therefore passing
# alone does not mean that all the operations inside were
# successful. Rather, the log needs to be inspected and compared
# to desired behavior.
- |
if [[ $RUN_NL_MODELS == "true" ]]; then
cd $TRAVIS_BUILD_DIR/models
python hello_indra.py
cd $TRAVIS_BUILD_DIR/models/p53_model
python run_p53_model.py noplot
cd $TRAVIS_BUILD_DIR/models/braf_model
python assemble_model.py
cd $TRAVIS_BUILD_DIR/models/ras_pathway
python run_ras_pathway.py trips
fi
# Run assembly benchmarks
- cd $TRAVIS_BUILD_DIR/indra/benchmarks/assembly_eval/batch4
- |
if [[ $TRAVIS_EVENT_TYPE == "cron" ]]; then
# Download a number of useful resource files for testing purposes
aws s3 cp s3://bigmech/travis/trips_reach_batch4.gz . --no-sign-request --source-region us-east-1
tar -xf trips_reach_batch4.gz
python run_combined.py
fi
- cd $TRAVIS_BUILD_DIR
# Run code style report on diff
- git remote set-branches --add origin master
- git fetch
- git diff origin/master | pycodestyle --diff > pep8.txt; cat pep8.txt;