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

test(gnovm): migrate 'gno build' test to testscript #1103

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

tbruyelle
Copy link
Contributor

@tbruyelle tbruyelle commented Sep 6, 2023

Like done for 'gno test', use testscript and txtar files to define the different test cases.

The previous test was only testing gno build without arguments and files, so this PR adds more cases.

Interestingly, the gno files are only used to determine the directories where the 'go build' command will be passed. This means only go file syntax is checked (gno file syntax is ignored, as pictured in invalid_gno_files.txtar case). Also a go.mod is required or else the command fails.

Like the previous test, the new test can be run via

$ go test ./gnovm/cmd/gno -v -run Build
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.

Like done for 'gno test', use testscript and txtar files to define the
different test cases.

The previous test was only testing `gno build` without arguments and
files, so this PR adds more cases.

Interestingly, the gno files are only used to determine the directories
where the 'go build' command will be passed. This means only go file
syntax is checked (gno file syntax is ignored, as pictured in
`invalid_gno_files.txtar' case). Also a `go.mod` is required or else the
command fails.
@tbruyelle tbruyelle requested a review from a team as a code owner September 6, 2023 14:54
@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Sep 6, 2023
@moul moul added this to the 💡Someday/Maybe milestone Sep 6, 2023
@moul
Copy link
Member

moul commented Oct 9, 2023

Related with #1215.

@thehowl thehowl merged commit eb27a8f into gnolang:master Oct 12, 2023
54 of 57 checks passed
gfanton pushed a commit to gfanton/gno that referenced this pull request Oct 20, 2023
Like done for 'gno test', use testscript and txtar files to define the
different test cases.

The previous test was only testing `gno build` without arguments and
files, so this PR adds more cases.

Interestingly, the gno files are only used to determine the directories
where the 'go build' command will be passed. This means only go file
syntax is checked (gno file syntax is ignored, as pictured in
`invalid_gno_files.txtar` case). Also a `go.mod` is required or else the
command fails.

Like the previous test, the new test can be run via

```
$ go test ./gnovm/cmd/gno -v -run Build
```

<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [x] 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
- [x] 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>
thehowl pushed a commit to thehowl/gno that referenced this pull request Oct 21, 2023
Like done for 'gno test', use testscript and txtar files to define the
different test cases.

The previous test was only testing `gno build` without arguments and
files, so this PR adds more cases.

Interestingly, the gno files are only used to determine the directories
where the 'go build' command will be passed. This means only go file
syntax is checked (gno file syntax is ignored, as pictured in
`invalid_gno_files.txtar` case). Also a `go.mod` is required or else the
command fails.

Like the previous test, the new test can be run via

```
$ go test ./gnovm/cmd/gno -v -run Build
```

<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [x] 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
- [x] 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>
gfanton pushed a commit to gfanton/gno that referenced this pull request Nov 9, 2023
Like done for 'gno test', use testscript and txtar files to define the
different test cases.

The previous test was only testing `gno build` without arguments and
files, so this PR adds more cases.

Interestingly, the gno files are only used to determine the directories
where the 'go build' command will be passed. This means only go file
syntax is checked (gno file syntax is ignored, as pictured in
`invalid_gno_files.txtar` case). Also a `go.mod` is required or else the
command fails.

Like the previous test, the new test can be run via

```
$ go test ./gnovm/cmd/gno -v -run Build
```

<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [x] 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
- [x] 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>
thehowl pushed a commit that referenced this pull request Nov 16, 2023
Closes: #1242

In favor of `gno precompile -gobuild`. 

As seen in the tests written for `gno build` in this PR #1103, the
command's behavior is kinda unexpected. It actually doesn't care about
the syntax of gno files and only relies on go files found in the path
passed as an argument.

Because of that, I chose to name the flag `-gobuild` instead of `-build`
because I found that represents better what's really happening when this
flag is provided.

As mentioned in the linked issue, `gno build` will be re-implemented in
the future with an other behavior.

<!-- 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>
@tbruyelle tbruyelle deleted the tbruyelle/test/gno-build branch February 22, 2024 12:20
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: 🔵 Not Needed for Launch
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants