Open kelzenberg opened 4 days ago
hey
i am not really sure what is happening here, but override and exclude rules are working correctly in all my repositories.
does local-prefix
have same value as module
in go.mod
file?
in the output that you provided, broker/models
or ^broker/models
should exclude this package. first rule is bit more relaxed, because it will exclude any file that contains broker/models
in it's path (maybe try with this?), while second will exclude files that begins with this string. it looks to me that, for some reason, paths might not begin with broker/models
although that's what output indicates.
to enure that rule is actually working, try excluding some specif file. for example have exclude rule with Xm\.go$
(i see you have this file in output provided above broker/models/mssql/Xm.go
).
does local-prefix have same value as module in go.mod file?
Yes, it does.
With - Xm\.go$
and even - main\.go$
excluded I still get
Issues with:
broker/cmd/main.go 0%
::error file=broker/models/mssql/Xm.go,line=1::File test coverage below threshold of (70%)
::error file=broker/cmd/main.go,line=1::File test coverage below threshold of (70%)
I'm running go-test-coverage --config=./.testcoverage.yml
locally, even reinstalled it globally from scratch, and I know that the lib is reading the config file because changing the profile to ./foo.out
is throwing an error. But I can't figure out why override
and exclude
are misbehaving...
I might have to add that the folder I'm executing the command is a subfolder of a monorepo but that shouldn't matter AFAIK.
Repo looks like this
| repo-root/
|-- broker/ # go-test-coverage executed in this folder
|---- go.mod
|---- .testcoverage.yml
|---- cmd/
|---- models/
|-- other-service/
Edit: And maybe it's a MacOS 14.6.1 thing? Running the binary on M3.
And maybe it's a MacOS 14.6.1 thing
i am really not sure.
if you can clone repo and run it as source go run ./path-to-go-test-coverage/main.go --config=...
i think you can easily identify problem, and maybe open PR with a fix 💕.
everything happens here.
I'll try it on a minimal repo, plus from source, and report back. Thanks for the quick assessment 🙌
I'm trying to run the go-test-coverage but it constantly ignores my excluded paths/files.
./.testcoverage.yml
Command
Output
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:
What am I missing here?