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

Gnovm: add consistency between testfiles instructions and -update-golden-tests flag #1015

Open
tbruyelle opened this issue Aug 1, 2023 · 0 comments
Labels
📦 🤖 gnovm Issues or PRs gnovm related 🌟 improvement performance improvements, refactors ...

Comments

@tbruyelle
Copy link
Contributor

Originated from #1010 (comment)

Description

When gno test -update-golden-test is executed for "*_filetest.gno" files, it writes the stdout below the // Output: instructions, and the content of the store below the // Realm: instruction.

For the // Error: instruction on the other hand, surprisingly, this doesn't work the same way. The -update-golden-test has no effect on the // Error: instruction. To fill it regarding the actual error, you have to write the // Error: instruction but without any following content. In that case, it will be filled with the actual error, with an additional message

// *** CHECK THE ERR MESSAGES ABOVE, MAKE SURE IT'S WHAT YOU EXPECTED, DELETE THIS LINE AND RUN TEST AGAIN ***

As @moul suggested, we need to add consistency over that, the better way is probably to replace the // Error: behavior which looks like an exception, with a behavior governed by the update-golden-test flag.

@tbruyelle tbruyelle added 📦 🤖 gnovm Issues or PRs gnovm related 🌟 improvement performance improvements, refactors ... labels Aug 1, 2023
tbruyelle added a commit to tbruyelle/gno that referenced this issue Aug 3, 2023
Add tests for Output, Error and Realm instructions

The change introduces a new test dependency
github.com/rogpeppe/go-internal/testscripts, which allows to create
tests bases on txtar files. This is very handy for this kind of tests,
because:
- you can easily creates a set of files that can be used for a command
  (here the `gno test` command)
- you can assert stderr and stdout expectations in a very readable and
  maintainable way
- you can compare files using the `cmp` command, which is very useful to
  assert of the `-update-golden-tests` behavior.

These tests were added to help work on gnolang#1015, which will potentially
alter the behavior of "*filetest.gno" instructions updates.
tbruyelle added a commit to tbruyelle/gno that referenced this issue Aug 3, 2023
Add tests for Output, Error and Realm instructions

The change introduces a new test dependency
github.com/rogpeppe/go-internal/testscripts, which allows to create
tests bases on txtar files. This is very handy for this kind of tests,
because:
- you can easily creates a set of files that can be used for a command
  (here the `gno test` command)
- you can assert stderr and stdout expectations in a very readable and
  maintainable way
- you can compare files using the `cmp` command, which is very useful to
  assert of the `-update-golden-tests` behavior.

These tests were added to help work on gnolang#1015, which will potentially
alter the behavior of "*filetest.gno" instructions updates.
tbruyelle added a commit to tbruyelle/gno that referenced this issue Aug 3, 2023
Add tests for Output, Error and Realm instructions

The change introduces a new test dependency
github.com/rogpeppe/go-internal/testscripts, which allows to create
tests bases on txtar files. This is very handy for this kind of tests,
because:
- you can easily creates a set of files that can be used for a command
  (here the `gno test` command)
- you can assert stderr and stdout expectations in a very readable and
  maintainable way
- you can compare files using the `cmp` command, which is very useful to
  assert of the `-update-golden-tests` behavior.

These tests were added to help work on gnolang#1015, which will potentially
alter the behavior of "*filetest.gno" instructions updates.
tbruyelle added a commit to tbruyelle/gno that referenced this issue Aug 4, 2023
Add tests for Output, Error and Realm instructions

The change introduces a new test dependency
github.com/rogpeppe/go-internal/testscripts, which allows to create
tests bases on txtar files. This is very handy for this kind of tests,
because:
- you can easily creates a set of files that can be used for a command
  (here the `gno test` command)
- you can assert stderr and stdout expectations in a very readable and
  maintainable way
- you can compare files using the `cmp` command, which is very useful to
  assert of the `-update-golden-tests` behavior.

These tests were added to help work on gnolang#1015, which will potentially
alter the behavior of "*filetest.gno" instructions updates.
tbruyelle added a commit to tbruyelle/gno that referenced this issue Aug 11, 2023
Add tests for Output, Error and Realm instructions

The change introduces a new test dependency
github.com/rogpeppe/go-internal/testscripts, which allows to create
tests bases on txtar files. This is very handy for this kind of tests,
because:
- you can easily creates a set of files that can be used for a command
  (here the `gno test` command)
- you can assert stderr and stdout expectations in a very readable and
  maintainable way
- you can compare files using the `cmp` command, which is very useful to
  assert of the `-update-golden-tests` behavior.

These tests were added to help work on gnolang#1015, which will potentially
alter the behavior of "*filetest.gno" instructions updates.
@thehowl thehowl changed the title Gnovm: add consistency between testfiles instructions and -update-golden-test flag Gnovm: add consistency between testfiles instructions and -update-golden-tests flag Aug 17, 2023
@moul moul added this to the 💡Someday/Maybe milestone Sep 6, 2023
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 🌟 improvement performance improvements, refactors ...
Projects
Status: 🔵 Not Needed for Launch
Development

No branches or pull requests

2 participants