Skip to content

Commit 66ec65f

Browse files
committed
apollo_integration_tests: move common mod to end to end flow utils
1 parent f3b3784 commit 66ec65f

13 files changed

+70
-59
lines changed

crates/apollo_integration_tests/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ futures.workspace = true
6464
hex.workspace = true
6565
indexmap.workspace = true
6666
mempool_test_utils.workspace = true
67+
metrics-exporter-prometheus.workspace = true
6768
papyrus_base_layer = { workspace = true, features = ["testing"] }
69+
pretty_assertions.workspace = true
6870
serde.workspace = true
6971
serde_json.workspace = true
7072
starknet-types-core.workspace = true
@@ -83,9 +85,7 @@ apollo_l1_provider.workspace = true
8385
apollo_l1_provider_types = { workspace = true, features = ["testing"] }
8486
futures.workspace = true
8587
metrics.workspace = true
86-
metrics-exporter-prometheus.workspace = true
8788
mockall.workspace = true
88-
pretty_assertions.workspace = true
8989
rstest.workspace = true
9090

9191
[[bin]]

crates/apollo_integration_tests/tests/common/mod.rs renamed to crates/apollo_integration_tests/src/end_to_end_flow_utils.rs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
1-
// Each test module is compiled as a separate crate, and all can declare the common module.
2-
// This means that any peace of code in this module that is not used by *all* test modules will be
3-
// identified as unused code by clippy (for one of the crates).
4-
// TODO(Arni): Fix this.
5-
#![allow(dead_code)]
6-
71
use std::time::Duration;
82

