gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source
https://gno.land/
Other
841 stars 342 forks source link

feat(coverage): Add back coverage support for `txtar` #2377

Open gfanton opened 1 week ago

gfanton commented 1 week ago

Add back coverage support for txtar, which was removed during the CI rework. This only includes txtar test files from gnovm package (not those for gnoland, I will do that in another PR). It adds approximately 5% coverage, which is a non-negligible.

Contributors' checklist... - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 59.75%. Comparing base (7b8a893) to head (5897fdb).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2377 +/- ## ========================================== + Coverage 54.63% 59.75% +5.12% ========================================== Files 582 546 -36 Lines 78401 73358 -5043 ========================================== + Hits 42832 43838 +1006 + Misses 32359 26199 -6160 - Partials 3210 3321 +111 ``` | [Flag](https://app.codecov.io/gh/gnolang/gno/pull/2377/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | Coverage Δ | | |---|---|---| | [contribs/gnodev](https://app.codecov.io/gh/gnolang/gno/pull/2377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `57.51% <ø> (+33.70%)` | :arrow_up: | | [contribs/gnofaucet](https://app.codecov.io/gh/gnolang/gno/pull/2377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `14.46% <ø> (ø)` | | | [gno.land](https://app.codecov.io/gh/gnolang/gno/pull/2377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `61.98% <ø> (ø)` | | | [gnovm](https://app.codecov.io/gh/gnolang/gno/pull/2377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `59.78% <ø> (+0.02%)` | :arrow_up: | | [gnovm/txtar](https://app.codecov.io/gh/gnolang/gno/pull/2377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `27.15% <ø> (?)` | | | [misc/genstd](https://app.codecov.io/gh/gnolang/gno/pull/2377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `73.90% <ø> (ø)` | | | [misc/logos](https://app.codecov.io/gh/gnolang/gno/pull/2377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `20.23% <ø> (+2.54%)` | :arrow_up: | | [tm2](https://app.codecov.io/gh/gnolang/gno/pull/2377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `62.03% <ø> (+7.57%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

gfanton commented 1 week ago

I don't think we actually lost coverage. I believe the reason why the gnovm flag coverage is decreasing by 20% is because enabling coverage on txtar also generates coverage for tm2 packages. Therefore, the gnovm directory itself has not lost coverage. However, by including tm2 packages in the gnovm flags, we cover 20% less than gnovm packages only.

Coverage with gnovm flags including txtar (from gnovm/cmd/gno): image

Coverage with gnovm flags excluding txtar (from gnovm/cmd/gno): image

gfanton commented 1 week ago

@ajnavarro An idea to avoid having gnovm flags "corrupted" by txtar coverage, is to put txtar coverage under its own flag, such as gnovm/txtar.

gfanton commented 1 week ago

@ajnavarro should be good now