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
880 stars 364 forks source link

Incorporating gno test into gnovm's Coverage Metrics #1145

Open moul opened 1 year ago

moul commented 1 year ago

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 https://github.com/gnolang/gno/issues/1139 Related with https://github.com/gnolang/gno/pull/1117 (similar approach)

moul commented 1 year ago

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

moul commented 1 year ago

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 (#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 commented 11 months ago

Related with https://github.com/gnolang/gno/issues/1215.

dongwon8247 commented 1 week ago

Related with #2616