forked from datalad/datalad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
276 lines (264 loc) · 10.6 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# vim ft=yaml
# travis-ci.org definition for DataLad build
language: python
python:
- 3.5
##1 - 3.6
cache:
- apt
env:
global:
# will be used in the matrix, where neither other variable is used
- BOTO_CONFIG=/tmp/nowhere
- DATALAD_TESTS_SSH=1
- DATALAD_LOG_CMD_ENV=GIT_SSH_COMMAND
- TESTS_TO_PERFORM=datalad
- NOSE_OPTS=
- NOSE_SELECTION="integration or usecase or slow"
- NOSE_SELECTION_OP="not " # so it would be "not (integration or usecase)"
# Special settings/helper for combined coverage from special remotes execution
- COVERAGE=coverage
- DATALAD_DATASETS_TOPURL=http://datasets-tests.datalad.org
matrix:
##1 - DATALAD_REPO_VERSION=6
- DATALAD_REPO_VERSION=5
# Disabled since old folks don't want to change workflows of submitting through central authority
# - secure: "k2rHdTBjUU3pUUASqfRr7kHaaSmNKLLAR2f66A0fFSulih4CXxwLrR3g8/HP9m+jMve8mAYEiPSI7dT7cCm3WMA/piyLh2wKCGgzDD9oLjtvPAioR8dgLpzbgjxV/Vq6fwwPMlvbqqa+MmAImnAoSufEmI7zVQHCq11Hd5nd6Es="
# - secure: "Az7Pzo5pSdAFTTX6XXzE4VUS3wnlIe1vi/+bfHBzDjxstDvZVkPjPzaIs6v/BLod43AYBl1v9dyJR4qnBnaVrUDLB3tC0emLhJ2qnw+8GKHSSImCwIOeZzg9QpXeVQovZUqQVQ3fg3KIWCIzhmJ59EbMQcI4krNDxk4WcXmyVfk="
matrix:
include:
# Additional custom ones
- python: 3.7
# Single run for Python 3.7
env:
# Run all tests in a single whoop here
# We cannot have empty -A selector, so the one which always will be fulfilled
- NOSE_SELECTION=
- NOSE_SELECTION_OP=not
- python: 3.6
# Single run for Python 3.6
env:
# Run all tests in a single whoop here
# We cannot have empty -A selector, so the one which always will be fulfilled
- NOSE_SELECTION=
- NOSE_SELECTION_OP=not
- python: 3.5
# Split runs for v6 since a single one is too long now
env:
- DATALAD_REPO_VERSION=6
- NOSE_SELECTION_OP=not
- python: 3.5
env:
- DATALAD_REPO_VERSION=6
- NOSE_SELECTION_OP=""
- python: 3.5
# Run slow etc tests under a single tricky scenario
env:
- TMPDIR="/var/tmp/sym link"
- NOSE_SELECTION_OP=""
# And the leading - in filenames for the most challenge
- DATALAD_TESTS_OBSCURE_PREFIX=-
- DATALAD_LOG_TRACEBACK=collide # just a smoke test for now
- python: 3.5
# A run loaded with various customizations to smoke test those functionalities
# apparently moving symlink outside has different effects on abspath
# see https://github.com/datalad/datalad/issues/878
env:
# eventually: - TMPDIR="/var/tmp/sym ссылка"
- TMPDIR="/var/tmp/sym link"
# and obscure the names more a bit
- DATALAD_TESTS_OBSCURE_PREFIX=-
# By default no logs will be output. This one is to test with log output at INFO level
- DATALAD_LOG_LEVEL=INFO
- DATALAD_LOG_TRACEBACK=1 # just a smoke test for now
- DATALAD_LOG_VMEM=1
- python: 3.5
# By default no logs will be output. This one is to test with low level but dumped to /dev/null
env:
- DATALAD_LOG_LEVEL=2
- DATALAD_LOG_TARGET=/dev/null
- DATALAD_TESTS_PROTOCOLREMOTE=1
- DATALAD_TESTS_DATALADREMOTE=1
- DATALAD_LOG_CMD_CWD=1
- DATALAD_LOG_CMD_OUTPUTS=1
- DATALAD_LOG_CMD_ENV=1
- DATALAD_LOG_CMD_STDIN=1
- DATALAD_TESTS_UI_BACKEND=console
- DATALAD_TESTS_OBSCURE_PREFIX=-
- DATALAD_SEED=1
- GIT_AUTHOR_DATE="Thu, 07 Apr 2005 22:13:13 +0200"
- GIT_AUTHOR_NAME=blah
- GIT_COMMITTER_DATE="Thu, 07 Apr 2005 22:13:13 +0200"
- GIT_COMMITTER_NAME=blah
- python: 3.5
# Test some under NFS mount (only selected sub-set)
env:
# do not run SSH-based tests due to stall(s)
# https://github.com/datalad/datalad/pull/4172
- DATALAD_TESTS_SSH=0
- TMPDIR="/tmp/nfsmount"
- TESTS_TO_PERFORM="datalad.tests datalad.support"
#
# The ones to run only on weekends against master.
# They will not contribute to coverage etc, but might lead to failed status
#
# run if git-annex version in neurodebian -devel differs
- python: 3.5
env:
- _DL_DEVEL_ANNEX=1
- _DL_CRON=1
# Run with latest git rather than the bundled one.
- python: 3.5
addons:
apt:
sources:
- sourceline: 'ppa:git-core/ppa'
env:
- DATALAD_USE_DEFAULT_GIT=1
- _DL_UPSTREAM_GIT=1
- _DL_CRON=1
- python: 3.5
env:
# to test operation under root since also would consider FS "crippled" due to
# ability to rewrite R/O files
- NOSE_WRAPPER="sudo -E"
# no key authentication for root:
- DATALAD_TESTS_SSH=0
- _DL_CRON=1
- python: 3.5
env:
- DATALAD_TESTS_NONETWORK=1
# must operate nicely with those env variables set
- http_proxy=
- https_proxy=
- _DL_CRON=1
- python: 3.5
env:
- PYTHONPATH=$PWD/tools/testing/bad_internals/_scrapy/
- _DL_CRON=1
- python: 3.5
# Test under NFS mount (full, only in master)
env:
- TMPDIR="/tmp/nfsmount"
- _DL_CRON=1
# - python: 3.5
# # test whether known v6 failures still fail
# env:
# - DATALAD_REPO_VERSION=6
# - DATALAD_TESTS_KNOWNFAILURES_SKIP=no
# - DATALAD_TESTS_KNOWNFAILURES_PROBE=yes
# - DATALAD_TESTS_SSH=1
# - _DL_CRON=1
allow_failures:
# Test under NFS mount (full, only in master)
- python: 3.5
env:
- TMPDIR="/tmp/nfsmount"
- _DL_CRON=1
# # test whether known v6 failures still fail
# - env:
# - DATALAD_REPO_VERSION=6
# - DATALAD_TESTS_KNOWNFAILURES_SKIP=no
# - DATALAD_TESTS_KNOWNFAILURES_PROBE=yes
# - DATALAD_TESTS_SSH=1
# - _DL_CRON=1
# Causes complete laptop or travis instance crash atm, but survives in a docker
# need to figure it out (looks like some PID explosion)
# - python: 3.5
# # we would need to migrate to boto3 to test it fully, but SSH should work
# env:
# - DATALAD_TESTS_SSH=1
# - UNSET_S3_SECRETS=1
before_install:
- if [ ! -z "${_DL_CRON:-}" ]; then
if [ ! ${TRAVIS_EVENT_TYPE} = "cron" ]; then
echo "Exiting since should only be ran on a weekly basis by cron!";
exit 0;
fi
fi
# Life was so fast that we needed a slow down
# - sleep 60 # TEMP -- to spot diff
# Just in case we need to check if nfs is there etc
- sudo lsmod
# The ultimate one-liner setup for NeuroDebian repository
- bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
- travis_retry sudo apt-get update -qq
- travis_retry sudo apt-get install eatmydata # to speedup some installations
- sudo eatmydata tools/ci/prep-travis-forssh-sudo.sh
- tools/ci/prep-travis-forssh.sh
# Install grunt-cli
- eatmydata npm install grunt-cli
# Install optionally upstream current development so we are sure that they break nothing important for us
- if [ ! -z "${_DL_UPSTREAM_GITANNEX:-}" ]; then sudo tools/ci/install-annex-snapshot.sh; sudo ln -s `find /usr/local/lib/git-annex.linux -maxdepth 1 -type f -perm /+x` /usr/local/bin/; else sudo eatmydata apt-get install git-annex-standalone ; fi
# Install optionally -devel version of annex, and if goes wrong (we have most recent), exit right away
- if [ ! -z "${_DL_DEVEL_ANNEX:-}" ]; then tools/ci/prep-travis-devel-annex.sh || { ex="$?"; if [ "$ex" -eq 99 ]; then exit 0; else exit "$ex"; fi; }; fi
# Optionally install the latest Git. Exit code 100 indicates that bundled is same as the latest.
- if [ ! -z "${_DL_UPSTREAM_GIT:-}" ]; then
sudo tools/ci/install-latest-git.sh || { [ $? -eq 100 ] && exit 0; } || exit 1;
fi
install:
# Install standalone build of git-annex for the recent enough version
- travis_retry sudo eatmydata apt-get install zip pandoc p7zip-full
# needed for tests of patool compression fall-back solution
- travis_retry sudo eatmydata apt-get install xz-utils
- travis_retry sudo eatmydata apt-get install shunit2
# for metadata support
- travis_retry sudo eatmydata apt-get install exempi
- git config --global user.email "[email protected]"
- git config --global user.name "Travis Almighty"
- cd ..; pip install -q codecov; cd -
- pip install -r requirements-devel.txt
# So we could test under sudo -E with PATH pointing to installed location
- sudo sed -i -e 's/^Defaults.*secure_path.*$//' /etc/sudoers
# TMPDIRs
- if [[ "${TMPDIR:-}" =~ .*/sym\ link ]]; then echo "Symlinking $TMPDIR"; ln -s /tmp "$TMPDIR"; fi
- if [[ "${TMPDIR:-}" =~ .*/d\ i\ r ]]; then echo "mkdir $TMPDIR"; mkdir -p "$TMPDIR"; fi
- if [[ "${TMPDIR:-}" =~ .*/nfsmount ]]; then echo "mkdir $TMPDIR"; mkdir -p "$TMPDIR" "${TMPDIR}_"; echo "/tmp/nfsmount_ localhost(rw)" | sudo bash -c 'cat - > /etc/exports'; sudo apt-get install -y nfs-kernel-server; sudo exportfs -a; sudo mount -t nfs localhost:/tmp/nfsmount_ /tmp/nfsmount; sudo git config --system annex.pidlock true ; fi
# S3
- if [ ! -z "$UNSET_S3_SECRETS" ]; then echo "usetting"; unset DATALAD_datalad_test_s3_key_id DATALAD_datalad_test_s3_secret_id; fi
# Install grunt to test run javascript frontend tests
- npm install grunt
- npm install grunt-contrib-qunit@>=3.0.1
script:
# Test installation system-wide
- sudo pip install .
# install RIA special remote
# TODO: Remove whenever move of git-annex-ria-remote to datalad-core is finished
- sudo pip install git+https://github.com/bpoldrack/git-annex-ria-remote@transition-to-core
- mkdir -p __testhome__
- cd __testhome__
# Run tests
- http_proxy=
PATH=$PWD/../tools/coverage-bin:$PATH
$NOSE_WRAPPER `which nosetests` $NOSE_OPTS
-A "$NOSE_SELECTION_OP($NOSE_SELECTION)"
--with-doctest
--with-cov --cover-package datalad
--logging-level=INFO
$TESTS_TO_PERFORM
# Run doc examples if no spaces in the TMPDIR and SSH is allowed
- if [ ${DATALAD_TESTS_SSH:-0} != 1 ] || echo "${TMPDIR:-}" | grep -q ' '; then
echo "Testing examples is disabled by configuration";
else
$NOSE_WRAPPER ../tools/testing/run_doc_examples;
fi
- cd ..
# Run javascript tests
- grunt test --verbose
# Report WTF information using system wide installed version
- datalad wtf
after_success:
# submit only what we have covered in the PRs
- if [ -z "${_DL_CRON:-}" ]; then
cp __testhome__/.coverage .;
coverage combine -a /tmp/.coverage-entrypoints-*;
codecov;
fi
# makes it only more difficult to comprehend the failing output. Enable only when necessary
# for a particular debugging
#after_failure:
# - if [ ! -z "$DATALAD_TESTS_NONETWORK" ]; then sudo route add -net 0.0.0.0 netmask 0.0.0.0 dev lo; fi
# - DATALAD_LOG_LEVEL=DEBUG $NOSE_WRAPPER `which nosetests` -s -v --with-doctest --with-cov --cover-package datalad --logging-level=DEBUG
# - if [ ! -z "$DATALAD_TESTS_NONETWORK" ]; then sudo route del -net 0.0.0.0 netmask 0.0.0.0 dev lo; fi