chain-main icon indicating copy to clipboard operation
chain-main copied to clipboard

Problem: incorrect codecov reporting?

Open tomtau opened this issue 5 years ago • 5 comments

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?

tomtau avatar Nov 18 '20 01:11 tomtau

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

devashishdxt avatar Mar 09 '21 02:03 devashishdxt

$ 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.

yihuang avatar Mar 10 '21 01:03 yihuang

@calvinaco 's codecov setup suggestion:

go test -race -coverprofile=coverage.txt -covermode=atomic

tomtau avatar Mar 10 '21 01:03 tomtau

@calvinaco 's codecov setup suggestion:

go test -race -coverprofile=coverage.txt -covermode=atomic

I just tried this, didn't change the result.

yihuang avatar Mar 10 '21 02:03 yihuang

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

landanhu avatar Apr 06 '21 15:04 landanhu