Skip to content

Commit

Permalink
ENH: Attempt to cover external remotes execution -- might get too muc…
Browse files Browse the repository at this point in the history
…h :-/
  • Loading branch information
yarikoptic committed Sep 26, 2016
1 parent a9c6915 commit f80fc69
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
@@ -0,0 +1,4 @@
[paths]
source =
datalad/
*/datalad/
5 changes: 5 additions & 0 deletions .travis.yml
Expand Up @@ -15,6 +15,9 @@ env:
# will be used in the matrix, where neither other variable is used
- BOTO_CONFIG=/tmp/nowhere
- DATALAD_TESTS_SSH=1
# Special settings/helper for combined coverage from special remotes execution
- COVERAGE=coverage
- PATH=$PWD/tools/coverage-bin:$PATH
# 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="
Expand Down Expand Up @@ -130,6 +133,8 @@ script:
- if [[ ${TMPDIR:-} =~ ".* .*" ]]; then tools/testing/run_doc_examples; else echo "not running since has spaces"; fi

after_success:
- coverage combine -a /tmp/.coverage-entrypoints-*
- coverage report
- codecov

# makes it only more difficult to comprehend the failing output. Enable only when necessary
Expand Down
31 changes: 31 additions & 0 deletions tools/coverage-bin/datalad
@@ -0,0 +1,31 @@
#!/bin/bash
#
# A little helper to overload default datalad executables with the one ran
# through coverage

set -eu

bin=$(basename $0)
curbin=$(which "$bin")
curdatalad=$(which datalad)
curdir=$(dirname $curdatalad)


COVERAGE=${COVERAGE:-python-coverage}
COVERAGE_RUN="`which $COVERAGE` run"

export PATH=${PATH//$curdir:/}
newdatalad=$(which datalad)
newbin=$(which $bin)
newpython=$(sed -ne '1s/#!//gp' $newdatalad)

if [ $newdatalad = $curdatalad ]; then
echo "E: binary remained the same: $newdatalad" >&2
exit 1
fi

touch /tmp/coverages
export COVERAGE_FILE=/tmp/.coverage-entrypoints-$RANDOM
echo "Running now $newpython $COVERAGE_RUN --include=datalad/* -a $newbin $@" >> /tmp/coverages
#$newpython $COVERAGE_RUN --include=datalad/* -a $newbin "$@"
$newpython $COVERAGE_RUN -a $newbin "$@"
1 change: 1 addition & 0 deletions tools/coverage-bin/git-annex-remote-datalad
1 change: 1 addition & 0 deletions tools/coverage-bin/git-annex-remote-datalad-archives

0 comments on commit f80fc69

Please sign in to comment.