From 1cb6e57a12c774ff597bdb8ae1f7604ac64e2398 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Wed, 22 Oct 2025 18:36:21 +0200 Subject: [PATCH 1/5] Add partitioning logic --- crates/forge-runner/src/messages.rs | 14 ++- .../src/package_tests/with_config_resolved.rs | 3 +- crates/forge-runner/src/test_case_summary.rs | 16 +++- crates/forge/src/partition.rs | 51 ++++++++++- crates/forge/src/run_tests/package.rs | 55 ++++++++++-- crates/forge/src/run_tests/test_target.rs | 26 +++++- crates/forge/src/run_tests/workspace.rs | 89 +++++++++++++++---- crates/forge/test_utils/src/running_tests.rs | 1 + ...4_188_184_7070_rpc_v0_9_54060_v0_50_0.json | 1 + .../forge/tests/data/partitioning/Scarb.toml | 39 ++++++++ .../partitioning/crates/package_a/Scarb.toml | 10 +++ .../crates/package_a/src/lib.cairo | 19 ++++ .../crates/package_a/tests/tests.cairo | 9 ++ .../partitioning/crates/package_b/Scarb.toml | 10 +++ .../crates/package_b/src/lib.cairo | 18 ++++ .../crates/package_b/tests/tests.cairo | 9 ++ .../tests/data/partitioning/src/lib.cairo | 18 ++++ .../tests/data/partitioning/tests/tests.cairo | 15 ++++ crates/forge/tests/integration/setup_fork.rs | 2 + 19 files changed, 372 insertions(+), 33 deletions(-) create mode 100644 crates/forge/tests/data/forking/.snfoundry_cache/http___188_34_188_184_7070_rpc_v0_9_54060_v0_50_0.json create mode 100644 crates/forge/tests/data/partitioning/Scarb.toml create mode 100644 crates/forge/tests/data/partitioning/crates/package_a/Scarb.toml create mode 100644 crates/forge/tests/data/partitioning/crates/package_a/src/lib.cairo create mode 100644 crates/forge/tests/data/partitioning/crates/package_a/tests/tests.cairo create mode 100644 crates/forge/tests/data/partitioning/crates/package_b/Scarb.toml create mode 100644 crates/forge/tests/data/partitioning/crates/package_b/src/lib.cairo create mode 100644 crates/forge/tests/data/partitioning/crates/package_b/tests/tests.cairo create mode 100644 crates/forge/tests/data/partitioning/src/lib.cairo create mode 100644 crates/forge/tests/data/partitioning/tests/tests.cairo diff --git a/crates/forge-runner/src/messages.rs b/crates/forge-runner/src/messages.rs index 37eeced090..0f6f9e70c9 100644 --- a/crates/forge-runner/src/messages.rs +++ b/crates/forge-runner/src/messages.rs @@ -13,6 +13,7 @@ enum TestResultStatus { Failed, Ignored, Interrupted, + ExcludedFromPartition, } impl From<&AnyTestCaseSummary> for TestResultStatus { @@ -26,6 +27,10 @@ impl From<&AnyTestCaseSummary> for TestResultStatus { | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Ignored { .. }) => Self::Ignored, AnyTestCaseSummary::Single(TestCaseSummary::Interrupted { .. }) | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Interrupted { .. }) => Self::Interrupted, + AnyTestCaseSummary::Single(TestCaseSummary::ExcludedFromPartition { .. }) + | AnyTestCaseSummary::Fuzzing(TestCaseSummary::ExcludedFromPartition { .. }) => { + Self::ExcludedFromPartition + } } } } @@ -110,7 +115,9 @@ impl TestResultMessage { match self.status { TestResultStatus::Passed => return format!("\n\n{msg}"), TestResultStatus::Failed => return format!("\n\nFailure data:{msg}"), - TestResultStatus::Ignored | TestResultStatus::Interrupted => return String::new(), + TestResultStatus::Ignored + | TestResultStatus::Interrupted + | TestResultStatus::ExcludedFromPartition => return String::new(), } } String::new() @@ -124,6 +131,11 @@ impl TestResultMessage { TestResultStatus::Interrupted => { unreachable!("Interrupted tests should not have visible message representation") } + TestResultStatus::ExcludedFromPartition => { + unreachable!( + "Tests excluded from partition should not have visible message representation" + ) + } } } } diff --git a/crates/forge-runner/src/package_tests/with_config_resolved.rs b/crates/forge-runner/src/package_tests/with_config_resolved.rs index 11597441ff..3e850c84d5 100644 --- a/crates/forge-runner/src/package_tests/with_config_resolved.rs +++ b/crates/forge-runner/src/package_tests/with_config_resolved.rs @@ -13,7 +13,8 @@ pub type TestTargetWithResolvedConfig = TestTarget; pub type TestCaseWithResolvedConfig = TestCase; -fn sanitize_test_case_name(name: &str) -> String { +#[must_use] +pub fn sanitize_test_case_name(name: &str) -> String { // Test names generated by `#[test]` and `#[fuzzer]` macros contain internal suffixes name.replace("__snforge_internal_test_generated", "") .replace("__snforge_internal_fuzzer_generated", "") diff --git a/crates/forge-runner/src/test_case_summary.rs b/crates/forge-runner/src/test_case_summary.rs index 980b884982..dac9f2dfb7 100644 --- a/crates/forge-runner/src/test_case_summary.rs +++ b/crates/forge-runner/src/test_case_summary.rs @@ -128,6 +128,8 @@ pub enum TestCaseSummary { }, /// Test case skipped due to exit first or execution interrupted, test result is ignored. Interrupted {}, + /// Test case excluded from current partition + ExcludedFromPartition {}, } #[derive(Debug)] @@ -145,7 +147,9 @@ impl TestCaseSummary { TestCaseSummary::Failed { name, .. } | TestCaseSummary::Passed { name, .. } | TestCaseSummary::Ignored { name, .. } => Some(name), - TestCaseSummary::Interrupted { .. } => None, + TestCaseSummary::Interrupted { .. } | TestCaseSummary::ExcludedFromPartition { .. } => { + None + } } } @@ -227,6 +231,7 @@ impl TestCaseSummary { }, TestCaseSummary::Ignored { name } => TestCaseSummary::Ignored { name: name.clone() }, TestCaseSummary::Interrupted {} => TestCaseSummary::Interrupted {}, + TestCaseSummary::ExcludedFromPartition {} => TestCaseSummary::ExcludedFromPartition {}, } } } @@ -454,6 +459,15 @@ impl AnyTestCaseSummary { | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Ignored { .. }) ) } + + #[must_use] + pub fn is_excluded_from_partition(&self) -> bool { + matches!( + self, + AnyTestCaseSummary::Single(TestCaseSummary::ExcludedFromPartition { .. }) + | AnyTestCaseSummary::Fuzzing(TestCaseSummary::ExcludedFromPartition { .. }) + ) + } } #[cfg(test)] diff --git a/crates/forge/src/partition.rs b/crates/forge/src/partition.rs index 1540c37a5d..60263d4132 100644 --- a/crates/forge/src/partition.rs +++ b/crates/forge/src/partition.rs @@ -1,13 +1,16 @@ +use cairo_lang_sierra::ids::FunctionId; +use forge_runner::package_tests::with_config_resolved::sanitize_test_case_name; use serde::Serialize; use std::{collections::HashMap, str::FromStr}; +use crate::run_tests::package::RunForPackageArgs; + #[derive(Debug, Clone, Copy, Serialize)] pub struct Partition { index: usize, total: usize, } -#[allow(dead_code)] // TODO: Removed in later PRs impl Partition { #[must_use] pub fn index(&self) -> usize { @@ -47,15 +50,57 @@ impl FromStr for Partition { #[derive(Serialize)] pub struct TestPartitionMap(HashMap); +impl TestPartitionMap { + pub fn get(&self, test_name: &str) -> Option<&usize> { + self.0.get(test_name) + } + + pub fn insert(&mut self, test_name: String, partition_index: usize) { + self.0.insert(test_name, partition_index); + } + + pub fn from_packages_args(packages_args: &[RunForPackageArgs], partition: Partition) -> Self { + let mut full_paths: Vec = packages_args + .iter() + .flat_map(|pkg| pkg.test_targets.iter()) + .flat_map(|tt| { + tt.sierra_program + .debug_info + .as_ref() + .and_then(|info| info.executables.get("snforge_internal_test_executable")) + .into_iter() + .flatten() + }) + .filter_map(|fid: &FunctionId| { + fid.debug_name + .as_ref() + .map(std::string::ToString::to_string) + }) + .collect(); + + full_paths.sort(); + + let total = partition.total(); + let mut mapping = HashMap::with_capacity(full_paths.len()); + + for (i, path) in full_paths.into_iter().enumerate() { + let partition_index_1_based = (i % total) + 1; + mapping.insert(sanitize_test_case_name(&path), partition_index_1_based); + } + + Self(mapping) + } +} + #[derive(Serialize)] pub struct PartitionConfig { partition: Partition, test_partition_map: TestPartitionMap, } -#[allow(dead_code)] // TODO: Removed in later PRs impl PartitionConfig { - pub fn new(partition: Partition, test_partition_map: TestPartitionMap) -> Self { + pub fn new(partition: Partition, packages_args: &[RunForPackageArgs]) -> Self { + let test_partition_map = TestPartitionMap::from_packages_args(packages_args, partition); Self { partition, test_partition_map, diff --git a/crates/forge/src/run_tests/package.rs b/crates/forge/src/run_tests/package.rs index dbf05e5962..f1b3dbf3ff 100644 --- a/crates/forge/src/run_tests/package.rs +++ b/crates/forge/src/run_tests/package.rs @@ -6,6 +6,7 @@ use crate::{ TestArgs, block_number_map::BlockNumberMap, combine_configs::combine_configs, + partition::PartitionConfig, run_tests::messages::{ collected_tests_count::CollectedTestsCountMessage, tests_run::TestsRunMessage, tests_summary::TestsSummaryMessage, @@ -28,7 +29,11 @@ use configuration::load_package_config; use console::Style; use forge_runner::{ forge_config::ForgeConfig, - package_tests::{raw::TestTargetRaw, with_config_resolved::TestTargetWithResolvedConfig}, + package_tests::{ + TestCase, TestTarget, + raw::TestTargetRaw, + with_config_resolved::{TestCaseResolvedConfig, TestTargetWithResolvedConfig}, + }, running::with_config::test_target_with_config, test_case_summary::AnyTestCaseSummary, test_target_summary::TestTargetSummary, @@ -163,8 +168,34 @@ async fn test_package_with_config_resolved( Ok(test_targets_with_resolved_config) } -fn sum_test_cases(test_targets: &[TestTargetWithResolvedConfig]) -> usize { - test_targets.iter().map(|tc| tc.test_cases.len()).sum() +fn sum_test_cases_from_package( + test_targets: &[TestTarget], + partition_config: Option<&PartitionConfig>, +) -> usize { + test_targets + .iter() + .map(|tt| sum_test_cases_from_test_target(tt.test_cases.clone(), partition_config)) + .sum() +} + +fn sum_test_cases_from_test_target( + test_cases: Vec>, + partition_config: Option<&PartitionConfig>, +) -> usize { + if let Some(partition_config) = partition_config { + test_cases + .into_iter() + .filter(|test_case| { + partition_config.partition().index() + == *partition_config + .test_partition_map() + .get(&test_case.name) + .expect("Test case name not found in partitions mapping") + }) + .count() + } else { + test_cases.len() + } } #[tracing::instrument(skip_all, level = "debug")] @@ -177,6 +208,7 @@ pub async fn run_for_package( package_name, }: RunForPackageArgs, block_number_map: &mut BlockNumberMap, + partition_config: Option<&PartitionConfig>, ui: Arc, ) -> Result { let mut test_targets = test_package_with_config_resolved( @@ -187,7 +219,7 @@ pub async fn run_for_package( &tests_filter, ) .await?; - let all_tests = sum_test_cases(&test_targets); + let all_tests = sum_test_cases_from_package(&test_targets, partition_config); for test_target in &mut test_targets { tests_filter.filter_tests(&mut test_target.test_cases)?; @@ -196,7 +228,8 @@ pub async fn run_for_package( warn_if_available_gas_used_with_incompatible_scarb_version(&test_targets, &ui)?; warn_if_incompatible_rpc_version(&test_targets, ui.clone()).await?; - let not_filtered = sum_test_cases(&test_targets); + let not_filtered = sum_test_cases_from_package(&test_targets, partition_config); + ui.println(&CollectedTestsCountMessage { tests_num: not_filtered, package_name: package_name.clone(), @@ -208,11 +241,17 @@ pub async fn run_for_package( let ui = ui.clone(); ui.println(&TestsRunMessage::new( test_target.tests_location, - test_target.test_cases.len(), + sum_test_cases_from_test_target(test_target.test_cases.clone(), partition_config), )); - let summary = - run_for_test_target(test_target, forge_config.clone(), &tests_filter, ui).await?; + let summary = run_for_test_target( + test_target, + forge_config.clone(), + &tests_filter, + partition_config, + ui, + ) + .await?; match summary { TestTargetRunResult::Ok(summary) => { diff --git a/crates/forge/src/run_tests/test_target.rs b/crates/forge/src/run_tests/test_target.rs index e03e6d874e..c89196c6f1 100644 --- a/crates/forge/src/run_tests/test_target.rs +++ b/crates/forge/src/run_tests/test_target.rs @@ -1,3 +1,4 @@ +use crate::partition::PartitionConfig; use anyhow::Result; use forge_runner::messages::TestResultMessage; use forge_runner::{ @@ -25,6 +26,7 @@ pub async fn run_for_test_target( tests: TestTargetWithResolvedConfig, forge_config: Arc, tests_filter: &impl TestCaseFilter, + partition_config: Option<&PartitionConfig>, ui: Arc, ) -> Result { let casm_program = tests.casm_program.clone(); @@ -40,6 +42,28 @@ pub async fn run_for_test_target( for case in tests.test_cases { let case_name = case.name.clone(); + if let Some(partition_config) = &partition_config { + let test_partition = partition_config + .test_partition_map() + .get(&case.name) + .unwrap_or_else(|| { + unreachable!( + "Test '{}' should have been mapped to a partition", + case.name + ) + }); + let should_run_in_partition = *test_partition == partition_config.partition().index(); + + if !should_run_in_partition { + tasks.push(tokio::task::spawn(async { + Ok(AnyTestCaseSummary::Single( + TestCaseSummary::ExcludedFromPartition {}, + )) + })); + continue; + } + } + if !tests_filter.should_be_run(&case) { tasks.push(tokio::task::spawn(async { // TODO TestCaseType should also be encoded in the test case definition @@ -68,7 +92,7 @@ pub async fn run_for_test_target( while let Some(task) = tasks.next().await { let result = task??; - if !result.is_interrupted() { + if !result.is_interrupted() && !result.is_excluded_from_partition() { let test_result_message = TestResultMessage::new( &result, forge_config.output_config.detailed_resources, diff --git a/crates/forge/src/run_tests/workspace.rs b/crates/forge/src/run_tests/workspace.rs index 2442deec0c..40c87dd5c9 100644 --- a/crates/forge/src/run_tests/workspace.rs +++ b/crates/forge/src/run_tests/workspace.rs @@ -1,7 +1,9 @@ use super::package::RunForPackageArgs; +use crate::partition::PartitionConfig; use crate::profile_validation::check_profile_compatibility; use crate::run_tests::messages::latest_blocks_numbers::LatestBlocksNumbersMessage; use crate::run_tests::messages::overall_summary::OverallSummaryMessage; +use crate::run_tests::messages::partition::PartitionMessage; use crate::run_tests::messages::tests_failure_summary::TestsFailureSummaryMessage; use crate::warn::{ error_if_snforge_std_deprecated_missing, error_if_snforge_std_deprecated_not_compatible, @@ -29,6 +31,7 @@ use std::env; use std::sync::Arc; #[tracing::instrument(skip_all, level = "debug")] +#[expect(clippy::too_many_lines)] pub async fn run_for_workspace(args: TestArgs, ui: Arc) -> Result { match args.color { // SAFETY: This runs in a single-threaded environment. @@ -94,31 +97,66 @@ pub async fn run_for_workspace(args: TestArgs, ui: Arc) -> Result>>()?; + + let partition_config = PartitionConfig::new(*partition, &packages_args); + + for (package, args) in packages.iter().zip(packages_args) { + env::set_current_dir(&package.root)?; + + let result = run_for_package( + args, + &mut block_number_map, + Some(&partition_config), + ui.clone(), + ) + .await?; + + let filtered = result.filtered(); + all_tests.extend(result.summaries()); + + total_filtered_count = calculate_total_filtered_count(total_filtered_count, filtered); + } + } else { + for package in packages { + env::set_current_dir(&package.root)?; - let args = RunForPackageArgs::build( - package, - &scarb_metadata, - &args, - &cache_dir, - &artifacts_dir_path, - &ui, - )?; + let args = RunForPackageArgs::build( + package, + &scarb_metadata, + &args, + &cache_dir, + &artifacts_dir_path, + &ui, + )?; - let result = run_for_package(args, &mut block_number_map, ui.clone()).await?; + let result = run_for_package(args, &mut block_number_map, None, ui.clone()).await?; - let filtered = result.filtered(); - all_tests.extend(result.summaries()); + let filtered = result.filtered(); + all_tests.extend(result.summaries()); - // Accumulate filtered test counts across packages. When using --exact flag, - // result.filtered_count is None, so total_filtered_count becomes None too. - total_filtered_count = total_filtered_count - .zip(filtered) - .map(|(total, filtered)| total + filtered); + total_filtered_count = calculate_total_filtered_count(total_filtered_count, filtered); + } } let overall_summary = OverallSummaryMessage::new(&all_tests, total_filtered_count); + let all_failed_tests: Vec = extract_failed_tests(all_tests).collect(); FailedTestsCache::new(&cache_dir).save_failed_tests(&all_failed_tests)?; @@ -138,6 +176,10 @@ pub async fn run_for_workspace(args: TestArgs, ui: Arc) -> Result) -> Result, + filtered: Option, +) -> Option { + // Accumulate filtered test counts across packages. When using `--exact` flag, + // `result.filtered_count` is None, so `total_filtered_count` becomes None too. + total_filtered_count + .zip(filtered) + .map(|(total, filtered)| total + filtered) +} + #[tracing::instrument(skip_all, level = "debug")] fn extract_failed_tests( tests_summaries: Vec, diff --git a/crates/forge/test_utils/src/running_tests.rs b/crates/forge/test_utils/src/running_tests.rs index 5047677194..cea7a9e55f 100644 --- a/crates/forge/test_utils/src/running_tests.rs +++ b/crates/forge/test_utils/src/running_tests.rs @@ -86,6 +86,7 @@ pub fn run_test_case( fork_targets: vec![], }, &mut BlockNumberMap::default(), + None, ui, )) .expect("Runner fail") diff --git a/crates/forge/tests/data/forking/.snfoundry_cache/http___188_34_188_184_7070_rpc_v0_9_54060_v0_50_0.json b/crates/forge/tests/data/forking/.snfoundry_cache/http___188_34_188_184_7070_rpc_v0_9_54060_v0_50_0.json new file mode 100644 index 0000000000..a8d83c7aad --- /dev/null +++ b/crates/forge/tests/data/forking/.snfoundry_cache/http___188_34_188_184_7070_rpc_v0_9_54060_v0_50_0.json @@ -0,0 +1 @@ +{"cache_version":"0_50_0","storage_at":{"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9":{"0x206f38f7e4f15e87567361213c28f235cccdaa1d7fd34c9db1dfe9489c6a091":"0x14d"}},"nonce_at":{},"class_hash_at":{"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9":"0x6a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550"},"compiled_contract_class":{"0x6a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550":{"sierra_program":["0x1","0x3","0x0","0x2","0x1","0x0","0xff","0x1","0x23","0x52616e6765436865636b","0x0","0x4761734275696c74696e","0x66656c74323532","0x4172726179","0x1","0x2","0x536e617073686f74","0x3","0x537472756374","0x1baeba72e79e9db2587cf44fedb2f3700b2075a5e8e39a562584862c4b71f62","0x4","0x2ee1e2b1b89f8c495f200e4956278a4d47395fe262f27b52e5865c9524c08c3","0x456e756d","0x11c6d8087e00642489f92d2821ad6ebd6532ad1a3b6d12833da6d6810391511","0x6","0x753332","0x53797374656d","0x16a4c8d7c05909052238a862d8cc3e7975bf05a07b3a69c6b28951083a6d672","0xa","0x5","0x9931c641b913035ae674b400b61a51476d506bbe8bba2ff8a6272790aba9e6","0xc","0xb","0x4275696c74696e436f737473","0x117f8dd6812873d3aeeacdfe88181a6eb024b50a122679c11870b3b47a1ec88","0x5af52ee38c32146750e2728e3556e24468de85c9684e8215a6a54f774a0eb9","0xf","0x10","0x3a44698eeaa62b837a805b0dfc46b2c1e4f013d3acf9b3c68ff14f08abc709","0x11","0x10203be321c62a7bd4c060d69539c1fbe065baa9e253c74d2cc48be163e259","0x13","0xcc5e86243f861d2d64b08c35db21013e773ac5cf10097946fe0011304886d5","0x15","0x17b6ecc31946835b0d9d92c2dd7a9c14f29af0371571ae74a1b228828b2242","0x17","0x34f9bd7c6cb2dd4263175964ad75f1ff1461ddc332fbfb274e0fb2a5d7ab968","0x18","0x426f78","0x29d7d57c04a880978e7b3689f6218e507f3be17588744b58dc17762447ad0e7","0x1a","0x123a1e81adcc5bd99f099d588eab8cc3de808fcdce58bd37e7e866729f3bcec","0x1c","0x53746f726167654261736541646472657373","0x53746f7261676541646472657373","0x90d0203c41ad646d024845257a6eceb2f8b59b29ce7420dd518053d2edeedc","0x101dc0399934cc08fa0d6f6f2daead4e4a38cabeea1c743e1fc28d2d6e58e99","0x4e6f6e5a65726f","0x85","0x7265766f6b655f61705f747261636b696e67","0x77697468647261775f676173","0x6272616e63685f616c69676e","0x73746f72655f74656d70","0x66756e6374696f6e5f63616c6c","0x656e756d5f6d61746368","0x7","0x7374727563745f6465636f6e737472756374","0x61727261795f6c656e","0x736e617073686f745f74616b65","0x8","0x64726f70","0x7533325f636f6e7374","0x72656e616d65","0x7533325f6571","0x9","0x61727261795f6e6577","0x66656c743235325f636f6e7374","0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473","0x61727261795f617070656e64","0x7374727563745f636f6e737472756374","0x656e756d5f696e6974","0xd","0x6765745f6275696c74696e5f636f737473","0xe","0x77697468647261775f6761735f616c6c","0x12","0x4f7574206f6620676173","0x496e70757420746f6f2073686f727420666f7220617267756d656e7473","0x14","0x16","0x19","0x61727261795f736e617073686f745f706f705f66726f6e74","0x1b","0x6a756d70","0x756e626f78","0x66656c743235325f616464","0x1d","0x50414e4943","0x444159544148","0x64697361626c655f61705f747261636b696e67","0x73746f726167655f626173655f616464726573735f636f6e7374","0x206f38f7e4f15e87567361213c28f235cccdaa1d7fd34c9db1dfe9489c6a091","0x73746f726167655f616464726573735f66726f6d5f62617365","0x1f","0x73746f726167655f726561645f73797363616c6c","0x20","0x73746f726167655f77726974655f73797363616c6c","0x21","0x647570","0x66656c743235325f69735f7a65726f","0x22","0x66656c743235325f737562","0x2fe","0xffffffffffffffff","0x63","0x54","0x24","0x1e","0x25","0x46","0x26","0x27","0x28","0x29","0x2d","0x2e","0x2f","0x30","0x2a","0x2b","0x2c","0x31","0x3f","0x32","0x33","0x34","0x35","0x36","0x37","0x38","0x39","0x3a","0x3b","0x3c","0x3d","0x3e","0x40","0x41","0x42","0x43","0x44","0x45","0x47","0x48","0x49","0x4a","0x4b","0x4c","0x4d","0x4e","0x4f","0x50","0x51","0x52","0x53","0x55","0x56","0x57","0x58","0x59","0x5a","0x5b","0x5c","0x5d","0x5e","0x5f","0xc6","0x90","0xb9","0xb2","0x121","0xf3","0x114","0x10d","0x19d","0x196","0x187","0x157","0x179","0x172","0x60","0x61","0x62","0x64","0x65","0x66","0x67","0x68","0x69","0x1b2","0x1b7","0x1c1","0x1ed","0x1e7","0x203","0x224","0x229","0x245","0x23f","0x6a","0x262","0x6b","0x6c","0x267","0x6d","0x6e","0x6f","0x272","0x70","0x287","0x71","0x72","0x28c","0x73","0x74","0x75","0x297","0x76","0x77","0x78","0x79","0x7a","0x2d7","0x7b","0x7c","0x2af","0x7d","0x7e","0x2cd","0x7f","0x80","0x2c7","0x81","0x2ec","0x82","0x2f8","0x83","0x84","0xd4","0x12f","0x1ab","0x1c8","0x1cc","0x1f5","0x209","0x20f","0x21c","0x24f","0x255","0x278","0x29e","0x2e6","0x2f2","0x1ae7","0x7060f02090e0d02060a0c060b02070a090606080706060502040203020100","0x617061602090e15060d02070a090614060d02090a1302060a021202111006","0x70a18061f061e02090e10061d060d02090a1c061b02070a1a02060a021918","0x62402090e180623062202090e10060d02070a180621062002090e07060d02","0x10062a062902090e07060628180627062602090e250615060d02090a100609","0x2090e090607062f02090e022e022d18062c062b02090e10061c060d02090a","0x60638020606360c0906371506063602350234023332070606310906100630","0x2413d0606363d0606400207063f3d06063e3d06063c0706063b1506063a39","0x606460706063645070644070606431006063e15090637420606360706063e","0x24c4b060636024a4906063606060636060749060748180606471406064707","0x6063e0906063c1f06063e4d060638100906371d0606361d0606471c060647","0x1d06063c4f0706441506063e4e070644020749060748170606471506064709","0x906373d090637090606360706063c2106063a50060638390906371d06063e","0x65318090637250606382706063a52060638140906372306063e5106063842","0x60638060754060748100606470255540606360c0606360207540607480706","0x63a1006063606073906074839060636020739060748070606400706065654","0x606472c06063a58060638490906370257170906371c0606361c06063c1d06","0x20750060748210606471c06063e06074d0607484d06063602074d0607481f","0x37025b510606360607510607485a0706445907064406075006074850060636","0x65c06072506074806075206074852060636020752060748270606474b0906","0x37610606400607610607486106063602076106074802605f060636025e5d07","0x63a1d090637630606400607630607486306063602076306074802621c0906","0x60748026507060664060758060748580606360207580607482c0606472306","0x207510607482306064763060638610606380267060706446606063e020725","0x90609020269060207023910076a150c076907060207060202690602020268","0x66b18066907420610020c0669060c061502423d07690614060c0214066906","0x1c0769064b0642024b06690649063d02490669063d06390202690602070217","0x269064d061402214d0769061f0642021f0669060218020269061c0614021d","0x69072350074b0250066906500649022306690621061702500669061d061702","0x7690627061f022706690607061d0202690618061c02026906020702026c02","0x2a0669062a0623022a0669060250025206690602210202690625064d022551","0x69065806520258066906542c0727022c066906022502540669062a52075102","0x66d0654026306690651061d026106690615062a025f0669060c0615026d06","0x2000669060006580200066906022c020269060207026663615f0c06660669","0x7206610272066906025f020269060207027170076f6e6c07690700150c096d","0x6230276066906730663027506690607061d02740669066e062a0273066906","0x77a0600026c0669066c0615027a7978096906777675740c66027706690618","0x67e066e027e0669060221020269067b066c020269060207027d067c7b0669","0x82067302820669068106720281066906800671020269067f067002807f0769","0x654028606690679061d028506690678062a02840669066c06150283066906","0x69066c061502880669067d065202026906020702878685840c068706690683","0x8a7c890c068b066906880654028a06690679061d027c06690678062a028906","0x623028d0669060278028c06690602210202690618061c020269060207028b","0x26f0669068e8f0727028f0669060225028e0669068d8c0751028d0669068d","0x9306690607061d029206690671062a029106690670061502900669066f0652","0x3d06790202690617064d02026906020702949392910c069406690690065402","0x69695075102960669069606230296066906027a0295066906022102026906","0xc0615029a0669069906520299066906979807270298066906022502970669","0x9b0c069d0669069a0654026b06690607061d029c06690615062a029b066906","0x29f0669060278029e066906022102026906090679020269060207029d6b9c","0x66906a0a1072702a1066906022502a00669069f9e0751029f0669069f0623","0x690607061d02a506690639062a02a406690610061502a3066906a2065202a2","0xc0769070602070602026906020202a7a6a5a40c06a7066906a3065402a606","0x42064202420669063d063d023d06690609063902026906020702391007a815","0x614024b490769061706420217066906021802026906140614021814076906","0x615021c0669061c0649021d0669064b0617021c0669061806170202690649","0x1f022106690607061d0202690602070202a90269071d1c074b020c0669060c","0x6230223066906025002500669060221020269064d064d024d1f0769062106","0x2270669065125072702250669060225025106690623500751022306690623","0x2c0669061f061d025406690615062a022a0669060c06150252066906270652","0x6d0658026d066906022c02026906020702582c542a0c065806690652065402","0x66906025f02026906020702666307aa615f0769076d150c096d026d066906","0x690661062a020269066e067502706e0769066c0674026c0669060006610200","0x27372710969067a79780976027a066906700663027906690607061d027806","0x6690674067b020269060207027506ab74066907730677025f0669065f0615","0x669067d0623020269067b061c027d7b07690676067d027706690602210276","0x67e066e020269067f064d027f7e0769068180077f028106690677067e0280","0x85067302850669068406720284066906830671020269068206700283820769","0x654028906690672061d028806690671062a02870669065f06150286066906","0x69065f0615028a066906750652020269060207027c8988870c067c06690686","0x8d8c8b0c068e0669068a0654028d06690672061d028c06690671062a028b06","0x51026f0669066f0623026f0669060278028f0669060221020269060207028e","0x930669069206520292066906909107270291066906022502900669066f8f07","0x66906930654029606690607061d029506690666062a029406690663061502","0x60278029806690602210202690609067902026906020702979695940c0697","0x9b0727029b0669060225029a06690699980751029906690699062302990669","0x1d029e06690639062a029d066906100615026b0669069c0652029c0669069a","0x602070602026906020202a09f9e9d0c06a00669066b0654029f0669060706","0x420669063d063d023d06690609063902026906020702391007ac150c076907","0x49076906170642021706690602180202690614061402181407690642064202","0x669061c0649021d0669064b0617021c06690618061702026906490614024b","0x690607061d0202690602070202ad0269071d1c074b020c0669060c0615021c","0x66906025002500669060221020269064d064d024d1f07690621061f022106","0x6512507270225066906022502510669062350075102230669062306230223","0x1f061d025406690615062a022a0669060c0615025206690627065202270669","0x6d066906022c02026906020702582c542a0c0658066906520654022c066906","0x5f02026906020702666307ae615f0769076d150c096d026d0669066d065802","0x63020269066e067502706e0769066c0674026c066906000661020006690602","0xaf73066907710681025f0669065f0615027106690672068002720669067006","0x747a07690679066e0279066906022102026906730682020269060207027806","0x7706690676067302760669067506720275066906740671020269067a067002","0x66906770654027e06690607061d027d06690661062a027b0669065f061502","0x2a02810669065f06150280066906780652020269060207027f7e7d7b0c067f","0x20702848382810c0684066906800654028306690607061d02820669066106","0x6868507510286066906860623028606690602780285066906022102026906","0x630615027c0669068906520289066906878807270288066906022502870669","0x8a0c068d0669067c0654028c06690607061d028b06690666062a028a066906","0x28f0669060278028e066906022102026906090679020269060207028d8c8b","0x669066f90072702900669060225026f0669068f8e0751028f0669068f0623","0x690607061d029406690639062a029306690610061502920669069106520291","0xc0769070602070602026906020202969594930c0696066906920654029506","0x90609021706690615062a02180669060c061502026906020702391007b015","0x60207021c06b14b0669071406840214423d09690649171809830249066906","0x639020269060207022106b24d0669071f0686021f1d0769064b0685020269","0x1802026906510614022551076906230642022306690650063d02500669061d","0x17025406690625061702026906520614022a52076906270642022706690602","0x202690602070202b30269072c54074b0254066906540649022c0669062a06","0x20269066d064d026d580769065f061f025f06690607061d020269064d0670","0x2660669066361075102630669066306230263066906025002610669060221","0x700669063d0615026e0669066c0652026c0669066600072702000669060225","0x2737271700c06730669066e0654027206690658061d027106690642062a02","0x7a7907690778423d096d02780669067806580278066906022c020269060207","0x690677067402770669067606610276066906025f02026906020702757407b4","0x807f078702800669064d067e027f0669067d0663020269067b0675027d7b07","0x82020269060207028206b5810669077e06810279066906790615027e066906","0x6710202690684067002858407690683066e02830669060221020269068106","0x2a028906690679061502880669068706730287066906860672028606690685","0x207028b8a7c890c068b066906880654028a06690607061d027c0669067a06","0x7061d028e0669067a062a028d066906790615028c06690682065202026906","0x269064d0670020269060207026f8f8e8d0c066f0669068c0654028f066906","0x92066906919007510291066906910623029106690602780290066906022102","0x6690674061502950669069406520294066906929307270293066906022502","0x999897960c0699066906950654029806690607061d029706690675062a0296","0x6027a029a0669060221020269061d06790202690621064d02026906020702","0x6b0727026b0669060225029c0669069b9a0751029b0669069b0623029b0669","0x1d02a006690642062a029f0669063d0615029e0669069d0652029d0669069c","0x61c065202026906020702a2a1a09f0c06a20669069e065402a10669060706","0xa3065402a606690607061d02a506690642062a02a40669063d061502a30669","0x2b606690602210202690609067902026906020702a7a6a5a40c06a7066906","0x26a066906022502b8066906b7b6075102b7066906b7062302b70669060278","0x6690639062a02bb06690610061502ba066906b9065202b9066906b86a0727","0x606690602063902bebdbcbb0c06be066906ba065402bd06690607061d02bc","0x607067c0215066906090689020269060207020c06bf090707690706068802","0x23d066906028c0202690602070202c006028b023906690615068a02100669","0x14066906100671023906690642068a02100669060c067c02420669063d068d","0x690618068f020269060207021706c11806690739068e021406690614060902","0x61c0691021d066906140609021c0669064b0690024b06690649066f024906","0x4d0692024d066906028c0202690617064d020269060207021f1d07061f0669","0x6066906028c02235007062306690621069102500669061406090221066906","0x695020c066906070694020907070609066906060693020706690602061d02","0x217066906100696021806690606061d021406690602062a0210150769060c","0x67b020269060207024b06c24906690742067702423d390969061718140997","0x2230669063d061d025006690639062a021d066906091c0798021c06690649","0x69a02214d1f096906255123500c9902250669061d06230251066906150696","0x202690654064d02542a07690627069b020269060207025206c32706690721","0x5f0669066d066b026d066906582c079c0258066906028c022c0669062a0661","0x7026663610906660669065f069d02630669064d061d02610669061f062a02","0x69d026e0669064d061d026c0669061f062a020006690652069e0202690602","0x202690609061c0202690615069f02026906020702706e6c09067006690600","0x7806690671069d02730669063d061d027206690639062a02710669064b069e","0x96023d06690606061d023906690602062a0209066906070694027873720906","0x7021806c4140669071006770210150c096906423d39099702420669060906","0x62a024b0669064906a102490669061706a0021706690614067b0202690602","0x69060207021f1d1c09061f0669064b06a2021d06690615061d021c0669060c","0x69064d06a2025006690615061d02210669060c062a024d0669061806a30202","0xc066906028c020906690607060751020706690602066f0223502109062306","0x60221020269060206750210150706100669060c0693021506690609067e02","0x602a50209066906070607510207066906070623020706690602a402060669","0x1007270210066906022502150669060c090751020c0669060c0623020c0669","0x202690602b602420606420669063d06a7023d0669063906a6023906690615","0x6906150689020269060207021006c5150c0769070906880209066906070639","0x202690602070202c606028b024206690639068a023d0669060c067c023906","0x24206690618068a023d06690610067c021806690614068d0214066906028c","0x69060207024b06c74906690742068e021706690617060902170669063d0671","0x66906020615021f0669060221021d0669061c066f021c06690649068f0202","0x69061d062302270669061f067e0225066906170609025106690606062a0223","0x60207025406c82a0669075006840250214d096906522725512315b7025206","0x615025f0669066d066a026d066906582c07b802582c0769062a0685020269","0x69060207026663610906660669065f06b9026306690621062a02610669064d","0x69060006b9026e06690621062a026c0669064d061502000669065406ba0202","0x7106bb0271066906028c020269064b064d02026906020702706e6c09067006","0x2a0279066906020615027806690673066a0273066906721707b80272066906","0x690602250202690602067502747a790906740669067806b9027a0669060606","0x2150606150669060c06a7020c0669060906a6020906690606070727020706","0x64902150669060218020c0669060906bd020906690602bc0202690607069f","0x18144209ca3d39100969070c1506020cc9020c0669060c06be021506690615","0x24b06690639061d024906690610062a02170669063d06cb02026906020702","0x42062a021d0669061806ce0202690602070202cd06028b021c0669061706cc","0x6d0024d0669061c06cf021c0669061d06cc024b06690614061d0249066906","0x22306690621067b020269060207025006d1210669071f0677021f0669064d","0x520669064b061d022706690649062a02250669065106a102510669062306a0","0x49062a02540669065006a3020269060207022a522709062a0669062506a202","0x6906070695026d582c09066d0669065406a202580669064b061d022c066906","0x66906021802390669061006bd021006690602bc0202690615069f02150c07","0xd3144207690709393d060215d202390669063906be023d0669063d0649023d","0x690642062a021c0669064b06d4024b066906028c0202690602070249171809","0x202690602070202d606028b024d0669061c06d5021f06690614061d021d06","0x4d0669062106d5021f06690617061d021d06690618062a02210669064906d7","0x60207022506da5106690750068102500669062306d902230669064d06d802","0x1d062a022a0669065206dd0252066906270c07dc02270669065106db020269","0x26906020702582c540906580669062a06de022c0669061f061d0254066906","0x610669061f061d025f0669061d062a026d0669062506df020269060c069f02","0x61506580215066906022c0202690602b60263615f0906630669066d06de02","0x769060c06e102026906020702423d07e03910076907150602096d02150669","0x60c061c020269060207021806e30269071406e2021006690610061502140c","0x100615024b06690649066a0249066906170707b802170669060906e4020269","0x269060207021f1d1c09061f0669064b06b9021d06690639062a021c066906","0x6690721061002214d07690650060c0250066906070609020269061806e502","0x270c07e8022706690602e7022506690623090751020269060207025106e623","0x67e025f0669064d0609026d06690639062a02580669061006150252066906","0x2c0684022c542a09690663615f6d5815b70263066906520623026106690625","0x700669066e6c07b8026e6c076906660685020269060207020006e966066907","0x669067106b9027306690654062a02720669062a0615027106690670066a02","0x62a027a0669062a061502790669060006ba02026906020702787372090678","0x269060c061c0202690602070275747a0906750669067906b9027406690654","0x6690677066a0277066906764d07b802760669065106bb0202690609067002","0x27f7e7d09067f0669067b06b9027e06690639062a027d066906100615027b","0x690602210202690607067902026906090670020269060c061c020269060207","0x69060225028206690681800751028106690681062302810669060278028006","0x42062a02860669063d061502850669068406ba028406690682830727028306","0x207020706eb060669070206ea028887860906880669068506b90287066906","0x2150606150669060c06a2020c0669060906a102090669060606a002026906","0xa2023d0669063906a302390669060710072702100669060225020269060207","0x60606ee020269060207020706ed060669070206ec02420606420669063d06","0x22502026906020702150606150669060c06a7020c0669060906ef02090669","0x606420669063d06a7023d0669063906a60239066906071007270210066906","0x9070602494206020c154206020c0209070602494206020c154206020c1f42","0xf109070602494206020c154206020cf009070602494206020c154206020cd4","0x420609f4090706024d420609071d42060cf3021042074206f2023915071506","0x6020915060209f70251061d06f60602100907090707f5070602504206091d","0x9071c42060cfa070602504206091c420609f906025106091d07f807060252","0x6fd0250066106fc0c0907060252060209070915060215fb09070602584206","0xfe02510663"],"contract_class_version":"0.1.0","entry_points_by_type":{"CONSTRUCTOR":[],"EXTERNAL":[{"selector":"0x19c909057a1fa4e06e930f9418d432c08c64bd4bcd4be37d96beecaf3098412","function_idx":3},{"selector":"0x362398bec32bc0ebb411203221a35a0301193a96f317ebe5e40be9f60d15320","function_idx":0},{"selector":"0x39e11d48192e4333233c7eb19d10ad67c362bb28580c604d67884c85da39695","function_idx":1},{"selector":"0x3c90fa28d76cca3d1f524541612bd9b88cc064457761e09c93d034edf542da4","function_idx":2}],"L1_HANDLER":[]},"abi":"[{\"type\": \"impl\", \"name\": \"IHelloStarknetImpl\", \"interface_name\": \"hello_starknet: :hello_starknet: :IHelloStarknet\"}, {\"type\": \"interface\", \"name\": \"hello_starknet: :hello_starknet: :IHelloStarknet\", \"items\": [{\"type\": \"function\", \"name\": \"increase_balance\", \"inputs\": [{\"name\": \"amount\", \"type\": \"core: :felt252\"}], \"outputs\": [], \"state_mutability\": \"external\"}, {\"type\": \"function\", \"name\": \"get_balance\", \"inputs\": [], \"outputs\": [{\"type\": \"core: :felt252\"}], \"state_mutability\": \"view\"}, {\"type\": \"function\", \"name\": \"do_a_panic\", \"inputs\": [], \"outputs\": [], \"state_mutability\": \"view\"}, {\"type\": \"function\", \"name\": \"do_a_panic_with\", \"inputs\": [{\"name\": \"panic_data\", \"type\": \"core: :array: :Array: :\"}], \"outputs\": [], \"state_mutability\": \"view\"}]}, {\"type\": \"event\", \"name\": \"hello_starknet: :hello_starknet: :HelloStarknet: :Event\", \"kind\": \"enum\", \"variants\": []}]"}},"compiled_class_hash":{}} \ No newline at end of file diff --git a/crates/forge/tests/data/partitioning/Scarb.toml b/crates/forge/tests/data/partitioning/Scarb.toml new file mode 100644 index 0000000000..fba883415e --- /dev/null +++ b/crates/forge/tests/data/partitioning/Scarb.toml @@ -0,0 +1,39 @@ +[workspace] +members = [ + "crates/package_a", + "crates/package_b", +] + +[workspace.scripts] +test = "snforge" + +[workspace.tool.snforge] + +[workspace.dependencies] +starknet = "2.12.0" +snforge_std = { path = "../../../../../snforge_std" } + +[workspace.package] +version = "0.1.0" + +[package] +name = "partitioning" +version.workspace = true +edition = "2024_07" + +[scripts] +test.workspace = true + +[tool] +snforge.workspace = true + +[dependencies] +starknet.workspace = true +package_a = { path = "crates/package_a" } +package_b = { path = "crates/package_b" } + +[dev-dependencies] +snforge_std.workspace = true + +[[target.starknet-contract]] +sierra = true diff --git a/crates/forge/tests/data/partitioning/crates/package_a/Scarb.toml b/crates/forge/tests/data/partitioning/crates/package_a/Scarb.toml new file mode 100644 index 0000000000..a90f95ab8b --- /dev/null +++ b/crates/forge/tests/data/partitioning/crates/package_a/Scarb.toml @@ -0,0 +1,10 @@ +[package] +name = "package_a" +version.workspace = true +edition = "2024_07" + +[dependencies] +starknet.workspace = true + +[dev-dependencies] +snforge_std.workspace = true diff --git a/crates/forge/tests/data/partitioning/crates/package_a/src/lib.cairo b/crates/forge/tests/data/partitioning/crates/package_a/src/lib.cairo new file mode 100644 index 0000000000..2c8d367431 --- /dev/null +++ b/crates/forge/tests/data/partitioning/crates/package_a/src/lib.cairo @@ -0,0 +1,19 @@ +#[starknet::contract] +pub mod HelloStarknet { + #[storage] + struct Storage {} +} + +#[cfg(test)] +mod tests { + #[test] + fn test_a() { + assert!(1 + 1 == 2); + } + + #[test] + #[ignore] // Ignored on purpose + fn test_b() { + assert!(1 + 1 == 2); + } +} diff --git a/crates/forge/tests/data/partitioning/crates/package_a/tests/tests.cairo b/crates/forge/tests/data/partitioning/crates/package_a/tests/tests.cairo new file mode 100644 index 0000000000..8e7181b60b --- /dev/null +++ b/crates/forge/tests/data/partitioning/crates/package_a/tests/tests.cairo @@ -0,0 +1,9 @@ +#[test] +fn test_c() { + assert!(1 + 1 == 2); +} + +#[test] +fn test_d() { + assert!(1 + 1 == 2); +} diff --git a/crates/forge/tests/data/partitioning/crates/package_b/Scarb.toml b/crates/forge/tests/data/partitioning/crates/package_b/Scarb.toml new file mode 100644 index 0000000000..f09a0d86c8 --- /dev/null +++ b/crates/forge/tests/data/partitioning/crates/package_b/Scarb.toml @@ -0,0 +1,10 @@ +[package] +name = "package_b" +version.workspace = true +edition = "2024_07" + +[dependencies] +starknet.workspace = true + +[dev-dependencies] +snforge_std.workspace = true diff --git a/crates/forge/tests/data/partitioning/crates/package_b/src/lib.cairo b/crates/forge/tests/data/partitioning/crates/package_b/src/lib.cairo new file mode 100644 index 0000000000..d52c38c84a --- /dev/null +++ b/crates/forge/tests/data/partitioning/crates/package_b/src/lib.cairo @@ -0,0 +1,18 @@ +#[starknet::contract] +pub mod HelloStarknet { + #[storage] + struct Storage {} +} + +#[cfg(test)] +mod tests { + #[test] + fn test_e() { + assert!(1 + 1 == 2); + } + + #[test] + fn test_f() { + assert!(1 + 1 == 2); + } +} diff --git a/crates/forge/tests/data/partitioning/crates/package_b/tests/tests.cairo b/crates/forge/tests/data/partitioning/crates/package_b/tests/tests.cairo new file mode 100644 index 0000000000..5ed8490363 --- /dev/null +++ b/crates/forge/tests/data/partitioning/crates/package_b/tests/tests.cairo @@ -0,0 +1,9 @@ +#[test] +fn test_g() { + assert!(1 + 1 == 2); +} + +#[test] +fn test_h() { + assert!(1 + 1 == 3); // Failing on purpose +} diff --git a/crates/forge/tests/data/partitioning/src/lib.cairo b/crates/forge/tests/data/partitioning/src/lib.cairo new file mode 100644 index 0000000000..88efedd9b1 --- /dev/null +++ b/crates/forge/tests/data/partitioning/src/lib.cairo @@ -0,0 +1,18 @@ +#[starknet::contract] +pub mod HelloStarknet { + #[storage] + struct Storage {} +} + +#[cfg(test)] +mod tests { + #[test] + fn test_i() { + assert!(1 + 1 == 2); + } + + #[test] + fn test_j() { + assert!(1 + 1 == 2); + } +} diff --git a/crates/forge/tests/data/partitioning/tests/tests.cairo b/crates/forge/tests/data/partitioning/tests/tests.cairo new file mode 100644 index 0000000000..9489cc9359 --- /dev/null +++ b/crates/forge/tests/data/partitioning/tests/tests.cairo @@ -0,0 +1,15 @@ +#[test] +fn test_k() { + assert!(1 + 1 == 2); +} + +#[test] +fn test_l() { + assert!(1 + 1 == 2); +} + +#[test] +fn test_m() { + assert!(1 + 1 == 2); +} + diff --git a/crates/forge/tests/integration/setup_fork.rs b/crates/forge/tests/integration/setup_fork.rs index eb7e9175e3..1bbaea3af1 100644 --- a/crates/forge/tests/integration/setup_fork.rs +++ b/crates/forge/tests/integration/setup_fork.rs @@ -175,6 +175,7 @@ fn fork_aliased_decorator() { }], }, &mut BlockNumberMap::default(), + None, ui, )) .expect("Runner fail") @@ -268,6 +269,7 @@ fn fork_aliased_decorator_overrding() { }], }, &mut BlockNumberMap::default(), + None, ui, )) .expect("Runner fail") From e256bb59cad7f90c56e4c42764d4e9fc247dcd66 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Wed, 22 Oct 2025 18:40:32 +0200 Subject: [PATCH 2/5] Add tests --- crates/forge/tests/e2e/partitioning.rs | 275 ++++++++++++++++++++++++- 1 file changed, 274 insertions(+), 1 deletion(-) diff --git a/crates/forge/tests/e2e/partitioning.rs b/crates/forge/tests/e2e/partitioning.rs index c82c938066..53fce81f1e 100644 --- a/crates/forge/tests/e2e/partitioning.rs +++ b/crates/forge/tests/e2e/partitioning.rs @@ -1,6 +1,6 @@ use crate::e2e::common::runner::{setup_package, test_runner}; use indoc::indoc; -use shared::test_utils::output_assert::assert_stderr_contains; +use shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains}; #[test] fn test_does_not_work_with_exact_flag() { @@ -17,3 +17,276 @@ fn test_does_not_work_with_exact_flag() { "}, ); } + +#[test] +fn test_whole_workspace_partition_1_2() { + let temp = setup_package("partitioning"); + let output = test_runner(&temp) + .args(["--partition", "1/2", "--workspace"]) + .assert() + .code(0); + + assert_stdout_contains( + output, + indoc! {r" + [..]Compiling[..] + [..]Finished[..] + + + Collected 2 test(s) from package_a package + Running 1 test(s) from tests/ + [PASS] package_a_integrationtest::tests::test_c ([..]) + Running 1 test(s) from src/ + [PASS] package_a::tests::test_a ([..]) + Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out + + + Collected 2 test(s) from package_b package + Running 1 test(s) from src/ + [PASS] package_b::tests::test_e ([..]) + Running 1 test(s) from tests/ + [PASS] package_b_integrationtest::tests::test_g ([..]) + Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out + + + Collected 3 test(s) from partitioning package + Running 2 test(s) from tests/ + [PASS] partitioning_integrationtest::tests::test_k ([..]) + [PASS] partitioning_integrationtest::tests::test_m ([..]) + Running 1 test(s) from src/ + [PASS] partitioning::tests::test_i ([..]) + Tests: 3 passed, 0 failed, 0 ignored, 0 filtered out + + + Tests summary: 7 passed, 0 failed, 0 ignored, 0 filtered out + Finished partition run: 1/2 + "}, + ); +} + +#[test] +fn test_whole_workspace_partition_2_2() { + let temp = setup_package("partitioning"); + let output = test_runner(&temp) + .args(["--partition", "2/2", "--workspace"]) + .assert() + .code(1); + + assert_stdout_contains( + output, + indoc! {r#" + [..]Compiling[..] + [..]Finished[..] + + + Collected 2 test(s) from package_a package + Running 1 test(s) from tests/ + [PASS] package_a_integrationtest::tests::test_d ([..]) + Running 1 test(s) from src/ + [IGNORE] package_a::tests::test_b + Tests: 1 passed, 0 failed, 1 ignored, 0 filtered out + + + Collected 2 test(s) from package_b package + Running 1 test(s) from src/ + [PASS] package_b::tests::test_f ([..]) + Running 1 test(s) from tests/ + [FAIL] package_b_integrationtest::tests::test_h + + Failure data: + "assertion failed: `1 + 1 == 3`." + + Tests: 1 passed, 1 failed, 0 ignored, 0 filtered out + + + Collected 2 test(s) from partitioning package + Running 1 test(s) from tests/ + [PASS] partitioning_integrationtest::tests::test_l ([..]) + Running 1 test(s) from src/ + [PASS] partitioning::tests::test_j ([..]) + Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out + + Failures: + package_b_integrationtest::tests::test_h + + Tests summary: 4 passed, 1 failed, 1 ignored, 0 filtered out + Finished partition run: 2/2 + "#}, + ); +} + +#[test] +fn test_whole_workspace_partition_1_3() { + let temp = setup_package("partitioning"); + let output = test_runner(&temp) + .args(["--partition", "1/3", "--workspace"]) + .assert() + .code(0); + + assert_stdout_contains( + output, + indoc! {r" + [..]Compiling[..] + [..]Finished[..] + + + Collected 2 test(s) from package_a package + Running 1 test(s) from src/ + [PASS] package_a::tests::test_a ([..]) + Running 1 test(s) from tests/ + [PASS] package_a_integrationtest::tests::test_d ([..]) + Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out + + + Collected 1 test(s) from package_b package + Running 0 test(s) from src/ + Running 1 test(s) from tests/ + [PASS] package_b_integrationtest::tests::test_g ([..]) + Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out + + + Collected 2 test(s) from partitioning package + Running 1 test(s) from src/ + [PASS] partitioning::tests::test_j ([..]) + Running 1 test(s) from tests/ + [PASS] partitioning_integrationtest::tests::test_m ([..]) + Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out + + + Tests summary: 5 passed, 0 failed, 0 ignored, 0 filtered out + Finished partition run: 1/3 + "}, + ); +} + +#[test] +fn test_whole_workspace_partition_2_3() { + let temp = setup_package("partitioning"); + let output = test_runner(&temp) + .args(["--partition", "2/3", "--workspace"]) + .assert() + .code(1); + + assert_stdout_contains( + output, + indoc! {r#" + [..]Compiling[..] + [..]Finished[..] + + + Collected 1 test(s) from package_a package + Running 0 test(s) from tests/ + Running 1 test(s) from src/ + [IGNORE] package_a::tests::test_b + Tests: 0 passed, 0 failed, 1 ignored, 0 filtered out + + + Collected 2 test(s) from package_b package + Running 1 test(s) from tests/ + [FAIL] package_b_integrationtest::tests::test_h + + Failure data: + "assertion failed: `1 + 1 == 3`." + + Running 1 test(s) from src/ + [PASS] package_b::tests::test_e ([..]) + Tests: 1 passed, 1 failed, 0 ignored, 0 filtered out + + + Collected 1 test(s) from partitioning package + Running 1 test(s) from tests/ + [PASS] partitioning_integrationtest::tests::test_k ([..]) + Running 0 test(s) from src/ + Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out + + Failures: + package_b_integrationtest::tests::test_h + + Tests summary: 2 passed, 1 failed, 1 ignored, 0 filtered out + Finished partition run: 2/3 + "#}, + ); +} + +#[test] +fn test_whole_workspace_partition_3_3() { + let temp = setup_package("partitioning"); + let output = test_runner(&temp) + .args(["--partition", "3/3", "--workspace"]) + .assert() + .code(0); + + assert_stdout_contains( + output, + indoc! {r" + [..]Compiling[..] + [..]Finished[..] + + + Collected 1 test(s) from package_a package + Running 1 test(s) from tests/ + [PASS] package_a_integrationtest::tests::test_c ([..]) + Running 0 test(s) from src/ + Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out + + + Collected 1 test(s) from package_b package + Running 1 test(s) from src/ + [PASS] package_b::tests::test_f ([..]) + Running 0 test(s) from tests/ + Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out + + + Collected 2 test(s) from partitioning package + Running 1 test(s) from tests/ + [PASS] partitioning_integrationtest::tests::test_l ([..]) + Running 1 test(s) from src/ + [PASS] partitioning::tests::test_i ([..]) + Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out + + + Tests summary: 4 passed, 0 failed, 0 ignored, 0 filtered out + Finished partition run: 3/3 + "}, + ); +} + +#[test] +fn test_works_with_name_filter() { + let temp = setup_package("partitioning"); + let output = test_runner(&temp) + .args(["--partition", "1/3", "--workspace", "test_a"]) + .assert() + .code(0); + + assert_stdout_contains( + output, + indoc! {r" + [..]Compiling[..] + [..]Finished[..] + + + Collected 1 test(s) from package_a package + Running 0 test(s) from tests/ + Running 1 test(s) from src/ + [PASS] package_a::tests::test_a ([..]) + Tests: 1 passed, 0 failed, 0 ignored, 1 filtered out + + + Collected 0 test(s) from package_b package + Running 0 test(s) from src/ + Running 0 test(s) from tests/ + Tests: 0 passed, 0 failed, 0 ignored, 1 filtered out + + + Collected 0 test(s) from partitioning package + Running 0 test(s) from tests/ + Running 0 test(s) from src/ + Tests: 0 passed, 0 failed, 0 ignored, 2 filtered out + + + Tests summary: 1 passed, 0 failed, 0 ignored, 4 filtered out + Finished partition run: 1/3 + "}, + ); +} From caf539842b864bc9eb90cdec20d90c916630f1f1 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Wed, 22 Oct 2025 18:42:34 +0200 Subject: [PATCH 3/5] Delete unused file --- .../http___188_34_188_184_7070_rpc_v0_9_54060_v0_50_0.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 crates/forge/tests/data/forking/.snfoundry_cache/http___188_34_188_184_7070_rpc_v0_9_54060_v0_50_0.json diff --git a/crates/forge/tests/data/forking/.snfoundry_cache/http___188_34_188_184_7070_rpc_v0_9_54060_v0_50_0.json b/crates/forge/tests/data/forking/.snfoundry_cache/http___188_34_188_184_7070_rpc_v0_9_54060_v0_50_0.json deleted file mode 100644 index a8d83c7aad..0000000000 --- a/crates/forge/tests/data/forking/.snfoundry_cache/http___188_34_188_184_7070_rpc_v0_9_54060_v0_50_0.json +++ /dev/null @@ -1 +0,0 @@ -{"cache_version":"0_50_0","storage_at":{"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9":{"0x206f38f7e4f15e87567361213c28f235cccdaa1d7fd34c9db1dfe9489c6a091":"0x14d"}},"nonce_at":{},"class_hash_at":{"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9":"0x6a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550"},"compiled_contract_class":{"0x6a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550":{"sierra_program":["0x1","0x3","0x0","0x2","0x1","0x0","0xff","0x1","0x23","0x52616e6765436865636b","0x0","0x4761734275696c74696e","0x66656c74323532","0x4172726179","0x1","0x2","0x536e617073686f74","0x3","0x537472756374","0x1baeba72e79e9db2587cf44fedb2f3700b2075a5e8e39a562584862c4b71f62","0x4","0x2ee1e2b1b89f8c495f200e4956278a4d47395fe262f27b52e5865c9524c08c3","0x456e756d","0x11c6d8087e00642489f92d2821ad6ebd6532ad1a3b6d12833da6d6810391511","0x6","0x753332","0x53797374656d","0x16a4c8d7c05909052238a862d8cc3e7975bf05a07b3a69c6b28951083a6d672","0xa","0x5","0x9931c641b913035ae674b400b61a51476d506bbe8bba2ff8a6272790aba9e6","0xc","0xb","0x4275696c74696e436f737473","0x117f8dd6812873d3aeeacdfe88181a6eb024b50a122679c11870b3b47a1ec88","0x5af52ee38c32146750e2728e3556e24468de85c9684e8215a6a54f774a0eb9","0xf","0x10","0x3a44698eeaa62b837a805b0dfc46b2c1e4f013d3acf9b3c68ff14f08abc709","0x11","0x10203be321c62a7bd4c060d69539c1fbe065baa9e253c74d2cc48be163e259","0x13","0xcc5e86243f861d2d64b08c35db21013e773ac5cf10097946fe0011304886d5","0x15","0x17b6ecc31946835b0d9d92c2dd7a9c14f29af0371571ae74a1b228828b2242","0x17","0x34f9bd7c6cb2dd4263175964ad75f1ff1461ddc332fbfb274e0fb2a5d7ab968","0x18","0x426f78","0x29d7d57c04a880978e7b3689f6218e507f3be17588744b58dc17762447ad0e7","0x1a","0x123a1e81adcc5bd99f099d588eab8cc3de808fcdce58bd37e7e866729f3bcec","0x1c","0x53746f726167654261736541646472657373","0x53746f7261676541646472657373","0x90d0203c41ad646d024845257a6eceb2f8b59b29ce7420dd518053d2edeedc","0x101dc0399934cc08fa0d6f6f2daead4e4a38cabeea1c743e1fc28d2d6e58e99","0x4e6f6e5a65726f","0x85","0x7265766f6b655f61705f747261636b696e67","0x77697468647261775f676173","0x6272616e63685f616c69676e","0x73746f72655f74656d70","0x66756e6374696f6e5f63616c6c","0x656e756d5f6d61746368","0x7","0x7374727563745f6465636f6e737472756374","0x61727261795f6c656e","0x736e617073686f745f74616b65","0x8","0x64726f70","0x7533325f636f6e7374","0x72656e616d65","0x7533325f6571","0x9","0x61727261795f6e6577","0x66656c743235325f636f6e7374","0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473","0x61727261795f617070656e64","0x7374727563745f636f6e737472756374","0x656e756d5f696e6974","0xd","0x6765745f6275696c74696e5f636f737473","0xe","0x77697468647261775f6761735f616c6c","0x12","0x4f7574206f6620676173","0x496e70757420746f6f2073686f727420666f7220617267756d656e7473","0x14","0x16","0x19","0x61727261795f736e617073686f745f706f705f66726f6e74","0x1b","0x6a756d70","0x756e626f78","0x66656c743235325f616464","0x1d","0x50414e4943","0x444159544148","0x64697361626c655f61705f747261636b696e67","0x73746f726167655f626173655f616464726573735f636f6e7374","0x206f38f7e4f15e87567361213c28f235cccdaa1d7fd34c9db1dfe9489c6a091","0x73746f726167655f616464726573735f66726f6d5f62617365","0x1f","0x73746f726167655f726561645f73797363616c6c","0x20","0x73746f726167655f77726974655f73797363616c6c","0x21","0x647570","0x66656c743235325f69735f7a65726f","0x22","0x66656c743235325f737562","0x2fe","0xffffffffffffffff","0x63","0x54","0x24","0x1e","0x25","0x46","0x26","0x27","0x28","0x29","0x2d","0x2e","0x2f","0x30","0x2a","0x2b","0x2c","0x31","0x3f","0x32","0x33","0x34","0x35","0x36","0x37","0x38","0x39","0x3a","0x3b","0x3c","0x3d","0x3e","0x40","0x41","0x42","0x43","0x44","0x45","0x47","0x48","0x49","0x4a","0x4b","0x4c","0x4d","0x4e","0x4f","0x50","0x51","0x52","0x53","0x55","0x56","0x57","0x58","0x59","0x5a","0x5b","0x5c","0x5d","0x5e","0x5f","0xc6","0x90","0xb9","0xb2","0x121","0xf3","0x114","0x10d","0x19d","0x196","0x187","0x157","0x179","0x172","0x60","0x61","0x62","0x64","0x65","0x66","0x67","0x68","0x69","0x1b2","0x1b7","0x1c1","0x1ed","0x1e7","0x203","0x224","0x229","0x245","0x23f","0x6a","0x262","0x6b","0x6c","0x267","0x6d","0x6e","0x6f","0x272","0x70","0x287","0x71","0x72","0x28c","0x73","0x74","0x75","0x297","0x76","0x77","0x78","0x79","0x7a","0x2d7","0x7b","0x7c","0x2af","0x7d","0x7e","0x2cd","0x7f","0x80","0x2c7","0x81","0x2ec","0x82","0x2f8","0x83","0x84","0xd4","0x12f","0x1ab","0x1c8","0x1cc","0x1f5","0x209","0x20f","0x21c","0x24f","0x255","0x278","0x29e","0x2e6","0x2f2","0x1ae7","0x7060f02090e0d02060a0c060b02070a090606080706060502040203020100","0x617061602090e15060d02070a090614060d02090a1302060a021202111006","0x70a18061f061e02090e10061d060d02090a1c061b02070a1a02060a021918","0x62402090e180623062202090e10060d02070a180621062002090e07060d02","0x10062a062902090e07060628180627062602090e250615060d02090a100609","0x2090e090607062f02090e022e022d18062c062b02090e10061c060d02090a","0x60638020606360c0906371506063602350234023332070606310906100630","0x2413d0606363d0606400207063f3d06063e3d06063c0706063b1506063a39","0x606460706063645070644070606431006063e15090637420606360706063e","0x24c4b060636024a4906063606060636060749060748180606471406064707","0x6063e0906063c1f06063e4d060638100906371d0606361d0606471c060647","0x1d06063c4f0706441506063e4e070644020749060748170606471506064709","0x906373d090637090606360706063c2106063a50060638390906371d06063e","0x65318090637250606382706063a52060638140906372306063e5106063842","0x60638060754060748100606470255540606360c0606360207540607480706","0x63a1006063606073906074839060636020739060748070606400706065654","0x606472c06063a58060638490906370257170906371c0606361c06063c1d06","0x20750060748210606471c06063e06074d0607484d06063602074d0607481f","0x37025b510606360607510607485a0706445907064406075006074850060636","0x65c06072506074806075206074852060636020752060748270606474b0906","0x37610606400607610607486106063602076106074802605f060636025e5d07","0x63a1d090637630606400607630607486306063602076306074802621c0906","0x60748026507060664060758060748580606360207580607482c0606472306","0x207510607482306064763060638610606380267060706446606063e020725","0x90609020269060207023910076a150c076907060207060202690602020268","0x66b18066907420610020c0669060c061502423d07690614060c0214066906","0x1c0769064b0642024b06690649063d02490669063d06390202690602070217","0x269064d061402214d0769061f0642021f0669060218020269061c0614021d","0x69072350074b0250066906500649022306690621061702500669061d061702","0x7690627061f022706690607061d0202690618061c02026906020702026c02","0x2a0669062a0623022a0669060250025206690602210202690625064d022551","0x69065806520258066906542c0727022c066906022502540669062a52075102","0x66d0654026306690651061d026106690615062a025f0669060c0615026d06","0x2000669060006580200066906022c020269060207026663615f0c06660669","0x7206610272066906025f020269060207027170076f6e6c07690700150c096d","0x6230276066906730663027506690607061d02740669066e062a0273066906","0x77a0600026c0669066c0615027a7978096906777675740c66027706690618","0x67e066e027e0669060221020269067b066c020269060207027d067c7b0669","0x82067302820669068106720281066906800671020269067f067002807f0769","0x654028606690679061d028506690678062a02840669066c06150283066906","0x69066c061502880669067d065202026906020702878685840c068706690683","0x8a7c890c068b066906880654028a06690679061d027c06690678062a028906","0x623028d0669060278028c06690602210202690618061c020269060207028b","0x26f0669068e8f0727028f0669060225028e0669068d8c0751028d0669068d","0x9306690607061d029206690671062a029106690670061502900669066f0652","0x3d06790202690617064d02026906020702949392910c069406690690065402","0x69695075102960669069606230296066906027a0295066906022102026906","0xc0615029a0669069906520299066906979807270298066906022502970669","0x9b0c069d0669069a0654026b06690607061d029c06690615062a029b066906","0x29f0669060278029e066906022102026906090679020269060207029d6b9c","0x66906a0a1072702a1066906022502a00669069f9e0751029f0669069f0623","0x690607061d02a506690639062a02a406690610061502a3066906a2065202a2","0xc0769070602070602026906020202a7a6a5a40c06a7066906a3065402a606","0x42064202420669063d063d023d06690609063902026906020702391007a815","0x614024b490769061706420217066906021802026906140614021814076906","0x615021c0669061c0649021d0669064b0617021c0669061806170202690649","0x1f022106690607061d0202690602070202a90269071d1c074b020c0669060c","0x6230223066906025002500669060221020269064d064d024d1f0769062106","0x2270669065125072702250669060225025106690623500751022306690623","0x2c0669061f061d025406690615062a022a0669060c06150252066906270652","0x6d0658026d066906022c02026906020702582c542a0c065806690652065402","0x66906025f02026906020702666307aa615f0769076d150c096d026d066906","0x690661062a020269066e067502706e0769066c0674026c0669060006610200","0x27372710969067a79780976027a066906700663027906690607061d027806","0x6690674067b020269060207027506ab74066907730677025f0669065f0615","0x669067d0623020269067b061c027d7b07690676067d027706690602210276","0x67e066e020269067f064d027f7e0769068180077f028106690677067e0280","0x85067302850669068406720284066906830671020269068206700283820769","0x654028906690672061d028806690671062a02870669065f06150286066906","0x69065f0615028a066906750652020269060207027c8988870c067c06690686","0x8d8c8b0c068e0669068a0654028d06690672061d028c06690671062a028b06","0x51026f0669066f0623026f0669060278028f0669060221020269060207028e","0x930669069206520292066906909107270291066906022502900669066f8f07","0x66906930654029606690607061d029506690666062a029406690663061502","0x60278029806690602210202690609067902026906020702979695940c0697","0x9b0727029b0669060225029a06690699980751029906690699062302990669","0x1d029e06690639062a029d066906100615026b0669069c0652029c0669069a","0x602070602026906020202a09f9e9d0c06a00669066b0654029f0669060706","0x420669063d063d023d06690609063902026906020702391007ac150c076907","0x49076906170642021706690602180202690614061402181407690642064202","0x669061c0649021d0669064b0617021c06690618061702026906490614024b","0x690607061d0202690602070202ad0269071d1c074b020c0669060c0615021c","0x66906025002500669060221020269064d064d024d1f07690621061f022106","0x6512507270225066906022502510669062350075102230669062306230223","0x1f061d025406690615062a022a0669060c0615025206690627065202270669","0x6d066906022c02026906020702582c542a0c0658066906520654022c066906","0x5f02026906020702666307ae615f0769076d150c096d026d0669066d065802","0x63020269066e067502706e0769066c0674026c066906000661020006690602","0xaf73066907710681025f0669065f0615027106690672068002720669067006","0x747a07690679066e0279066906022102026906730682020269060207027806","0x7706690676067302760669067506720275066906740671020269067a067002","0x66906770654027e06690607061d027d06690661062a027b0669065f061502","0x2a02810669065f06150280066906780652020269060207027f7e7d7b0c067f","0x20702848382810c0684066906800654028306690607061d02820669066106","0x6868507510286066906860623028606690602780285066906022102026906","0x630615027c0669068906520289066906878807270288066906022502870669","0x8a0c068d0669067c0654028c06690607061d028b06690666062a028a066906","0x28f0669060278028e066906022102026906090679020269060207028d8c8b","0x669066f90072702900669060225026f0669068f8e0751028f0669068f0623","0x690607061d029406690639062a029306690610061502920669069106520291","0xc0769070602070602026906020202969594930c0696066906920654029506","0x90609021706690615062a02180669060c061502026906020702391007b015","0x60207021c06b14b0669071406840214423d09690649171809830249066906","0x639020269060207022106b24d0669071f0686021f1d0769064b0685020269","0x1802026906510614022551076906230642022306690650063d02500669061d","0x17025406690625061702026906520614022a52076906270642022706690602","0x202690602070202b30269072c54074b0254066906540649022c0669062a06","0x20269066d064d026d580769065f061f025f06690607061d020269064d0670","0x2660669066361075102630669066306230263066906025002610669060221","0x700669063d0615026e0669066c0652026c0669066600072702000669060225","0x2737271700c06730669066e0654027206690658061d027106690642062a02","0x7a7907690778423d096d02780669067806580278066906022c020269060207","0x690677067402770669067606610276066906025f02026906020702757407b4","0x807f078702800669064d067e027f0669067d0663020269067b0675027d7b07","0x82020269060207028206b5810669077e06810279066906790615027e066906","0x6710202690684067002858407690683066e02830669060221020269068106","0x2a028906690679061502880669068706730287066906860672028606690685","0x207028b8a7c890c068b066906880654028a06690607061d027c0669067a06","0x7061d028e0669067a062a028d066906790615028c06690682065202026906","0x269064d0670020269060207026f8f8e8d0c066f0669068c0654028f066906","0x92066906919007510291066906910623029106690602780290066906022102","0x6690674061502950669069406520294066906929307270293066906022502","0x999897960c0699066906950654029806690607061d029706690675062a0296","0x6027a029a0669060221020269061d06790202690621064d02026906020702","0x6b0727026b0669060225029c0669069b9a0751029b0669069b0623029b0669","0x1d02a006690642062a029f0669063d0615029e0669069d0652029d0669069c","0x61c065202026906020702a2a1a09f0c06a20669069e065402a10669060706","0xa3065402a606690607061d02a506690642062a02a40669063d061502a30669","0x2b606690602210202690609067902026906020702a7a6a5a40c06a7066906","0x26a066906022502b8066906b7b6075102b7066906b7062302b70669060278","0x6690639062a02bb06690610061502ba066906b9065202b9066906b86a0727","0x606690602063902bebdbcbb0c06be066906ba065402bd06690607061d02bc","0x607067c0215066906090689020269060207020c06bf090707690706068802","0x23d066906028c0202690602070202c006028b023906690615068a02100669","0x14066906100671023906690642068a02100669060c067c02420669063d068d","0x690618068f020269060207021706c11806690739068e021406690614060902","0x61c0691021d066906140609021c0669064b0690024b06690649066f024906","0x4d0692024d066906028c0202690617064d020269060207021f1d07061f0669","0x6066906028c02235007062306690621069102500669061406090221066906","0x695020c066906070694020907070609066906060693020706690602061d02","0x217066906100696021806690606061d021406690602062a0210150769060c","0x67b020269060207024b06c24906690742067702423d390969061718140997","0x2230669063d061d025006690639062a021d066906091c0798021c06690649","0x69a02214d1f096906255123500c9902250669061d06230251066906150696","0x202690654064d02542a07690627069b020269060207025206c32706690721","0x5f0669066d066b026d066906582c079c0258066906028c022c0669062a0661","0x7026663610906660669065f069d02630669064d061d02610669061f062a02","0x69d026e0669064d061d026c0669061f062a020006690652069e0202690602","0x202690609061c0202690615069f02026906020702706e6c09067006690600","0x7806690671069d02730669063d061d027206690639062a02710669064b069e","0x96023d06690606061d023906690602062a0209066906070694027873720906","0x7021806c4140669071006770210150c096906423d39099702420669060906","0x62a024b0669064906a102490669061706a0021706690614067b0202690602","0x69060207021f1d1c09061f0669064b06a2021d06690615061d021c0669060c","0x69064d06a2025006690615061d02210669060c062a024d0669061806a30202","0xc066906028c020906690607060751020706690602066f0223502109062306","0x60221020269060206750210150706100669060c0693021506690609067e02","0x602a50209066906070607510207066906070623020706690602a402060669","0x1007270210066906022502150669060c090751020c0669060c0623020c0669","0x202690602b602420606420669063d06a7023d0669063906a6023906690615","0x6906150689020269060207021006c5150c0769070906880209066906070639","0x202690602070202c606028b024206690639068a023d0669060c067c023906","0x24206690618068a023d06690610067c021806690614068d0214066906028c","0x69060207024b06c74906690742068e021706690617060902170669063d0671","0x66906020615021f0669060221021d0669061c066f021c06690649068f0202","0x69061d062302270669061f067e0225066906170609025106690606062a0223","0x60207025406c82a0669075006840250214d096906522725512315b7025206","0x615025f0669066d066a026d066906582c07b802582c0769062a0685020269","0x69060207026663610906660669065f06b9026306690621062a02610669064d","0x69060006b9026e06690621062a026c0669064d061502000669065406ba0202","0x7106bb0271066906028c020269064b064d02026906020702706e6c09067006","0x2a0279066906020615027806690673066a0273066906721707b80272066906","0x690602250202690602067502747a790906740669067806b9027a0669060606","0x2150606150669060c06a7020c0669060906a6020906690606070727020706","0x64902150669060218020c0669060906bd020906690602bc0202690607069f","0x18144209ca3d39100969070c1506020cc9020c0669060c06be021506690615","0x24b06690639061d024906690610062a02170669063d06cb02026906020702","0x42062a021d0669061806ce0202690602070202cd06028b021c0669061706cc","0x6d0024d0669061c06cf021c0669061d06cc024b06690614061d0249066906","0x22306690621067b020269060207025006d1210669071f0677021f0669064d","0x520669064b061d022706690649062a02250669065106a102510669062306a0","0x49062a02540669065006a3020269060207022a522709062a0669062506a202","0x6906070695026d582c09066d0669065406a202580669064b061d022c066906","0x66906021802390669061006bd021006690602bc0202690615069f02150c07","0xd3144207690709393d060215d202390669063906be023d0669063d0649023d","0x690642062a021c0669064b06d4024b066906028c0202690602070249171809","0x202690602070202d606028b024d0669061c06d5021f06690614061d021d06","0x4d0669062106d5021f06690617061d021d06690618062a02210669064906d7","0x60207022506da5106690750068102500669062306d902230669064d06d802","0x1d062a022a0669065206dd0252066906270c07dc02270669065106db020269","0x26906020702582c540906580669062a06de022c0669061f061d0254066906","0x610669061f061d025f0669061d062a026d0669062506df020269060c069f02","0x61506580215066906022c0202690602b60263615f0906630669066d06de02","0x769060c06e102026906020702423d07e03910076907150602096d02150669","0x60c061c020269060207021806e30269071406e2021006690610061502140c","0x100615024b06690649066a0249066906170707b802170669060906e4020269","0x269060207021f1d1c09061f0669064b06b9021d06690639062a021c066906","0x6690721061002214d07690650060c0250066906070609020269061806e502","0x270c07e8022706690602e7022506690623090751020269060207025106e623","0x67e025f0669064d0609026d06690639062a02580669061006150252066906","0x2c0684022c542a09690663615f6d5815b70263066906520623026106690625","0x700669066e6c07b8026e6c076906660685020269060207020006e966066907","0x669067106b9027306690654062a02720669062a0615027106690670066a02","0x62a027a0669062a061502790669060006ba02026906020702787372090678","0x269060c061c0202690602070275747a0906750669067906b9027406690654","0x6690677066a0277066906764d07b802760669065106bb0202690609067002","0x27f7e7d09067f0669067b06b9027e06690639062a027d066906100615027b","0x690602210202690607067902026906090670020269060c061c020269060207","0x69060225028206690681800751028106690681062302810669060278028006","0x42062a02860669063d061502850669068406ba028406690682830727028306","0x207020706eb060669070206ea028887860906880669068506b90287066906","0x2150606150669060c06a2020c0669060906a102090669060606a002026906","0xa2023d0669063906a302390669060710072702100669060225020269060207","0x60606ee020269060207020706ed060669070206ec02420606420669063d06","0x22502026906020702150606150669060c06a7020c0669060906ef02090669","0x606420669063d06a7023d0669063906a60239066906071007270210066906","0x9070602494206020c154206020c0209070602494206020c154206020c1f42","0xf109070602494206020c154206020cf009070602494206020c154206020cd4","0x420609f4090706024d420609071d42060cf3021042074206f2023915071506","0x6020915060209f70251061d06f60602100907090707f5070602504206091d","0x9071c42060cfa070602504206091c420609f906025106091d07f807060252","0x6fd0250066106fc0c0907060252060209070915060215fb09070602584206","0xfe02510663"],"contract_class_version":"0.1.0","entry_points_by_type":{"CONSTRUCTOR":[],"EXTERNAL":[{"selector":"0x19c909057a1fa4e06e930f9418d432c08c64bd4bcd4be37d96beecaf3098412","function_idx":3},{"selector":"0x362398bec32bc0ebb411203221a35a0301193a96f317ebe5e40be9f60d15320","function_idx":0},{"selector":"0x39e11d48192e4333233c7eb19d10ad67c362bb28580c604d67884c85da39695","function_idx":1},{"selector":"0x3c90fa28d76cca3d1f524541612bd9b88cc064457761e09c93d034edf542da4","function_idx":2}],"L1_HANDLER":[]},"abi":"[{\"type\": \"impl\", \"name\": \"IHelloStarknetImpl\", \"interface_name\": \"hello_starknet: :hello_starknet: :IHelloStarknet\"}, {\"type\": \"interface\", \"name\": \"hello_starknet: :hello_starknet: :IHelloStarknet\", \"items\": [{\"type\": \"function\", \"name\": \"increase_balance\", \"inputs\": [{\"name\": \"amount\", \"type\": \"core: :felt252\"}], \"outputs\": [], \"state_mutability\": \"external\"}, {\"type\": \"function\", \"name\": \"get_balance\", \"inputs\": [], \"outputs\": [{\"type\": \"core: :felt252\"}], \"state_mutability\": \"view\"}, {\"type\": \"function\", \"name\": \"do_a_panic\", \"inputs\": [], \"outputs\": [], \"state_mutability\": \"view\"}, {\"type\": \"function\", \"name\": \"do_a_panic_with\", \"inputs\": [{\"name\": \"panic_data\", \"type\": \"core: :array: :Array: :\"}], \"outputs\": [], \"state_mutability\": \"view\"}]}, {\"type\": \"event\", \"name\": \"hello_starknet: :hello_starknet: :HelloStarknet: :Event\", \"kind\": \"enum\", \"variants\": []}]"}},"compiled_class_hash":{}} \ No newline at end of file From b6c59cd3145dec39c8e80472d649f9dbf80c6a65 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Wed, 22 Oct 2025 18:46:19 +0200 Subject: [PATCH 4/5] Minor name refactor --- crates/forge/src/run_tests/test_target.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/forge/src/run_tests/test_target.rs b/crates/forge/src/run_tests/test_target.rs index c89196c6f1..3697011ac1 100644 --- a/crates/forge/src/run_tests/test_target.rs +++ b/crates/forge/src/run_tests/test_target.rs @@ -52,9 +52,9 @@ pub async fn run_for_test_target( case.name ) }); - let should_run_in_partition = *test_partition == partition_config.partition().index(); + let is_included_in_partition = *test_partition == partition_config.partition().index(); - if !should_run_in_partition { + if !is_included_in_partition { tasks.push(tokio::task::spawn(async { Ok(AnyTestCaseSummary::Single( TestCaseSummary::ExcludedFromPartition {}, From 484a1f1d7cf06b57c29fb6a5c28939c3cec5f0e9 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Wed, 22 Oct 2025 20:14:34 +0200 Subject: [PATCH 5/5] Formatting --- crates/forge/src/run_tests/workspace.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/forge/src/run_tests/workspace.rs b/crates/forge/src/run_tests/workspace.rs index 40c87dd5c9..756258b328 100644 --- a/crates/forge/src/run_tests/workspace.rs +++ b/crates/forge/src/run_tests/workspace.rs @@ -156,7 +156,6 @@ pub async fn run_for_workspace(args: TestArgs, ui: Arc) -> Result = extract_failed_tests(all_tests).collect(); FailedTestsCache::new(&cache_dir).save_failed_tests(&all_failed_tests)?;