-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.sh
executable file
·45 lines (36 loc) · 1.42 KB
/
test.sh
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
#!/usr/bin/env bash
set -o errexit
set -o pipefail
start() { echo travis_fold':'start:$1; echo $1; }
end() { set +v; echo travis_fold':'end:$1; echo; echo; }
die() { set +v; echo "$*" 1>&2 ; exit 1; }
if [ "$#" -ne 0 ]; then
die 'No arguments: Lints the python files, and runs unit and end-to-end tests.'
fi
# start target
# TARGET=`sed -e 's/vitessce-data\///' cloud_target.txt`
# BRANCH=`git rev-parse --abbrev-ref HEAD`
# [[ "$BRANCH" == 'HEAD' ]] \
# || [[ "$BRANCH" == "$TARGET" ]] \
# || die "branch ($BRANCH) != target ($TARGET); Update target:
# echo 'vitessce-data/$BRANCH' > cloud_target.txt"
# end target
start flake8
flake8 --exclude ./vips-8.7.1/
end flake8
start doctest
python -m doctest python/*.py -o ELLIPSIS
python -m doctest snakemake/*/src/*.py -o ELLIPSIS
end doctest
start endtoend
rm -rf fake-files/output || echo 'Nothing to delete'
mkdir fake-files/output || echo 'Did not mkdir'
mkdir fake-files/output/linnarsson || echo 'Did not mkdir'
cp fake-files/output{-expected,}/linnarsson/linnarsson.neighborhoods.json
# Calculating neightborhoods is slow, and not a requirement right now,
# so copy over the expected output, and it will not be regenerated.
CI=true ./process.sh
# CI to get it to run as test locally;
# Redundant on Travis, but doesn't hurt anything.
diff -w -r fake-files/output fake-files/output-expected/ -x .DS_Store -x .snakemake_timestamp | head -n100 | cut -c 1-100
end endtoend