go-test-coverage
go-test-coverage copied to clipboard
Unclear if exclude paths working correctly
I'm trying to run the go-test-coverage but it constantly ignores my excluded paths/files.
./.testcoverage.yml
profile: ./cover.out
local-prefix: "broker"
threshold:
file: 70
package: 80
total: 90
override:
- threshold: 0
path: ^.*cmd
exclude:
paths:
- ^.*models
Command
go-test-coverage --config=./.testcoverage.yml
Output
Files meeting coverage threshold of (70%): FAIL
Issues with:
broker/cmd/main.go 0%
# [...] shortened for readability
::error file=broker/models/mssql/Xm.go,line=1::File test coverage below threshold of (70%)
::error ::Package (broker/models/mssql) test coverage below threshold of (80%)
# [...] shortened for readability
::error ::Total coverage below threshold of (90%)
As you can see, the overridden threshold for $root/cmd files is ignored and the $root/models folder is not excluded. I also tried the following exclude path regex for models:
- ^models
- ^.*models
- ^.*models/
- ^.*\/models\/
- ^broker/models
What am I missing here?