Merge pull request #1801 from molecula/simplify-coverage

try to simplify test coverage w/ -coverpkg
This commit is contained in:
Matthew Jaffee 2021-12-08 13:46:51 -06:00 • committed by GitHub
commit 6dbbb52438
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 11 deletions

View file

@ -74,7 +74,8 @@ run go tests:
extends: .go-cache
script:
- echo "Running featurebase unit tests..."
- ./cover-everything.sh
- PKG_LIST=$(go list ./... | grep -v internal/clustertests | paste -s -d, -)
- go test -coverprofile=coverage.out -covermode=atomic -coverpkg=${PKG_LIST} ./...
artifacts:
paths:
- coverage.out
@ -85,7 +86,8 @@ run go tests future:
extends: .go-cache
script:
- echo "Running featurebase unit tests..."
- ./cover-everything.sh
- PKG_LIST=$(go list ./... | grep -v internal/clustertests | paste -s -d, -)
- go test -coverprofile=coverage.out -covermode=atomic -coverpkg=${PKG_LIST} ./...
artifacts:
paths:
- coverage.out

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
# actually get test coverage for every single package and subpackage
# very slow but oh well what are you gonna do, not test things?
# note it skips the roaring migrate
echo "mode: atomic" > coverage.out
for pkg in $(go list all | grep featurebase ); do
go test -coverprofile=pkgcoverage.out -covermode=atomic $pkg;
tail -n +2 pkgcoverage.out >> coverage.out; done