mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Improve code coverage reporting in codecov (#2715)
* fix: Remove explicit coverpkg github.com/coder/coder/codersdk This package is already covered by ./... * fix: Ignore test utils in coverage (clitest, coderdtest, ptytest)
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ trim_trailing_whitespace = true
|
|||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
[*.{md,json,yaml,tf,tfvars}]
|
[*.{md,json,yaml,yml,tf,tfvars}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
|||||||
@@ -34,3 +34,7 @@ ignore:
|
|||||||
- scripts
|
- scripts
|
||||||
- site/.storybook
|
- site/.storybook
|
||||||
- rules.go
|
- rules.go
|
||||||
|
# Packages used for writing tests.
|
||||||
|
- cli/clitest
|
||||||
|
- coderd/coderdtest
|
||||||
|
- pty/ptytest
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ jobs:
|
|||||||
# systems.
|
# systems.
|
||||||
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
|
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
|
||||||
echo ::set-output name=cover::true
|
echo ::set-output name=cover::true
|
||||||
export COVERAGE_FLAGS='-covermode=atomic -coverprofile="gotests.coverage" -coverpkg=./...,github.com/coder/coder/codersdk'
|
export COVERAGE_FLAGS='-covermode=atomic -coverprofile="gotests.coverage" -coverpkg=./...'
|
||||||
else
|
else
|
||||||
echo ::set-output name=cover::false
|
echo ::set-output name=cover::false
|
||||||
fi
|
fi
|
||||||
|
|||||||
Vendored
+3
-1
@@ -117,7 +117,9 @@
|
|||||||
"go.coverOnSave": true,
|
"go.coverOnSave": true,
|
||||||
// The codersdk is used by coderd another other packages extensively.
|
// The codersdk is used by coderd another other packages extensively.
|
||||||
// To reduce redundancy in tests, it's covered by other packages.
|
// To reduce redundancy in tests, it's covered by other packages.
|
||||||
"go.testFlags": ["-short", "-coverpkg=./.,github.com/coder/coder/codersdk"],
|
// Since package coverage pairing can't be defined, all packages cover
|
||||||
|
// all other packages.
|
||||||
|
"go.testFlags": ["-short", "-coverpkg=./..."],
|
||||||
"go.coverageDecorator": {
|
"go.coverageDecorator": {
|
||||||
"type": "gutter",
|
"type": "gutter",
|
||||||
"coveredHighlightColor": "rgba(64,128,128,0.5)",
|
"coveredHighlightColor": "rgba(64,128,128,0.5)",
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ test: test-clean
|
|||||||
test-postgres: test-clean test-postgres-docker
|
test-postgres: test-clean test-postgres-docker
|
||||||
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum --junitfile="gotests.xml" --packages="./..." -- \
|
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum --junitfile="gotests.xml" --packages="./..." -- \
|
||||||
-covermode=atomic -coverprofile="gotests.coverage" -timeout=20m \
|
-covermode=atomic -coverprofile="gotests.coverage" -timeout=20m \
|
||||||
-coverpkg=./...,github.com/coder/coder/codersdk \
|
-coverpkg=./... \
|
||||||
-count=1 -race -failfast
|
-count=1 -race -failfast
|
||||||
.PHONY: test-postgres
|
.PHONY: test-postgres
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user