Skip to content

Commit

Permalink
fix: [#85] Exclude files from go coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sbp-bvanb committed Oct 17, 2024
1 parent a82a263 commit 941feb0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/go-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ variables() {
fi
fi

GO_LIST_TEST_EXCLUSIONS=$(go list $TAGS ./... | grep -v ${GOLANG_TEST_EXCLUSIONS})

if [ -n "${COVERPKG}" ]; then
COVERPKG="-coverpkg=${COVERPKG}"
COVERPKG="-coverpkg=$(echo $GO_LIST_TEST_EXCLUSIONS | tr '\n' ',')"
fi

if [ -n "${COVERPROFILE}" ]; then
Expand All @@ -29,6 +31,7 @@ variables() {

echo "COVERPKG: ${COVERPKG}"
echo "COVERPROFILE: ${COVERPROFILE}"
echo "GO_LIST_TEST_EXCLUSIONS: ${GO_LIST_TEST_EXCLUSIONS}"
echo "GOLANG_PARALLEL_TESTS: ${GOLANG_PARALLEL_TESTS}"
echo "GOLANG_TEST_EXCLUSIONS: ${GOLANG_TEST_EXCLUSIONS}"
echo "TAGS: ${TAGS}"
Expand All @@ -43,7 +46,7 @@ run_go_tests() {
$COVERPKG \
$COVERPROFILE \
$TAGS \
$(go list $TAGS ./... | grep -v ${GOLANG_TEST_EXCLUSIONS})
$(echo $GO_LIST_TEST_EXCLUSIONS)
}

main() {
Expand Down

0 comments on commit 941feb0

Please sign in to comment.