Skip to content

Commit

Permalink
chore(starknet_infra_utils): unify test util mods
Browse files Browse the repository at this point in the history
commit-id:3470ac8e
  • Loading branch information
Itay-Tsabary-Starkware committed Jan 15, 2025
1 parent 0da5cb3 commit 3ee1ee3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 23 deletions.
2 changes: 0 additions & 2 deletions crates/starknet_infra_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ pub mod path;
pub mod run_until;
pub mod tasks;
#[cfg(any(feature = "testing", test))]
pub mod test_identifiers;
#[cfg(any(feature = "testing", test))]
pub mod test_utils;
pub mod tracing;
pub mod type_name;
18 changes: 0 additions & 18 deletions crates/starknet_infra_utils/src/test_identifiers.rs

This file was deleted.

19 changes: 19 additions & 0 deletions crates/starknet_infra_utils/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ const _: () = {
);
};

#[derive(Debug, Copy, Clone)]
pub enum TestIdentifier {
EndToEndIntegrationTest,
EndToEndFlowTest,
MempoolSendsTxToOtherPeerTest,
MempoolReceivesTxFromOtherPeerTest,
}

impl From<TestIdentifier> for u16 {
fn from(variant: TestIdentifier) -> Self {
match variant {
TestIdentifier::EndToEndIntegrationTest => 0,
TestIdentifier::EndToEndFlowTest => 1,
TestIdentifier::MempoolSendsTxToOtherPeerTest => 2,
TestIdentifier::MempoolReceivesTxFromOtherPeerTest => 3,
}
}
}

#[derive(Debug)]
pub struct AvailablePorts {
current_port: u16,
Expand Down
7 changes: 5 additions & 2 deletions crates/starknet_integration_tests/src/sequencer_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ use starknet_api::rpc_transaction::RpcTransaction;
use starknet_api::state::StateNumber;
use starknet_api::transaction::TransactionHash;
use starknet_infra_utils::run_until::run_until;
use starknet_infra_utils::test_identifiers::TestIdentifier;
use starknet_infra_utils::test_utils::{AvailablePorts, MAX_NUMBER_OF_INSTANCES_PER_TEST};
use starknet_infra_utils::test_utils::{
AvailablePorts,
TestIdentifier,
MAX_NUMBER_OF_INSTANCES_PER_TEST,
};
use starknet_infra_utils::tracing::{CustomLogger, TraceLevel};
use starknet_sequencer_node::config::component_config::ComponentConfig;
use starknet_sequencer_node::config::component_execution_config::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use rstest::{fixture, rstest};
use starknet_api::block::{BlockHash, BlockNumber};
use starknet_api::rpc_transaction::RpcTransaction;
use starknet_api::transaction::TransactionHash;
use starknet_infra_utils::test_identifiers::TestIdentifier;
use starknet_infra_utils::test_utils::TestIdentifier;
use starknet_integration_tests::flow_test_setup::{FlowSequencerSetup, FlowTestSetup};
use starknet_integration_tests::utils::{
create_funding_txs,
Expand Down

0 comments on commit 3ee1ee3

Please sign in to comment.