From a286ddade02b98e429a8f65d52a825405a9efcf3 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 12 Oct 2015 17:35:00 +0100 Subject: [PATCH] only produce coverage for the module in the current dir and its sub-modules ...rather than all modules containing `weaveworks`. --- test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test b/test index 49e2f9691..10f59aa64 100755 --- a/test +++ b/test @@ -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