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:28f1601a
  • Loading branch information
nadin-Starkware committed Dec 11, 2024
1 parent 7a3cf65 commit e3278dd
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 @@ futures.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 @@ -35,15 +36,21 @@ fn tx_generator() -> MultiAccountTransactionGenerator {
}

#[rstest]
#[case::local_connection(MockSystemMode::Local)]
#[case::remote_connection(MockSystemMode::Remote)]
#[tokio::test]
async fn end_to_end_flow(mut tx_generator: MultiAccountTransactionGenerator) {
#[serial]
async fn end_to_end_flow(
mut tx_generator: MultiAccountTransactionGenerator,
#[case] mock_system_mode: MockSystemMode,
) {
configure_tracing().await;

const LISTEN_TO_BROADCAST_MESSAGES_TIMEOUT: std::time::Duration =
std::time::Duration::from_secs(50);
// 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 e3278dd

Please sign in to comment.