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: add test case for remote connection flow #2647

Open
wants to merge 1 commit into
base: spr/main/94b908d4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading