Skip to content

fix: Improve code coverage reporting in codecov #2715

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

Merged
merged 5 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Merge branch 'main' into mafredri/coverage-updates
  • Loading branch information
mafredri authored Jul 25, 2022
commit cfd9f521d09b6cce2e9a8caa4e0b923414b7f0e9
16 changes: 12 additions & 4 deletions .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,18 @@ jobs:
- name: Test with Mock Database
id: test
shell: bash
run: gotestsum --junitfile="gotests.xml" --packages="./..." --
-covermode=atomic -coverprofile="gotests.coverage"
-coverpkg=./...
-timeout=5m -short -failfast
run: |
# Code coverage is more computationally expensive and also
# prevents test caching, so we disable it on alternate operating
# systems.
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
echo ::set-output name=cover::true
export COVERAGE_FLAGS='-covermode=atomic -coverprofile="gotests.coverage" -coverpkg=./...'
else
echo ::set-output name=cover::false
fi
set -x
gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=5m -short -failfast $COVERAGE_FLAGS

- name: Upload DataDog Trace
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ test: test-clean
# test-go-postgres (.github/workflows/coder.yaml).
test-postgres: test-clean test-postgres-docker
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum --junitfile="gotests.xml" --packages="./..." -- \
-covermode=atomic -coverprofile="gotests.coverage" -timeout=30m \
-covermode=atomic -coverprofile="gotests.coverage" -timeout=20m \
-coverpkg=./... \
-count=2 -race -failfast
-count=1 -race -failfast
.PHONY: test-postgres

test-postgres-docker:
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.