chain-main
chain-main copied to clipboard
Problem: incorrect codecov reporting?
In https://codecov.io/gh/crypto-com/chain-main/tree/master/x/supply/keeper
it shows that only 13 lines are hit in querier.go
but with this test: https://github.com/crypto-com/chain-main/blob/master/integration_tests/test_basic.py#L64 -- it should be more (imports + NewQuerier path to types.QueryLiquidSupply + queryLiquidSupply) or does that test cover something else?
Strange: It shows that all the business logic is covered. But, the code that calls these keeper functions is uncovered? https://codecov.io/gh/crypto-org-chain/chain-main/src/master/x/supply/keeper/keeper.go
$ go test -v -coverprofile=size_coverage.out ./... && go tool cover -html=size_coverage.out
don't cover the New function in app/app.go. It's called in some unit tests like TestSubscriptionCollect.
@calvinaco 's codecov setup suggestion:
go test -race -coverprofile=coverage.txt -covermode=atomic
@calvinaco 's codecov setup suggestion:
go test -race -coverprofile=coverage.txt -covermode=atomic
I just tried this, didn't change the result.
upvote to fix this issue, accurate test coverage would help us to spot where the real weak points are
------details-----
as of commit bf3ce0d52c169d0780cf050e3bbb86dab07b30a1 when running make test
github.com/crypto-org-chain/chain-main/v1/app 0.930s coverage: 1.2% of statements github.com/crypto-org-chain/chain-main/v1/config 0.437s coverage: 83.3% of statements github.com/crypto-org-chain/chain-main/v1/x/subscription/keeper 0.913s coverage: 53.5% of statements github.com/crypto-org-chain/chain-main/v1/x/subscription/types 0.469s coverage: 6.1% of statements