Skip to content

Commit 63b9759

Browse files
committed
BF: moved running all the scripts via coverage into a separate helper tool
1 parent 6b2d7d1 commit 63b9759

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ script:
2323
# Run tests
2424
- PYTHONPATH=. nosetests -s -v --with-doctest --with-cov --cover-package . --logging-level=INFO -v .
2525
# Actually run all the scripts, contributing to coverage
26-
- bash -c 'failed=""; for f in [^_]*py; do python `which coverage` run -a $f || failed+=" $f"; echo "I: done $f. Exit code $?"; done; [ -z "$failed" ] || { echo "Failed: $failed"; exit 1; }'
26+
- ./run_all.sh
2727
# for now failure in flaking is ignored
2828
- flake8 *py || echo "PEP8 the code"
2929

run_all.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
#
3+
# Little helper to run all the scripts, under python coverage if coverage is available
4+
#
5+
6+
set -eu
7+
failed=""
8+
9+
if which coverage > /dev/null; then
10+
COVERAGE="`which coverage` run -a"
11+
else
12+
COVERAGE=''
13+
fi
14+
for f in [^_]*py; do
15+
python $COVERAGE $f || failed+=" $f"
16+
echo "I: done $f. Exit code $?"
17+
done;
18+
19+
if [ ! -z "$failed" ]; then
20+
echo "Failed: $failed";
21+
exit 1
22+
fi

0 commit comments

Comments
 (0)