tendermint / spn

A blockchain to launch blockchains.
Other
112 stars 43 forks source link

chore(ci/coverage): test all go packages and remove the non-testable files from coverage #996

Closed Pantani closed 1 year ago

Pantani commented 1 year ago

Description

If we have a package without test files (_test.go), the go test will exclude this package from the coverage. We should add the -coverpkg=./... to cover all packages. This PR also removes Go files autogenerated by the protobuf and, app and cmd packages from the coverage.

aljo242 commented 1 year ago

@Pantani this is sweet!! Do you think we can set something like this up for the CLI?

Looks like its just failing because there is no actual ./tests directory

codecov[bot] commented 1 year ago

Codecov Report

Merging #996 (af52c95) into main (a217c11) will increase coverage by 59.94%. The diff coverage is 100.00%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/tendermint/spn/pull/996/graphs/tree.svg?width=650&height=150&src=pr&token=GMSSU7SM3A&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint)](https://codecov.io/gh/tendermint/spn/pull/996?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint) ```diff @@ Coverage Diff @@ ## main #996 +/- ## =========================================== + Coverage 11.21% 71.16% +59.94% =========================================== Files 278 215 -63 Lines 60771 9416 -51355 =========================================== - Hits 6818 6701 -117 + Misses 53765 2545 -51220 + Partials 188 170 -18 ``` | [Impacted Files](https://codecov.io/gh/tendermint/spn/pull/996?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint) | Coverage Δ | | |---|---|---| | [pkg/types/validator\_set.go](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint#diff-cGtnL3R5cGVzL3ZhbGlkYXRvcl9zZXQuZ28=) | `92.30% <ø> (ø)` | | | [pkg/types/consensus\_state.go](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint#diff-cGtnL3R5cGVzL2NvbnNlbnN1c19zdGF0ZS5nbw==) | `100.00% <100.00%> (ø)` | | | [pkg/types/signature\_counts.go](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint#diff-cGtnL3R5cGVzL3NpZ25hdHVyZV9jb3VudHMuZ28=) | `100.00% <100.00%> (ø)` | | | [...articipation/client/cli/query\_total\_allocations.go](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint#diff-eC9wYXJ0aWNpcGF0aW9uL2NsaWVudC9jbGkvcXVlcnlfdG90YWxfYWxsb2NhdGlvbnMuZ28=) | `0.00% <0.00%> (-88.47%)` | :arrow_down: | | [...cipation/client/cli/query\_available\_allocations.go](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint#diff-eC9wYXJ0aWNpcGF0aW9uL2NsaWVudC9jbGkvcXVlcnlfYXZhaWxhYmxlX2FsbG9jYXRpb25zLmdv) | `0.00% <0.00%> (-88.47%)` | :arrow_down: | | [x/campaign/client/cli/query\_mainnet\_account.go](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint#diff-eC9jYW1wYWlnbi9jbGllbnQvY2xpL3F1ZXJ5X21haW5uZXRfYWNjb3VudC5nbw==) | `40.16% <0.00%> (-40.17%)` | :arrow_down: | | [x/launch/types/request\_content.go](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint#diff-eC9sYXVuY2gvdHlwZXMvcmVxdWVzdF9jb250ZW50Lmdv) | `91.66% <0.00%> (-8.34%)` | :arrow_down: | | [x/launch/simulation/store.go](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint#diff-eC9sYXVuY2gvc2ltdWxhdGlvbi9zdG9yZS5nbw==) | `58.46% <0.00%> (-7.09%)` | :arrow_down: | | [x/launch/types/msg\_trigger\_launch.go](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint#diff-eC9sYXVuY2gvdHlwZXMvbXNnX3RyaWdnZXJfbGF1bmNoLmdv) | `50.00% <0.00%> (-5.56%)` | :arrow_down: | | [x/launch/keeper/request.go](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint#diff-eC9sYXVuY2gva2VlcGVyL3JlcXVlc3QuZ28=) | `95.43% <0.00%> (-4.57%)` | :arrow_down: | | ... and [197 more](https://codecov.io/gh/tendermint/spn/pull/996/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tendermint) | |
Pantani commented 1 year ago

@Pantani this is sweet!! Do you think we can set something like this up for the CLI?

Looks like its just failing because there is no actual ./tests directory

fixed!! now we have the real coverage of the project. I will do the same on the CLI