From 1440b7cd654f927a4c32d1315d1fb50c95bcf96f Mon Sep 17 00:00:00 2001 From: gfanton <8671905+gfanton@users.noreply.github.com> Date: Thu, 7 Nov 2024 22:04:58 +0100 Subject: [PATCH] fix: coverage Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com> --- .github/workflows/test_template.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_template.yml b/.github/workflows/test_template.yml index 38fa10e096b..60c8645e94c 100644 --- a/.github/workflows/test_template.yml +++ b/.github/workflows/test_template.yml @@ -36,13 +36,17 @@ jobs: mkdir -p "$GOCOVERDIR" "$TXTARCOVERDIR" "$COVERDIR" # Craft a filter flag based on the module path to avoid expanding coverage on unrelated tags. - export filter="-pkg=github.com/gnolang/gno/${{ inputs.modulepath }}/..." + export coverpkg="github.com/gnolang/gno/${{ inputs.modulepath }}/..." + export filter="-pkg=$coverpkg" # XXX: Simplify coverage of txtar - the current setup is a bit # confusing and meticulous. There will be some improvements in Go # 1.23 regarding coverage, so we can use this as a workaround until # then. - go test -covermode=atomic -timeout ${{ inputs.tests-timeout }} ./... -test.gocoverdir=$GOCOVERDIR + go test -coverpkg=$coverpkg \ + -covermode=atomic \ + -timeout ${{ inputs.tests-timeout }} \ + $coverpkg -test.gocoverdir=$GOCOVERDIR # Print results (set +x; echo 'go coverage results:')