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

feat(starknet_integration_tests): end to end integration test as exec… #2598

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

lev-starkware
Copy link
Contributor

@lev-starkware lev-starkware commented Dec 9, 2024

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 63 lines in your changes missing coverage. Please review.

Project coverage is 35.00%. Comparing base (e3165c4) to head (736d6b5).
Report is 812 commits behind head on main.

Files with missing lines Patch % Lines
...et_integration_tests/src/end_to_end_integration.rs 0.00% 63 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2598      +/-   ##
==========================================
- Coverage   40.10%   35.00%   -5.11%     
==========================================
  Files          26      277     +251     
  Lines        1895    32227   +30332     
  Branches     1895    32227   +30332     
==========================================
+ Hits          760    11281   +10521     
- Misses       1100    19939   +18839     
- Partials       35     1007     +972     

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

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-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: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @lev-starkware)


crates/starknet_integration_tests/src/bin/e2e_integration_test.rs line 16 at r1 (raw file):

    // Run end to end integration test.
    end_to_end_integration(tx_generator).await;
}

Great!
Could you please also change the test in tests dir to directly invoke this executable?

Suggested way:

  1. Use create_shell_command to invoke the binary from within the test.
  2. To get its path, check https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates and look for CARGO_BIN_EXE_.

Going through the env variable should have twofold advantages:

  1. No need for messy dir traversals to find the test binary
  2. The doc mentions this way also builds the binary, so no need to do that manually:Binaries are automatically built when the test is built, unless the binary has required features that are not enabled.

Code quote:

#[tokio::main]
async fn main() {
    configure_tracing();
    info!("Running integration test setup.");

    // Creates a multi-account transaction generator for integration test
    let tx_generator = create_integration_test_tx_generator();

    // Run end to end integration test.
    end_to_end_integration(tx_generator).await;
}

Copy link
Contributor Author

@lev-starkware lev-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: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @Itay-Tsabary-Starkware)


crates/starknet_integration_tests/src/bin/e2e_integration_test.rs line 16 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Great!
Could you please also change the test in tests dir to directly invoke this executable?

Suggested way:

  1. Use create_shell_command to invoke the binary from within the test.
  2. To get its path, check https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates and look for CARGO_BIN_EXE_.

Going through the env variable should have twofold advantages:

  1. No need for messy dir traversals to find the test binary
  2. The doc mentions this way also builds the binary, so no need to do that manually:Binaries are automatically built when the test is built, unless the binary has required features that are not enabled.

Done.

@lev-starkware lev-starkware force-pushed the pr/lev-starkware/lev/e2e_integration/b8a2fdfb branch from c6ead48 to 9ea8d82 Compare December 10, 2024 14:43
@lev-starkware lev-starkware force-pushed the pr/lev-starkware/lev/e2e_integration/7a6dd4a7 branch from 5fd70eb to 154812d Compare December 10, 2024 14:43
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-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:

Reviewable status: 0 of 1 files reviewed, all discussions resolved

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-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 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @lev-starkware)

@lev-starkware lev-starkware force-pushed the pr/lev-starkware/lev/e2e_integration/7a6dd4a7 branch from 154812d to c613afd Compare December 10, 2024 15:09
@lev-starkware lev-starkware force-pushed the pr/lev-starkware/lev/e2e_integration/b8a2fdfb branch from 1e0c53d to 26d77c7 Compare December 10, 2024 15:29
@lev-starkware lev-starkware force-pushed the pr/lev-starkware/lev/e2e_integration/7a6dd4a7 branch from c613afd to 736d6b5 Compare December 10, 2024 15:29
@lev-starkware lev-starkware changed the title feat(starknet_integration_tests): end to end integration test as executable (not test) feat(starknet_integration_tests): end to end integration test as exec… Dec 10, 2024
@lev-starkware lev-starkware changed the base branch from pr/lev-starkware/lev/e2e_integration/b8a2fdfb to main December 10, 2024 15:44
@lev-starkware lev-starkware merged commit 22088d6 into main Dec 10, 2024
11 of 18 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants