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

feat: setup testscripts coverage #1249

Merged
merged 21 commits into from
Nov 7, 2023

Conversation

gfanton
Copy link
Member

@gfanton gfanton commented Oct 18, 2023

ref: #1243

Add coverage support for testscripts gnovm package (for now)

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.

@gfanton gfanton self-assigned this Oct 18, 2023
@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Oct 18, 2023
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fb06d0a) 47.68% compared to head (09ffba0) 55.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1249      +/-   ##
==========================================
+ Coverage   47.68%   55.73%   +8.05%     
==========================================
  Files         378      421      +43     
  Lines       63655    65555    +1900     
==========================================
+ Hits        30351    36538    +6187     
+ Misses      30845    26159    -4686     
- Partials     2459     2858     +399     

see 105 files with indirect coverage changes

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

@gfanton gfanton force-pushed the fix/txtar-gno-coverage branch 3 times, most recently from de19f77 to fb201db Compare October 18, 2023 16:20
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@gfanton gfanton changed the title wip: setup testscripts coverage feat: setup testscripts coverage Oct 18, 2023
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@gfanton gfanton marked this pull request as ready for review October 21, 2023 12:43
@gfanton gfanton requested a review from a team as a code owner October 21, 2023 12:43
gnovm/pkg/integration/gno.go Outdated Show resolved Hide resolved
gnovm/pkg/integration/gno.go Outdated Show resolved Hide resolved
@moul moul linked an issue Oct 23, 2023 that may be closed by this pull request
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@zivkovicmilos zivkovicmilos self-requested a review November 2, 2023 14:45
Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

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

Looks great 💯

I've left some minor style comments, otherwise we are ready to unlock the next phase of integration tests on gno 🚀

gnovm/pkg/integration/coverage.go Outdated Show resolved Hide resolved
gnovm/pkg/integration/coverage.go Outdated Show resolved Hide resolved
gnovm/pkg/integration/gno.go Outdated Show resolved Hide resolved
gnovm/pkg/integration/gno.go Show resolved Hide resolved
gnovm/pkg/integration/gno.go Outdated Show resolved Hide resolved
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
This reverts commit c37a331.

Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@gfanton gfanton merged commit a88e3e3 into gnolang:master Nov 7, 2023
185 checks passed
@gfanton gfanton deleted the fix/txtar-gno-coverage branch November 7, 2023 13:28
gfanton added a commit to gfanton/gno that referenced this pull request Nov 9, 2023
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
moul added a commit to moul/gno that referenced this pull request Nov 14, 2023
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
moul added a commit that referenced this pull request Dec 7, 2023
Addresses
gnoswap-labs#7 (comment)

CI is red -> related/depends on #1241, #1249 (cc @gfanton).

```console
$ go test -v . -run TestTestdata/grc20-registry
=== RUN   TestTestdata
=== RUN   TestTestdata/grc20-registry
=== PAUSE TestTestdata/grc20-registry
=== CONT  TestTestdata/grc20-registry
transfer from=g1sqt92sa06ugh8nlt98kyghw83qy84paf4csyh6 to=g123456789 some-amount
    testscript.go:534: WORK=$WORK
        PATH=/nix/store/xl220d87dlnq05kiz1pjqa9snhlvr1rs-go-1.20.8/share/go/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/moul/bin:/Users/moul/.nix-profile/bin:/etc/profiles/per-user/moul/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/moul/.local/bin:/Users/moul/.local/share/node_modules/bin:/Users/moul/go/bin:/Users/moul/.local/share/rust/cargo/bin:/Users/moul/.local/share/rust/rustup/bin:/Users/moul/.config/zsh/plugins/p10k-config
        GOTRACEBACK=system
        HOME=/no-home
        TMPDIR=$WORK/.tmp
        devnull=/dev/null
        /=/
        :=:
        $=$
        GOCOVERDIR=
        exe=
        USER_SEED_test1=source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast
        USER_ADDR_test1=g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5
        GNOROOT=/Users/moul/go/src/github.com/gnolang/gno
        GNOHOME=/var/folders/22/d9yt75bd2wv9sl3dm_lx85x80000gn/T/TestTestdata1289631443/001/gno
        
        # test for add package
        ## start a new node (1.390s)
        > gnoland start
        [stdout]
        node started successfully
        
        # add registry (0.466s)
        > gnokey maketx addpkg -pkgdir $WORK/registry -pkgpath gno.land/r/registry -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
        [stdout]
        
        OK!
        GAS WANTED: 2000000
        GAS USED:   274024
        
        [stderr]
        Enter password.
        
        # we call Transfer with foo20, before it's registered (0.454s)
        > gnokey maketx call -pkgpath gno.land/r/registry -func TransferByName -args 'foo20' -args 'g123456789' -args '42' -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
        [stdout]
        ("not found" string)
        OK!
        GAS WANTED: 2000000
        GAS USED:   73759
        
        [stderr]
        Enter password.
        
        > stdout 'not found'
        # add foo20, and foo20wrapper (0.936s)
        > gnokey maketx addpkg -pkgdir $WORK/foo20 -pkgpath gno.land/r/foo20 -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
        [stdout]
        
        OK!
        GAS WANTED: 2000000
        GAS USED:   196098
        
        [stderr]
        Enter password.
        
        > gnokey maketx addpkg -pkgdir $WORK/foo20wrapper -pkgpath gno.land/r/foo20wrapper -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
        [stdout]
        
        OK!
        GAS WANTED: 2000000
        GAS USED:   276276
        
        [stderr]
        Enter password.
        
        # we call Transfer with foo20, after it's registered (0.464s)
        > gnokey maketx call -pkgpath gno.land/r/registry -func TransferByName -args 'foo20' -args 'g123456789' -args '42' -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
        [stdout]
        ("same address, success!" string)
        OK!
        GAS WANTED: 2000000
        GAS USED:   132948
        
        [stderr]
        Enter password.
        
        > stdout 'same address, success!'
        PASS
        
--- PASS: TestTestdata (0.01s)
    --- PASS: TestTestdata/grc20-registry (4.09s)
PASS
ok  	github.com/gnolang/gno/gno.land/cmd/gnoland	(cached)
```

---------

Signed-off-by: moul <94029+moul@users.noreply.github.com>
Co-authored-by: Guilhem Fanton <8671905+gfanton@users.noreply.github.com>
Co-authored-by: Hariom Verma <hariom18599@gmail.com>
gfanton added a commit to moul/gno that referenced this pull request Jan 18, 2024
…ng#1262)

Addresses
gnoswap-labs#7 (comment)

CI is red -> related/depends on gnolang#1241, gnolang#1249 (cc @gfanton).

```console
$ go test -v . -run TestTestdata/grc20-registry
=== RUN   TestTestdata
=== RUN   TestTestdata/grc20-registry
=== PAUSE TestTestdata/grc20-registry
=== CONT  TestTestdata/grc20-registry
transfer from=g1sqt92sa06ugh8nlt98kyghw83qy84paf4csyh6 to=g123456789 some-amount
    testscript.go:534: WORK=$WORK
        PATH=/nix/store/xl220d87dlnq05kiz1pjqa9snhlvr1rs-go-1.20.8/share/go/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/moul/bin:/Users/moul/.nix-profile/bin:/etc/profiles/per-user/moul/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/moul/.local/bin:/Users/moul/.local/share/node_modules/bin:/Users/moul/go/bin:/Users/moul/.local/share/rust/cargo/bin:/Users/moul/.local/share/rust/rustup/bin:/Users/moul/.config/zsh/plugins/p10k-config
        GOTRACEBACK=system
        HOME=/no-home
        TMPDIR=$WORK/.tmp
        devnull=/dev/null
        /=/
        :=:
        $=$
        GOCOVERDIR=
        exe=
        USER_SEED_test1=source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast
        USER_ADDR_test1=g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5
        GNOROOT=/Users/moul/go/src/github.com/gnolang/gno
        GNOHOME=/var/folders/22/d9yt75bd2wv9sl3dm_lx85x80000gn/T/TestTestdata1289631443/001/gno
        
        # test for add package
        ## start a new node (1.390s)
        > gnoland start
        [stdout]
        node started successfully
        
        # add registry (0.466s)
        > gnokey maketx addpkg -pkgdir $WORK/registry -pkgpath gno.land/r/registry -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
        [stdout]
        
        OK!
        GAS WANTED: 2000000
        GAS USED:   274024
        
        [stderr]
        Enter password.
        
        # we call Transfer with foo20, before it's registered (0.454s)
        > gnokey maketx call -pkgpath gno.land/r/registry -func TransferByName -args 'foo20' -args 'g123456789' -args '42' -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
        [stdout]
        ("not found" string)
        OK!
        GAS WANTED: 2000000
        GAS USED:   73759
        
        [stderr]
        Enter password.
        
        > stdout 'not found'
        # add foo20, and foo20wrapper (0.936s)
        > gnokey maketx addpkg -pkgdir $WORK/foo20 -pkgpath gno.land/r/foo20 -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
        [stdout]
        
        OK!
        GAS WANTED: 2000000
        GAS USED:   196098
        
        [stderr]
        Enter password.
        
        > gnokey maketx addpkg -pkgdir $WORK/foo20wrapper -pkgpath gno.land/r/foo20wrapper -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
        [stdout]
        
        OK!
        GAS WANTED: 2000000
        GAS USED:   276276
        
        [stderr]
        Enter password.
        
        # we call Transfer with foo20, after it's registered (0.464s)
        > gnokey maketx call -pkgpath gno.land/r/registry -func TransferByName -args 'foo20' -args 'g123456789' -args '42' -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
        [stdout]
        ("same address, success!" string)
        OK!
        GAS WANTED: 2000000
        GAS USED:   132948
        
        [stderr]
        Enter password.
        
        > stdout 'same address, success!'
        PASS
        
--- PASS: TestTestdata (0.01s)
    --- PASS: TestTestdata/grc20-registry (4.09s)
PASS
ok  	github.com/gnolang/gno/gno.land/cmd/gnoland	(cached)
```

---------

Signed-off-by: moul <94029+moul@users.noreply.github.com>
Co-authored-by: Guilhem Fanton <8671905+gfanton@users.noreply.github.com>
Co-authored-by: Hariom Verma <hariom18599@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related
Projects
Status: 🌟 Wanted for Launch
Archived in project
Development

Successfully merging this pull request may close these issues.

Add coverage support for txtar
4 participants