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

Customize statis initialize move dir in simtest #18752

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

halfprice
Copy link
Contributor

@halfprice halfprice commented Jul 21, 2024

Description

So that other projects can choose their own move package for this static initialization.

Test plan

How did you test the new or updated feature?


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Jul 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2024 6:19am

Copy link

vercel bot commented Jul 21, 2024

@halfprice is attempting to deploy a commit to the Mysten Labs Team on Vercel.

A member of the Team first needs to authorize it.

@halfprice halfprice force-pushed the zhewu/simtest-custom-move-dir branch from 2bc9ae6 to 1325d3d Compare July 22, 2024 05:19
@halfprice halfprice changed the title Customize statis initialize dir Customize statis initialize move dir in simtest Jul 22, 2024
@halfprice halfprice marked this pull request as ready for review July 23, 2024 07:17
Copy link
Contributor

@mlegner mlegner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR, this allows us to clean up the Walrus repo a bit. 😁

I will defer to @mystenmark for the final approval as I haven't really been involved in this repo before.

Comment on lines 60 to 61
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.extend(["..", "..", "examples", "move", "basics"]);
path.push(env!("SIMTEST_STATIC_INIT_MOVE"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a bit unintuitive to have the SIMTEST_STATIC_INIT_MOVE as a relative path although it's probably useful because it allows storing the files somewhere in the repo.
Can we make this clear from the variable name? For example, SIMTEST_STATIC_INIT_MOVE_RELATIVE_PATH, although that's really a mouthful... 🤷

Also, we could do something like env::var("...").unwrap_or("../../examples/move/basics"), then we don't have to set this explicitly in this repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mlegner and they all make sense! Seems taking Mark's suggestion to use absolute path is more intuitive. I didn't find a way to get the project root dir in rust, so right now I still set it in the script. It's also easy to test so that when we set it in walrus, we know it should work.

@@ -96,6 +96,10 @@ fi
# Must supply a new temp dir - the test is deterministic and can't choose one randomly itself.
export TMPDIR=$(mktemp -d)

# Set the example move package for the simtest static initializer
# https://github.com/MystenLabs/sui/blob/7bc276d534c6c758ac2cfefe96431c2b1318ca01/crates/sui-proc-macros/src/lib.rs#L52
export SIMTEST_STATIC_INIT_MOVE="../../examples/move/basics"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend using git rev-parse --show-toplevel to get the repo root, and then making this an absolute path

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

@halfprice halfprice enabled auto-merge (squash) July 24, 2024 06:21
@halfprice halfprice merged commit 25d2f30 into MystenLabs:main Jul 24, 2024
41 of 44 checks passed
Comment on lines +101 to +102
root_dir=$(git rev-parse --show-toplevel)
export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Put these into quotes to prevent potential issues with white spaces, etc.

Suggested change
root_dir=$(git rev-parse --show-toplevel)
export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics"
root_dir="$(git rev-parse --show-toplevel)"
export SIMTEST_STATIC_INIT_MOVE="$root_dir/examples/move/basics"

tx-tomcat pushed a commit to tx-tomcat/sui-network that referenced this pull request Jul 29, 2024
## Description 

So that other projects can choose their own move package for this static
initialization.

## Test plan 

How did you test the new or updated feature?

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
ebmifa added a commit that referenced this pull request Aug 15, 2024
## Description 
Set `SIMTEST_STATIC_INIT_MOVE` variable for Code Coverage due to
#18752

## Test plan 

https://github.com/MystenLabs/sui/actions/runs/10406180594/job/28818615076
tx-tomcat pushed a commit to tx-tomcat/sui-network that referenced this pull request Aug 27, 2024
suiwombat pushed a commit that referenced this pull request Sep 16, 2024
## Description 

So that other projects can choose their own move package for this static
initialization.

## Test plan 

How did you test the new or updated feature?

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
suiwombat pushed a commit that referenced this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants