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

chore: add challenges/time-simple.txtar #2100

Closed
wants to merge 10 commits into from

Conversation

jefft0
Copy link
Contributor

@jefft0 jefft0 commented May 14, 2024

This PR adds a new folder gno.land/cmd/gnoland/testdata/challenges . As the README explains, this is for tests which fail, and there is the "challenge" to fix the bug which causes the failure. The first challenge test is time-simple.txtar where addpkg fails to load a simple function which imports "time" (supposedly due to PR #1702). See the explanation in the test file for details.

To help run the "challenge" tests, this PR updates integration_test.go to add TestTestdataChallenges . This way we can run a test with go test -v . --run TestTestdataChallenges/time-simple . (Is this the right way to support the challenges folder?) There should be a way to exclude the challenges folder in normal testing.

@jefft0 jefft0 requested review from zivkovicmilos and a team as code owners May 14, 2024 10:30
@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label May 14, 2024
@jefft0 jefft0 requested a review from moul May 14, 2024 12:41
…TestdataChallenges. See the PR.

Signed-off-by: Jeff Thompson <[email protected]>
@jefft0 jefft0 force-pushed the chore/add-time-simple.txtar branch from fc81530 to ea3ec25 Compare May 14, 2024 12:44
Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 87.26899% with 62 lines in your changes are missing coverage. Please review.

Project coverage is 48.82%. Comparing base (d7c04be) to head (c797e6b).
Report is 8 commits behind head on master.

Files Patch % Lines
gnovm/tests/stdlibs/native.go 0.00% 22 Missing ⚠️
gnovm/pkg/gnolang/debugger.go 95.13% 12 Missing and 8 partials ⚠️
gnovm/stdlibs/std/banker.go 0.00% 12 Missing ⚠️
gnovm/tests/stdlibs/std/std.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2100      +/-   ##
==========================================
+ Coverage   47.00%   48.82%   +1.81%     
==========================================
  Files         578      579       +1     
  Lines       77571    78045     +474     
==========================================
+ Hits        36463    38106    +1643     
+ Misses      38074    36852    -1222     
- Partials     3034     3087      +53     
Flag Coverage Δ
contribs/gnodev 24.14% <ø> (ø)
contribs/gnofaucet 14.46% <ø> (ø)
contribs/gnokeykc 0.00% <ø> (ø)
contribs/gnomd 0.00% <ø> (ø)
gnovm 42.04% <87.26%> (+6.06%) ⬆️
misc/autocounterd 0.00% <ø> (ø)
misc/genproto 0.00% <ø> (ø)
misc/genstd 73.90% <ø> (ø)
misc/goscan 0.00% <ø> (ø)
misc/logos 17.68% <ø> (+0.30%) ⬆️
misc/loop 0.00% <ø> (ø)
tm2 54.01% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@thehowl
Copy link
Member

thehowl commented May 15, 2024

Fixed by #2105

We can add this as a normal txtar test; please remove the "Challenges" directory and test for now (I've talked with @gfanton on how to make a better "challenge" system and he'll tackle it)

@jefft0 jefft0 changed the title chore: Add challenges/time-simple.txtar. In integration_test, add TestTestdataChallenges chore: time-simple.txtar May 15, 2024
albttx and others added 9 commits May 15, 2024 10:38
<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>
…g#2090)

When refactoring CI files I moved examples.yml outside the workflows
folder. Move it back until we find a cleaner solution to test examples
using Go Tests.

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

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [x] Provided any useful hints for running manual tests
- [x] 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>

Signed-off-by: Antonio Navarro Perez <[email protected]>
<!-- Please provide a brief summary of your changes in the Title above
-->
# Previous & Related PR
gnolang#393 

# Description
## BREAKING CHANGE: banker will not use raw(input) denom for minting
Currently, there is a bug that additional coins are mintable using
banker.
Lots of discussing were made in gnolang#393, this PR include following.

1. It aims to use `pkg_path` that called (banker or Mint) as prefix for
denom(Similar to IBC Spec)
```
ibc_denom := 'ibc/' + hash('path' + 'base_denom')
denom_in_this_pr := '{pkg_path}:denom'
```

~2. As @piux2 mentioned
[here](gnolang#393 (comment))
currently gno has very inflexible format regexp for denom
-- Changed to same as Cosmos's regex, but without capitals~


~### is some issue about using `std.GetOrigCaller` or `std.PrevRealm`
Some of you might be wonder why I made some packaged called `istd`, I
made a issue: gnolang#876~
Update: After @thehowl's native binding PR, doesn't need this kind of
work around


## Contributors Checklist

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests

## Maintainers Checklist

- [ ] Checked that the author followed the guidelines in
`CONTRIBUTING.md`
- [ ] Checked the conventional-commit (especially PR title and verb,
presence of `BREAKING CHANGE:` in the body)
- [ ] Ensured that this PR is not a significant change or confirmed that
the review/consideration process was appropriate for the change

---------

Co-authored-by: Morgan <[email protected]>
<!-- please provide a detailed description of the changes made in this
pull request. -->

This PR aims to fix the `md` rendering issue when `plaintext` is summon
by marked.js / hljs. It just registers the `plaintext` module into
`hljs` js lib.

Fixes: gnolang#2084
Hotfix for the failing CI on master. Changes `cacheTypes`, `cacheNodes`
and `cacheNativeTypes` to be copies when forking the store, so that the
forked store doesn't modify its parent.

cc @zivkovicmilos
![gno-debug](https://github.com/gnolang/gno/assets/5792239/96c50686-df6c-4dd8-a1d1-63f787a9328d)

We provide here an embedded interactive debugger to let the user control
and inspect its program at symbolic level, with the same features and
commands as classical debuggers: gdb, lldb or delve.

The debugger is enabled by setting the `-debug` flag in `gno run`
command, which loads the target program and immediately shows a debugger
prompt on the console:

	$ gno run -debug /tmp/my-program.gno
	Welcome to the Gnovm debugger. Type 'help' for list of commands.
	dbg>

Providing `-debug-addr` flag allows to start a remote debugging session,
and not interfer with the program stdin and stdout. For example, in a
first terminal:

	$ gno run -debug-addr :4000 /tmp/my-program.gno
	Waiting for debugger client to connect at :4000

And in a second terminal, using a netcat like nc(1):

	$ nc localhost 4000
	Welcome to the Gnovm debugger. Type 'help' for list of commands.
	dbg>

The debugger works by intercepting each execution step at virtual
machine level (each iteration within `Machine.Run` loop) to a callback,
which in turns can provide a debugger command REPL or check if the
execution can proceed to the next step, etc.

The general logic and structure is there. It is possible to `continue`,
`stepi`, `detach`, `print`, `stack`, etc and get a general feedback of
the user experience and the impact on the code.

Efforts are made to make this feature minimally intrusive in the actual
VM, and not interfering when the debugger is not used.

It is planned shortly after this PR is integrated to add the capacity to
attach to an already running program, and to taylor the data format for
existing debugging environments such as VScode, etc, as demand arises.

Resolves gnolang/hackerspace#54

<!-- 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
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] 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>

---------

Co-authored-by: Morgan <[email protected]>
This PR contains an update to the Gno Network Public License, a fork of
the GNU Afferro General Public License with an additional clause
regarding "Strong Attribution".

Additionally, this PR does the following:

1. **Move the GNO (Network) Public License to the root directory.** \
Rationale: the current `LICENSE.md` files says that the directories are
covered by two different licenses; but doesn't cover licensing for
`examples` or any other files.
2. **Change all links from www.gnu.org to gno.land.**
3. **Remove references to the "Lesser" Public License,** as it simply
doesn't exist.
4. **Move tm2/LICENSE.md to tm2/LICENSE,** as it's formatted for plain
text.
5. **Format the license for Markdown,** on the model of the existing
Markdown version of the GNU GPL.

Review & approval by @jaekwon required.
<!-- Please provide a brief summary of your changes in the Title above
-->

# Description

Thanks to @albttx, we now have `std.PrevRealm` gnolang#667

However it seems like doesn't work on testcase(that can be run by `gno
test` command) as what we expected.
> `gno test` uses its own Context which makes few other functions (like
GetRealmPath) doesn't work neither.

So I made little helper very similar to `std.TestSetOrigCaller`

---
## Discussion Need
`std.TestSetOrigCaller` takes single parameter and two different type
can be passed
1. If `std.Address` type is passed, -> TestSetPrevRealm will take it as
user address => return user address not realm.
2. If `string` type is passed, -> TestSetPrevRealm will take it as
pkg_path => return pkg address(using bech32) and pkg_path
> Since string parameter is being used without any verification in this
pr, How about reusing verification logic from here
??https://github.com/gnolang/gno/blob/408fc68d4b3c189dbc6a608c590a86c661ae232a/tm2/pkg/std/memfile.go#L33-L68


## Contributors Checklist

- [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
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests

## Maintainers Checklist

- [x] Checked that the author followed the guidelines in
`CONTRIBUTING.md`
- [x] Checked the conventional-commit (especially PR title and verb,
presence of `BREAKING CHANGE:` in the body)
- [x] Ensured that this PR is not a significant change or confirmed that
the review/consideration process was appropriate for the change
@jefft0 jefft0 force-pushed the chore/add-time-simple.txtar branch from 73f0bf3 to c797e6b Compare May 15, 2024 08:38
@github-actions github-actions bot added 🧾 package/realm Tag used for new Realms or Packages. 📦 🤖 gnovm Issues or PRs gnovm related labels May 15, 2024
@github-actions github-actions bot added the 📦 🌐 tendermint v2 Issues or PRs tm2 related label May 15, 2024
@jefft0 jefft0 changed the title chore: time-simple.txtar chore: add challenges/time-simple.txtar May 15, 2024
@jefft0
Copy link
Contributor Author

jefft0 commented May 15, 2024

Closing this PR since it has a messy history. I opened a new PR #2111 .

@jefft0 jefft0 closed this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related 📦 🤖 gnovm Issues or PRs gnovm related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants