Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(gnovm): improve gnovm/pkg/gnolang test coverage #2143

Merged
merged 5 commits into from
May 30, 2024

Conversation

mvertes
Copy link
Contributor

@mvertes mvertes commented May 17, 2024

No new tests have been added yet, but existing tests in gnovm/tests/files are now executed in the context of the package which contains the relevant interpreter virtual machine and parser code. We have now a better baseline to measure and complete the code coverage.

This represents more than 800 tests, which takes 10s on my macbook air m1. Those tests are actually run twice, as I haven't yet removed the original execution from gnovm/tests.

The testing code is substantially simplified compared to its counterpart in gnovm/tests, but has not yet been deduplicated. This will be done in further commits.

In gnovm/pkg/golang, go test -cover went from 34.2% to 66.7%.

Related to #1121, #1145 and probably more

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, if any. More info here.

No new tests have been added yet, but existing tests in
gnovm/tests/files are now executed in the context of the package which
contains the relevant interpreter virtual machine and parser code. We
have now a better baseline to measure and complete the code coverage.

This represents more than 800 tests, which takes 10s on my macbook air
m1. Those tests are actually run twice, as I haven't yet removed the
original execution from gnovm/tests.

The testing code is substantially simplified compared to its counterpart
in gnovm/tests, but has not yet been deduplicated. This will be done in
further commits.
@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label May 17, 2024
Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.62%. Comparing base (454ae2d) to head (a8df0d6).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2143      +/-   ##
==========================================
+ Coverage   49.97%   54.62%   +4.64%     
==========================================
  Files         578      578              
  Lines       77808    77808              
==========================================
+ Hits        38888    42501    +3613     
+ Misses      35796    32135    -3661     
- Partials     3124     3172      +48     
Flag Coverage Δ
gnovm 59.98% <100.00%> (+14.84%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mvertes mvertes changed the title fix: improve gnovm/pkg/gnolang test coverage from 34.2% to 66.7% fix: improve gnovm/pkg/gnolang test coverage May 17, 2024
Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

gnovm/pkg/gnolang/debugger_test.go Show resolved Hide resolved
mvertes added 2 commits May 30, 2024 17:44
No new tests have been added yet, but existing tests in
gnovm/tests/files are now executed in the context of the package which
contains the relevant interpreter virtual machine and parser code. We
have now a better baseline to measure and complete the code coverage.

This represents more than 800 tests, which takes 10s on my macbook air
m1. Those tests are actually run twice, as I haven't yet removed the
original execution from gnovm/tests.

The testing code is substantially simplified compared to its counterpart
in gnovm/tests, but has not yet been deduplicated. This will be done in
further commits.
@mvertes mvertes requested review from a team, gfanton, harry-hov and leohhhn as code owners May 30, 2024 15:47
@github-actions github-actions bot added 🧾 package/realm Tag used for new Realms or Packages. 📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels May 30, 2024
@thehowl
Copy link
Member

thehowl commented May 30, 2024

branch got screwed up 🤔

@mvertes
Copy link
Contributor Author

mvertes commented May 30, 2024

I did a rebase instead of just merging master, maybe the cause?

@thehowl
Copy link
Member

thehowl commented May 30, 2024

Yeah, I find that's generally the cause 😉

@thehowl thehowl changed the title fix: improve gnovm/pkg/gnolang test coverage test(gnovm): improve gnovm/pkg/gnolang test coverage May 30, 2024
@thehowl thehowl merged commit 9c60a23 into gnolang:master May 30, 2024
47 checks passed
omarsy pushed a commit to TERITORI/gno that referenced this pull request Jun 3, 2024
No new tests have been added yet, but existing tests in
gnovm/tests/files are now executed in the context of the package which
contains the relevant interpreter virtual machine and parser code. We
have now a better baseline to measure and complete the code coverage.

This represents more than 800 tests, which takes 10s on my macbook air
m1. Those tests are actually run twice, as I haven't yet removed the
original execution from gnovm/tests.

The testing code is substantially simplified compared to its counterpart
in gnovm/tests, but has not yet been deduplicated. This will be done in
further commits.

In `gnovm/pkg/golang`, `go test -cover` went from 34.2% to 66.7%.

Related to gnolang#1121, gnolang#1145 and probably more
<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [*] 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).
</details>

---------

Co-authored-by: Manfred Touron <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related 📦 🤖 gnovm Issues or PRs gnovm related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants