-
Notifications
You must be signed in to change notification settings - Fork 16
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
Creating workspaces test suit #46
Conversation
…ctor` as the featured list is not going to grow beyond a dozen elements
Hi @frol, this is the WIP PR for workspaces tests. You can check the migrations issue which occurs if you self_upgrade with the same wasm code that is already deployed. |
Closes #35 |
@jaswinder6991 The issue you observe is related to Wasm binaries produced by Rust 1.70.0 being not compatible with nearcore runtime: Use the following [toolchain]
channel = "1.69.0" The test runs successfully when the contract is compiled with Rust 1.69: ![]() |
Hi @frol, thanks for your comment. I was just testing the case where wasm was not 1.69.0 so sort of a negative case. So for closing #35, is this PR enough? Should I add some more tests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are the remaining items for this PR to land:
- add CI workflow
- finalize the ergonomics (e.g.
cargo run --example devhub
is clearly not expected way to run tests, try makingcargo test
work) - check for the result, so it does not rely on human sitting there and reading the output, the test should check and pass if everything is good and fail otherwise
- As part of the test, download the production Wasm from mainnet (https://github.com/near/workspaces-rs#spooning---pulling-existing-state-and-contracts-from-mainnettestnet) and deploy it first, and compile the current version of the contract (https://github.com/near/workspaces-rs#compiling-contracts-during-test-time) as part of the test to deploy it and check migration goes well.
Hi @frol
Once I am done with the Gas fees issue, I will update the PR. Any help with the issue is updated. |
After multiple attempts to solve the below issue (mentioned here in more details.).
I have written a helper function to mimic compile_project functionality. It does not do error handling as well as the workspaces library but it is working. The reason of above issue produced by workspaces-rs version [0.7.0] is still unknown. However, the workspaces-rs current unreleased codebase do have updates for this function. We can switch to using workspaces-rs if we solve the issue in the future. For noe we continue with the helper function. |
…to setup-workspaces
…to setup-workspaces
tests/README.md
Outdated
### This subdirectory contains tests for the devhub smart contract. It uses workspaces-rs to create sandbox environment to deploy the contract and run tests. | ||
|
||
Use the below command to run the test. | ||
|
||
`` cargo test | ||
`` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this README formatting look nicer?
I am marking this PR as draft as CI still fails. |
The CI worked fine a few weeks ago. Now I am seeing the same Gas Exceeded Error for which I wrote the custom function. I will look into it again. However, can you think of a reason why self_upgrade would fail with prepaid gas exceeded error. |
The Prepaid Gas exceeded issue occured due to lack of gas assigned in self_upgrade function to code deployment and function execution. This PR solves it: #53 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaswinder6991 I had refactored some bits of the changes, please, review them for your future reference.
Resolves #35
wip PR for creating test suit using workspaces-rs