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: various improvements on 'gnodev test' #223

Merged
merged 3 commits into from
May 29, 2022

Conversation

moul
Copy link
Member

@moul moul commented May 29, 2022

  • Move testrun.go into test.go because the file is still not too big and right now we've one file per subcommand
  • Integreted look and feel both of _filetest and _test?
  • Refactor codebase parts where it was not obvious what belongs to a filetest and same for test
  • Deduplicate code and make it easier to create testing gno.Machine
  • Support Using std.XXX (std.AssertOriginCall(),...) in tests
  • Write more unit tests

Continues #208, and this comment (#208 (comment)) by @anarcher


Example:

$ go run ./cmd/gnodev test ./examples/gno.land
?       ./examples/gno.land/p/avl       [no test files]
?       ./examples/gno.land/p/bank      [no test files]
?       ./examples/gno.land/p/dom       [no test files]
?       ./examples/gno.land/p/grc/grc20         [no test files]
?       ./examples/gno.land/p/grc/grc20/impl    [no test files]
?       ./examples/gno.land/p/grc/grc721        [no test files]
?       ./examples/gno.land/p/groups    [no test files]
?       ./examples/gno.land/p/maths     [no test files]
ok      ./examples/gno.land/p/rand      2.202855228s
?       ./examples/gno.land/p/releases  [no test files]
?       ./examples/gno.land/p/tests     [no test files]
?       ./examples/gno.land/p/testutils         [no test files]
?       ./examples/gno.land/p/ufmt      [no test files]
?       ./examples/gno.land/r/banktest  [no test files]
?       ./examples/gno.land/r/boards    [no test files]
ok      ./examples/gno.land/r/foo20     3.129722682s
?       ./examples/gno.land/r/nft       [no test files]
ok      ./examples/gno.land/r/releases-example  31.541257ms
?       ./examples/gno.land/r/tests     [no test files]
?       ./examples/gno.land/r/tests_foo         [no test files]
ok      ./examples/gno.land/r/users     37.831148714s
$
$ go run ./cmd/gnodev test ./examples/gno.land/p --verbose 
?       ./examples/gno.land/p/avl       [no test files]
?       ./examples/gno.land/p/bank      [no test files]
?       ./examples/gno.land/p/dom       [no test files]
?       ./examples/gno.land/p/grc/grc20         [no test files]
?       ./examples/gno.land/p/grc/grc20/impl    [no test files]
?       ./examples/gno.land/p/grc/grc721        [no test files]
?       ./examples/gno.land/p/groups    [no test files]
?       ./examples/gno.land/p/maths     [no test files]
=== RUN   TestInstance
--- PASS: TestInstance (667.506µs)
=== RUN   TestIntn
--- PASS: TestIntn (14.12614ms)
=== RUN   file/rand0_filetest.gno
--- PASS: file/rand0_filetest.gno (28.948863ms)
ok      ./examples/gno.land/p/rand      2.173592279s
?       ./examples/gno.land/p/releases  [no test files]
?       ./examples/gno.land/p/tests     [no test files]
?       ./examples/gno.land/p/testutils         [no test files]
?       ./examples/gno.land/p/ufmt      [no test files]
$

@moul moul self-assigned this May 29, 2022
@moul moul marked this pull request as ready for review May 29, 2022 15:01
moul added 2 commits May 29, 2022 15:12
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
@moul moul merged commit 3031755 into gnolang:master May 29, 2022
@moul moul deleted the dev/moul/gnodevtest branch May 29, 2022 15:40
@moul moul added this to the 🏗2️⃣ test2.gno.land milestone Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant