only produce coverage for the module in the current dir

and its sub-modules

...rather than all modules containing `weaveworks`.
This commit is contained in:
Matthias Radestock
2015-10-12 17:35:00 +01:00
parent caecc98fa8
commit a286ddade0

4
test
View File

@@ -31,12 +31,14 @@ if [ -n "$CIRCLECI" -a -z "$NO_SCHEDULER" -a -x "$DIR/sched" ]; then
echo $TESTDIRS
fi
PACKAGE_BASE=$(go list -e ./)
for dir in $TESTDIRS; do
go get -t -tags netgo $dir
GO_TEST_ARGS_RUN="$GO_TEST_ARGS"
if [ -n "$SLOW" ]; then
COVERPKGS=$((go list $dir; go list -f '{{join .Deps "\n"}}' $dir | grep "weaveworks") | paste -s -d,)
COVERPKGS=$((go list $dir; go list -f '{{join .Deps "\n"}}' $dir | grep "^$PACKAGE_BASE/") | paste -s -d,)
output=$(mktemp $coverdir/unit.XXXXXXXXXX)
GO_TEST_ARGS_RUN="$GO_TEST_ARGS -coverprofile=$output -coverpkg=$COVERPKGS"
fi