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

Incorporating gno test into gnovm's Coverage Metrics #1145

Open
moul opened this issue Sep 18, 2023 · 4 comments
Open

Incorporating gno test into gnovm's Coverage Metrics #1145

moul opened this issue Sep 18, 2023 · 4 comments
Assignees
Labels
help wanted Want to contribute? We recommend these issues.

Comments

@moul
Copy link
Member

moul commented Sep 18, 2023

To enhance our coverage, we might consider writing a unit test that imports gnovm/cmd/gno and invokes the main() function using custom os.Args, rather than executing the generated binary. By adopting this approach, we can ensure comprehensive code coverage for all elements we test with .gno files on the filesystem.

Recent example: https://github.com/gnolang/gno/pull/1143/files#diff-0db317cbf7340addf668ab0f07d8daca6817b2e05b567f37a37e5c76ab6b3232R182
CleanShot 2023-09-18 at 15 45 07

Related with #1139
Related with #1117 (similar approach)

@moul moul changed the title Coverage of gnovm is not taking gnodev test into account Incorporating gnodev test into gnovm's Coverage Metrics Sep 18, 2023
@moul moul added the 🗺️good first issue🗺️ Ideal for newcomer contributors label Sep 18, 2023
@moul moul moved this to 🌟 Wanted for Launch in 🚀 The Launch [DEPRECATED] Sep 18, 2023
@moul moul added this to the 🌟 main.gno.land (wanted) milestone Sep 18, 2023
@moul
Copy link
Member Author

moul commented Sep 19, 2023

(temporarily) assign @gfanton, since he's working on a related project. Feel free to unassign.

@moul
Copy link
Member Author

moul commented Sep 19, 2023

Please be aware that we currently have two distinct gaps in our testing related to .gno files:

  1. Testing coverage for the .gno files themselves (gno test -cover ... #1121).
  2. Testing coverage for gnovm through the execution of .gno contracts (as highlighted in this issue).

CLI should look like this: go test ./gnovm/cmd/gno -run TestExamples/gno.land/r/demo/blog.

@moul
Copy link
Member Author

moul commented Oct 9, 2023

Related with #1215.

@moul moul moved this to Todo in 💪 Bounties & Worx Dec 22, 2023
@thehowl thehowl changed the title Incorporating gnodev test into gnovm's Coverage Metrics Incorporating gno test into gnovm's Coverage Metrics May 8, 2024
@Kouteki Kouteki moved this from Triage to Backlog in 🧙‍♂️gno.land core team May 10, 2024
thehowl pushed a commit that referenced this issue May 30, 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
<!-- 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]>
omarsy pushed a commit to TERITORI/gno that referenced this issue 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]>
@linear linear bot removed the 🗺️good first issue🗺️ Ideal for newcomer contributors label Sep 11, 2024
@zivkovicmilos zivkovicmilos added the help wanted Want to contribute? We recommend these issues. label Sep 12, 2024
@dongwon8247
Copy link
Member

Related with #2616

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Want to contribute? We recommend these issues.
Projects
Status: Todo
Status: Backlog
Development

No branches or pull requests

6 participants