Skip to content

Commit

Permalink
feat: add test case for remote connection flow
Browse files Browse the repository at this point in the history
commit-id:788df2c8
  • Loading branch information
nadin-Starkware committed Dec 9, 2024
1 parent 23c5ada commit c73fa0a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
45 changes: 42 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/starknet_integration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ infra_utils.workspace = true
itertools.workspace = true
pretty_assertions.workspace = true
rstest.workspace = true
serial_test.workspace = true
starknet_sequencer_infra.workspace = true
11 changes: 9 additions & 2 deletions crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use papyrus_protobuf::consensus::{
use papyrus_storage::test_utils::CHAIN_ID_FOR_TESTS;
use pretty_assertions::assert_eq;
use rstest::{fixture, rstest};
use serial_test::serial;
use starknet_api::block::{BlockHash, BlockNumber};
use starknet_api::transaction::TransactionHash;
use starknet_integration_tests::definitions::MockSystemMode;
Expand All @@ -34,13 +35,19 @@ fn tx_generator() -> MultiAccountTransactionGenerator {
}

#[rstest]
#[case::local_connection(MockSystemMode::Local)]
#[case::remote_connection(MockSystemMode::Remote)]
#[tokio::test]
async fn end_to_end(mut tx_generator: MultiAccountTransactionGenerator) {
#[serial]
async fn end_to_end(
mut tx_generator: MultiAccountTransactionGenerator,
#[case] mock_system_mode: MockSystemMode,
) {
const LISTEN_TO_BROADCAST_MESSAGES_TIMEOUT: std::time::Duration =
std::time::Duration::from_secs(5);
// Setup.
let mut mock_running_system =
FlowTestSetup::new_from_tx_generator(&tx_generator, MockSystemMode::Local).await;
FlowTestSetup::new_from_tx_generator(&tx_generator, mock_system_mode).await;

let next_height = INITIAL_HEIGHT.unchecked_next();
let heights_to_build = next_height.iter_up_to(LAST_HEIGHT.unchecked_next());
Expand Down

0 comments on commit c73fa0a

Please sign in to comment.