forked from peterjc/pico_galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
156 lines (146 loc) · 6.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# This is a special configuration file to run tests on Travis-CI via
# GitHub notifications when changes are committed.
#
# See http://travis-ci.org/ for details
# Galaxy v16.01 (currently represented by their master branch)
# supports Python 2.6 and 2.7, but there after only Python 2.7
# Meanwhile, planemo only supports Python 2.7 and 3.4+
# so we're only testing under Python 2.7 for now.
language: python
matrix:
include:
- python: "2.7"
env: GALAXY_BRANCH=master
- python: "2.7"
env: GALAXY_BRANCH=dev
# Planemo Lint
# ============
#
# Planemo can be run to check tools separately from Galaxy, and this
# is fast so we do it *before* the slow process of installing Galaxy
# and running the tool tests.
#
#
# Installing Galaxy
# =================
#
# Before installing our Galaxy wrappers, we need to install Galaxy.
#
# Galaxy used to be developed in hg using BitBucket, but cloning with
# hg or getting a specific revision with wget was quite slow. Using
# git clone with a mirror on GitHub was faster, while getting the
# latest revision with wget from GitHub was even faster.
#
# We therefore use wget with the new official Galaxy repository on
# GitHub, https://github.com/galaxyproject/galaxy
#
#
# Installing Tool Dependencies
# ============================
#
# We grab Galaxy, and will later make configuration changes specifically
# for testing our tools. Otherwise we use the default settings such as
# running with an SQLite database.
#
# We also need to install our tool dependencies, e.g. samtools binaries,
# which we will do manually rather than via a (local) Galaxy Tool Shed.
# Tool dependencies defined in this repository can be installed via
# "planemo dependency_script", however we still have to worry about
# dependencies normally done via the Tool Shed (e.g. Biopython,
# mummer) or assumed to be present by Galaxy itself (e.g. samtools).
before_install:
- echo "Using planemo lint to check for obvious tool errors"
- pip install planemo
- planemo shed_lint --report_level warn --tools --fail_level error --recursive ${TRAVIS_BUILD_DIR}/tools/
- planemo shed_lint --report_level warn --tools --fail_level error --recursive ${TRAVIS_BUILD_DIR}/datatypes/
- planemo shed_lint --report_level warn --tools --fail_level error --recursive ${TRAVIS_BUILD_DIR}/workflows/
- planemo shed_lint --report_level warn --tools --fail_level error --recursive ${TRAVIS_BUILD_DIR}/packages/
- echo "Fixing permissions on Python eggs cache folder"
- mkdir -p "$HOME/.python-eggs"
- chmod 700 "$HOME/.python-eggs"
- echo "Downloading and setting up dependencies..."
- export INSTALL_DIR=/tmp/dep_install && mkdir $INSTALL_DIR
- export DOWNLOAD_CACHE=/tmp/download_cache && mkdir $DOWNLOAD_CACHE
- planemo dependency_script -r ${TRAVIS_BUILD_DIR}/packages/ ${TRAVIS_BUILD_DIR}/tools/
- bash dep_install.sh
- source env.sh
- echo "Installing Biopython..."
- pip install biopython
- echo "Installing MUMmer and its dependencies..."
- sudo apt-get -qq update
- sudo apt-get install -y gnuplot ghostscript
- cd ${TRAVIS_BUILD_DIR}
- wget http://downloads.sourceforge.net/project/mummer/mummer/3.23/MUMmer3.23.tar.gz
- tar -zxvf MUMmer3.23.tar.gz
- cd MUMmer3.23 && make check && make install
- export PATH=$PWD:$PATH
- echo "Installing samtools..."
- cd ${TRAVIS_BUILD_DIR} && mkdir samtools && cd samtools
- wget http://depot.galaxyproject.org/package/linux/x86_64/samtools/samtools-0.1.19-Linux-x86_64.tgz
- tar -zxvf samtools-0.1.19-Linux-x86_64.tgz
- export PATH=$PWD/bin/:$PATH
- echo "Fetching Galaxy ${GALAXY_BRANCH} branch..."
- cd ${TRAVIS_BUILD_DIR}
- wget https://codeload.github.com/galaxyproject/galaxy/tar.gz/${GALAXY_BRANCH}
- tar -zxvf ${GALAXY_BRANCH} | tail
- cd galaxy-${GALAXY_BRANCH}
- pip install requests
# Configuring tools within Galaxy
# ===============================
#
# We setup a minimal tool_conf.xml and/or tool_conf.xml.sample file to
# get Galaxy to just test our tools, rather than via a (local) Galaxy
# Tool Shed.
#
# TODO - GALAXY_TEST_TOOL_CONF environment variable rather than symlink?
#
# We setup our tools under the Galaxy tool folder by using symlinks.
# TODO - Restructure this to auto-update in future when add folders?
#
# We would setup our datatypes by adding xxx.py to the Galaxy library, and
# adding an import in lib/galaxy/datatypes/registry.py, and replacing
# the datatypes_conf.xml file.
#
# We setup our sample data in the Galaxy test-data folder by copying them
# (using symlinks might be faster?)
#
# We setup out sample *.loc files in the Galaxy tool-data folder by copying
# them (using symlinks might be faster?)
#
# Galaxy now provides a startup script to setup all the sample files,
# and fetch egg/wheel Python dependecies etc.
install:
- cd ${TRAVIS_BUILD_DIR}/galaxy-${GALAXY_BRANCH}
- export GALAXY_TEST_UPLOAD_ASYNC=false
- export GALAXY_TEST_DB_TEMPLATE=https://github.com/jmchilton/galaxy-downloads/raw/master/db_gx_rev_0127.sqlite
- ln -s ${TRAVIS_BUILD_DIR}/.travis.tool_conf.xml tool_conf.xml
- rm -f config/tool_conf.xml.sample
- ln -s ${TRAVIS_BUILD_DIR}/.travis.tool_conf.xml config/tool_conf.xml.sample
- for i in $( ls ${TRAVIS_BUILD_DIR}/tools/ ); do ln -s ${TRAVIS_BUILD_DIR}/tools/$i/ tools/$i ; done
- ln -s ${TRAVIS_BUILD_DIR}/.travis.datatypes_conf.xml datatypes_conf.xml
- cp ${TRAVIS_BUILD_DIR}/test-data/* test-data/
- cp ${TRAVIS_BUILD_DIR}/tool-data/* tool-data/
- bash scripts/common_startup.sh --no-create-venv --dev-wheels
# Testing tools in Galaxy
# =======================
#
# Having setup our Galaxy with a minimal tool_conf.xml / tool_conf.xml.sample
# we call run_functional_tests.sh to run just our tests (grouped under a
# common section "travis" in the XML file for this purpose).
#
# ./run_functional_tests.sh -sid Continuous-Integration-Travis
#
# calls:
#
# python ./scripts/functional_tests.py --with-nosehtml --html-report-file run_functional_tests.html -v `python tool_list.py Continuous-Integration-Travis`
#
# That gives an error sadly under Travis,
# functional_tests.py: error: no such option: --with-nosehtml
# And also,
# functional_tests.py: error: no such option: --html-report-file
# Perhaps Galaxy's nose egg isn't being fetched?
script:
- python ./scripts/functional_tests.py -v `python tool_list.py Continuous-Integration-Travis`
#The email defaults are too talkative while we're getting Travis working nicely.
notifications:
email: false