try to simplify test coverage w/ -coverpkg

This commit is contained in:
Matthew Jaffee 2021-12-07 18:38:48 -06:00
parent 4488ab1062
commit a40bc3edf7
2 changed files with 2 additions and 11 deletions

View file

@ -74,7 +74,7 @@ run go tests:
extends: .go-cache
script:
- echo "Running featurebase unit tests..."
- ./cover-everything.sh
- go test -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./...
artifacts:
paths:
- coverage.out
@ -85,7 +85,7 @@ run go tests future:
extends: .go-cache
script:
- echo "Running featurebase unit tests..."
- ./cover-everything.sh
- go test -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./...
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