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-infra][2/n] Replace Move's .exp tests with cargo-insta #21004

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

tnowacki
Copy link
Contributor

Description

  • Replaces the compiler's tests with the insta framework

Test plan

  • 👀

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):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@tnowacki tnowacki requested a review from a team January 30, 2025 03:32
Copy link

vercel bot commented Jan 30, 2025

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 Jan 30, 2025 3:46am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Jan 30, 2025 3:46am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Jan 30, 2025 3:46am

Copy link
Contributor

@tzakian tzakian left a comment

Choose a reason for hiding this comment

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

Changes look good to me, although I didn't go through every single snap file...

Just a couple little nits where things might be able to be cleaned up.

Comment on lines 227 to 232
_ if path_extension == MOVE_EXTENSION => None,
_ if path_extension == TEST_EXT => Some(TEST_EXT),
_ if path_extension == UNUSED_EXT => Some(UNUSED_EXT),
_ if path_extension == MIGRATION_EXT => Some(MIGRATION_EXT),
_ if path_extension == IDE_EXT => Some(IDE_EXT),
_ => panic!("Unknown extension: {}", path_extension.to_string_lossy()),
Copy link
Contributor

Choose a reason for hiding this comment

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

What about making this a match? Or is path_extension a path of some kinda and match doesn't like that? i.e., what about something like

let test_kind = match path_extension {
   MOVE_EXTENSION = NONE,
   x @ (TEST_EXT | UNUSED_EXT | MIGRATION_EXT | IDE_EXT) => Some(x),
   _ => panic!(...),
};

@@ -52,177 +66,236 @@ fn default_testing_addresses(flavor: Flavor) -> BTreeMap<String, NumericalAddres
.collect()
}

fn move_check_testsuite(path: &Path) -> datatest_stable::Result<()> {
// fn move_check_testsuite(path: &Path) -> datatest_stable::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can delete?

Comment on lines +277 to +282
let p;
let test_name = {
p = path.with_extension("");
assert!(p.extension().is_none());
p.file_name().unwrap().to_string_lossy()
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is equivalent to

let test_name = path.file_stem().unwrap().to_string_lossy().as_ref();

and that might be a bit cleaner?

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.

2 participants