Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(coverage): expand coverage with -coverpkg #3089

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/main_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ jobs:
uses: ./.github/workflows/test_template.yml
with:
modulepath: ${{ inputs.modulepath }}
tests-timeout: "30m"
tests-timeout: "40m"
go-version: "1.22.x"
secrets:
codecov-token: ${{ secrets.codecov-token }}

8 changes: 6 additions & 2 deletions .github/workflows/test_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }} \
-test.gocoverdir=$GOCOVERDIR

# Print results
(set +x; echo 'go coverage results:')
Expand Down
Loading