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(cairo_native): compare the required starknet-native-compile version to workspace version #3975

Open
wants to merge 1 commit into
base: avi/fix-native-compiler-binary-crate
Choose a base branch
from

Conversation

avi-starkware
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@avi-starkware avi-starkware force-pushed the avi/test-required-native-compile-version branch from 933de4a to 47d8235 Compare February 5, 2025 13:16
@avi-starkware avi-starkware changed the title Compare the required starknet-native-compile version to workspace version test(cairo_native): compare the required starknet-native-compile version to workspace version Feb 5, 2025
@avi-starkware avi-starkware force-pushed the avi/fix-native-compiler-binary-crate branch from 902b823 to d9e3101 Compare February 5, 2025 13:18
@avi-starkware avi-starkware force-pushed the avi/test-required-native-compile-version branch from 47d8235 to 74c1876 Compare February 5, 2025 13:19
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 13 of 13 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @Itay-Tsabary-Starkware, and @noaov1)


crates/starknet_sierra_multicompile/Cargo.toml line 47 at r1 (raw file):

[[test]]
name = "cairo_native_version_test"
path = "tests/cairo_native_version_test.rs"

why not add src/constants_test.rs? separate test dir is usually for integration tests; code inside the test folder does not have access to code with cfg(test) also

Code quote:

[[test]]
name = "cairo_native_version_test"
path = "tests/cairo_native_version_test.rs"

@avi-starkware avi-starkware force-pushed the avi/test-required-native-compile-version branch from 74c1876 to 39db0a9 Compare February 5, 2025 16:03
@avi-starkware
Copy link
Collaborator Author

crates/starknet_sierra_multicompile/Cargo.toml line 47 at r1 (raw file):

Previously, dorimedini-starkware wrote…

why not add src/constants_test.rs? separate test dir is usually for integration tests; code inside the test folder does not have access to code with cfg(test) also

Done.

@avi-starkware avi-starkware force-pushed the avi/test-required-native-compile-version branch from 39db0a9 to 650bc73 Compare February 5, 2025 16:24
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @avi-starkware, @Itay-Tsabary-Starkware, and @noaov1)


crates/starknet_sierra_multicompile/src/lib.rs line 24 at r2 (raw file):

pub mod compile_test;

#[cfg(all(test, feature = "cairo_native"))]

not sure this is the correct gating... maybe cfg(test) here, and gate the test itself in the constants_test.rs file behind the feature?
the constants.rs is not in itself a cairo-native only module

Code quote:

#[cfg(all(test, feature = "cairo_native"))]

crates/starknet_sierra_multicompile/src/lib.rs line 26 at r2 (raw file):

#[cfg(all(test, feature = "cairo_native"))]
#[path = "constants_test.rs"]
pub mod constants_test;

I don't see this file in the PR, did you forget to add it?

Code quote:

#[cfg(all(test, feature = "cairo_native"))]
#[path = "constants_test.rs"]
pub mod constants_test;

crates/starknet_sierra_multicompile/src/compile_test.rs line 77 at r2 (raw file):

    let contract_class = get_test_contract();

    // TODO(Avi, 1/1/2025): Check size/memory/time limits.

what's this? related?

Code quote:

/ TODO(Avi, 1/1/2025): Check size/memory/time limit

@avi-starkware avi-starkware force-pushed the avi/test-required-native-compile-version branch from 650bc73 to 9ba8423 Compare February 5, 2025 20:38
Copy link
Collaborator Author

@avi-starkware avi-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 15 of 17 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware, @Itay-Tsabary-Starkware, and @noaov1)


crates/starknet_sierra_multicompile/src/compile_test.rs line 77 at r2 (raw file):

Previously, dorimedini-starkware wrote…

what's this? related?

It is just a stale TODO
I did the resource limits test somewhere else.


crates/starknet_sierra_multicompile/src/lib.rs line 24 at r2 (raw file):

Previously, dorimedini-starkware wrote…

not sure this is the correct gating... maybe cfg(test) here, and gate the test itself in the constants_test.rs file behind the feature?
the constants.rs is not in itself a cairo-native only module

Done.
We have to put everything in the file under the feature flag anyway, so it doesn't matter too much...


crates/starknet_sierra_multicompile/src/lib.rs line 26 at r2 (raw file):

Previously, dorimedini-starkware wrote…

I don't see this file in the PR, did you forget to add it?

Oops you are right

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Itay-Tsabary-Starkware and @noaov1)


crates/starknet_sierra_multicompile/src/lib.rs line 24 at r2 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

Done.
We have to put everything in the file under the feature flag anyway, so it doesn't matter too much...

well, yes, but in theory in the future you would have tests for the other constants, and then your #![cfg] will need to be more specific

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