93
use apollo_batcher::metrics::REVERTED_TRANSACTIONS;
104
use apollo_infra::trace_util::configure_tracing;
115
use apollo_infra_utils::test_utils::TestIdentifier;
12-
use apollo_integration_tests::flow_test_setup::{
13-
FlowSequencerSetup,
14-
FlowTestSetup,
15-
NUM_OF_SEQUENCERS,
16-
};
17-
use apollo_integration_tests::utils::{
6+
use metrics_exporter_prometheus::{PrometheusBuilder, PrometheusHandle};
7+
use pretty_assertions::assert_eq;
8+
use starknet_api::execution_resources::GasAmount;
9+
use starknet_api::transaction::TransactionHash;
10+
use tracing::info;
11+
12+
use crate::flow_test_setup::{FlowSequencerSetup, FlowTestSetup, NUM_OF_SEQUENCERS};
13+
use crate::utils::{
1814
create_flow_test_tx_generator,
1915
run_test_scenario,
2016
CreateL1ToL2MessagesArgsFn,
2117
CreateRpcTxsFn,
2218
TestTxHashesFn,
2319
};
24-
use metrics_exporter_prometheus::{PrometheusBuilder, PrometheusHandle};
25-
use pretty_assertions::assert_eq;
26-
use starknet_api::execution_resources::GasAmount;
27-
use starknet_api::transaction::TransactionHash;
28-
use tracing::info;
2920

3021
pub struct EndToEndFlowArgs {
3122
pub test_identifier: TestIdentifier,

crates/apollo_integration_tests/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pub mod end_to_end_flow_utils;
12
pub mod executable_setup;
23
pub mod flow_test_setup;
34
pub mod integration_test_manager;

crates/apollo_integration_tests/tests/bootstrap_declare.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
use apollo_infra_utils::test_utils::TestIdentifier;
2+
use apollo_integration_tests::end_to_end_flow_utils::{
3+
end_to_end_flow,
4+
test_single_tx,
5+
EndToEndFlowArgs,
6+
TestScenario,
7+
};
28
use mempool_test_utils::starknet_api_test_utils::generate_bootstrap_declare;
39
use starknet_api::execution_resources::GasAmount;
410

5-
use crate::common::{end_to_end_flow, test_single_tx, EndToEndFlowArgs, TestScenario};
6-
7-
mod common;
8-
911
fn create_bootstrap_declare_scenario() -> TestScenario {
1012
TestScenario {
1113
create_rpc_txs_fn: |_| vec![generate_bootstrap_declare()],

crates/apollo_integration_tests/tests/declare_tx_flow_test.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
use apollo_infra_utils::test_utils::TestIdentifier;
2+
use apollo_integration_tests::end_to_end_flow_utils::{
3+
end_to_end_flow,
4+
test_single_tx,
5+
EndToEndFlowArgs,
6+
TestScenario,
7+
};
28
use apollo_integration_tests::utils::ACCOUNT_ID_0;
39
use blockifier::bouncer::BouncerWeights;
410
use mempool_test_utils::starknet_api_test_utils::MultiAccountTransactionGenerator;
511
use starknet_api::rpc_transaction::RpcTransaction;
612

7-
use crate::common::{end_to_end_flow, test_single_tx, EndToEndFlowArgs, TestScenario};
8-
9-
mod common;
10-
1113
// Uses end_to_end_flow with test identifier EndToEndFlowTest and instance indices [0, 1, 2].
1214
/// Number of threads is 3 = Num of sequencer + 1 for the test thread.
1315
#[tokio::test(flavor = "multi_thread", worker_threads = 3)]

crates/apollo_integration_tests/tests/deploy_account_and_invoke_flow_test.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
use apollo_infra_utils::test_utils::TestIdentifier;
2+
use apollo_integration_tests::end_to_end_flow_utils::{
3+
end_to_end_flow,
4+
validate_tx_count,
5+
EndToEndFlowArgs,
6+
TestScenario,
7+
};
28
use apollo_integration_tests::utils::{
39
create_deploy_account_tx_and_invoke_tx,
410
UNDEPLOYED_ACCOUNT_ID,
@@ -7,10 +13,6 @@ use blockifier::bouncer::BouncerWeights;
713
use mempool_test_utils::starknet_api_test_utils::MultiAccountTransactionGenerator;
814
use starknet_api::rpc_transaction::RpcTransaction;
915

10-
use crate::common::{end_to_end_flow, validate_tx_count, EndToEndFlowArgs, TestScenario};
11-
12-
mod common;
13-
1416
// TODO(Meshi): Fail the test if no class have migrated.
1517
// Uses end_to_end_flow with test identifier EndToEndFlowTest and instance indices [3, 4, 5].
1618
/// Number of threads is 3 = Num of sequencer + 1 for the test thread.

crates/apollo_integration_tests/tests/funding_txs_flow_test.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
use apollo_infra_utils::test_utils::TestIdentifier;
2+
use apollo_integration_tests::end_to_end_flow_utils::{
3+
end_to_end_flow,
4+
test_single_tx,
5+
EndToEndFlowArgs,
6+
TestScenario,
7+
};
28
use apollo_integration_tests::utils::{ACCOUNT_ID_0, UNDEPLOYED_ACCOUNT_ID};
39
use blockifier::bouncer::BouncerWeights;
410
use mempool_test_utils::starknet_api_test_utils::MultiAccountTransactionGenerator;
511
use starknet_api::rpc_transaction::RpcTransaction;
612

7-
use crate::common::{end_to_end_flow, test_single_tx, EndToEndFlowArgs, TestScenario};
8-
9-
mod common;
10-
1113
// Uses end_to_end_flow with test identifier EndToEndFlowTest and instance indices [6, 7, 8].
1214
/// Number of threads is 3 = Num of sequencer + 1 for the test thread.
1315
#[tokio::test(flavor = "multi_thread", worker_threads = 3)]

crates/apollo_integration_tests/tests/l1_to_l2_message_flow_test.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
use apollo_infra_utils::test_utils::TestIdentifier;
2+
use apollo_integration_tests::end_to_end_flow_utils::{
3+
end_to_end_flow,
4+
test_single_tx,
5+
EndToEndFlowArgs,
6+
TestScenario,
7+
};
28
use apollo_integration_tests::utils::create_l1_to_l2_messages_args;
39
use blockifier::bouncer::BouncerWeights;
410

5-
use crate::common::{end_to_end_flow, test_single_tx, EndToEndFlowArgs, TestScenario};
6-
7-
mod common;
8-
911
// Uses end_to_end_flow with test identifier EndToEndFlowTest and instance indices [9, 10, 11].
1012
/// Number of threads is 3 = Num of sequencer + 1 for the test thread.
1113
#[tokio::test(flavor = "multi_thread", worker_threads = 3)]

crates/apollo_integration_tests/tests/multiple_account_txs_flow_test.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
use apollo_infra_utils::test_utils::TestIdentifier;
2+
use apollo_integration_tests::end_to_end_flow_utils::{
3+
end_to_end_flow,
4+
EndToEndFlowArgs,
5+
TestScenario,
6+
};
27
use apollo_integration_tests::utils::{ACCOUNT_ID_0, ACCOUNT_ID_1};
38
use blockifier::bouncer::BouncerWeights;
49
use mempool_test_utils::starknet_api_test_utils::MultiAccountTransactionGenerator;
510
use starknet_api::rpc_transaction::RpcTransaction;
611
use starknet_api::transaction::TransactionHash;
712

8-
use crate::common::{end_to_end_flow, EndToEndFlowArgs, TestScenario};
9-
10-
mod common;
11-
1213
// Uses end_to_end_flow with test identifier EndToEndFlowTest and instance indices [12, 13, 14].
1314
/// Number of threads is 3 = Num of sequencer + 1 for the test thread.
1415
#[tokio::test(flavor = "multi_thread", worker_threads = 3)]

crates/apollo_integration_tests/tests/reverted_l1_handler_tx_flow_test.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
use apollo_infra_utils::test_utils::TestIdentifier;
2+
use apollo_integration_tests::end_to_end_flow_utils::{
3+
end_to_end_flow,
4+
test_single_tx,
5+
EndToEndFlowArgs,
6+
TestScenario,
7+
};
28
use apollo_integration_tests::utils::create_l1_to_l2_messages_args;
39
use blockifier::bouncer::BouncerWeights;
410
use mempool_test_utils::starknet_api_test_utils::MultiAccountTransactionGenerator;
511
use starknet_api::transaction::L1HandlerTransaction;
612

7-
use crate::common::{end_to_end_flow, test_single_tx, EndToEndFlowArgs, TestScenario};
8-
9-
mod common;
10-
1113
/// Number of threads is 3 = Num of sequencer + 1 for the test thread.
1214
#[tokio::test(flavor = "multi_thread", worker_threads = 3)]
1315
async fn reverted_l1_handler_tx_flow() {

0 commit comments

Comments
 (0)