Skip to content

Commit

Permalink
tests: exclude generated code from coverage
Browse files Browse the repository at this point in the history
also try uploading the .html report for troublshooting coverall reports
  • Loading branch information
murfffi committed Jan 10, 2025
1 parent b34649e commit 021caf8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@ jobs:
run: go build -v ./...

- name: Test
run: go test -covermode atomic -coverprofile=covprofile -v -vet=all ./...
run: make test

- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: go run github.com/mattn/goveralls@latest -coverprofile=covprofile -service=github
run: go run github.com/mattn/goveralls@latest -coverprofile=covprofile -service=github

- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: coverage.html

post-merge:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ _testmain.go
*.test
*.prof

vendor/
vendor/
/coverage.html
/covprofile
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ usql:
test-cli: usql
./usql -c "\drivers" | grep impala

test:
go test -covermode atomic -coverprofile=covprofile -v -vet=all `exec go list ./... | grep -v "./internal/generated"`
go tool cover -html=covprofile -o coverage.html

0 comments on commit 021caf8

Please sign in to comment.