From dccc64bb15d5e426fbe7c6fe935e2ca7a61b9567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Tr=C4=85tnowiecki?= Date: Mon, 7 Oct 2024 15:16:10 +0200 Subject: [PATCH] Revert "Test compilation diagnostics reporter (#1577)" This reverts commit 64c9eb6dd2223317324ba15f997a3fa218eb6479. --- scarb/src/compiler/compilers/test.rs | 11 ++++++++--- scarb/tests/build.rs | 6 ------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/scarb/src/compiler/compilers/test.rs b/scarb/src/compiler/compilers/test.rs index 6772f8a83..6fa9050fd 100644 --- a/scarb/src/compiler/compilers/test.rs +++ b/scarb/src/compiler/compilers/test.rs @@ -37,7 +37,7 @@ impl Compiler for TestCompiler { let test_crate_ids = collect_main_crate_ids(&unit, db); // Search for all contracts in deps specified with `build-external-contracts`. - let all_crate_ids = + let main_crate_ids = get_contract_crate_ids(&build_external_contracts, test_crate_ids.clone(), db); let starknet = unit.cairo_plugins.iter().any(|plugin| { @@ -48,6 +48,10 @@ impl Compiler for TestCompiler { let diagnostics_reporter = build_compiler_config(db, &unit, &test_crate_ids, ws).diagnostics_reporter; + diagnostics_reporter + .with_crates(&main_crate_ids) + .ensure(db)?; + let test_compilation = { let _ = trace_span!("compile_test").enter(); let config = TestsCompilationConfig { @@ -59,12 +63,13 @@ impl Compiler for TestCompiler { .compiler_config .unstable_add_statements_code_locations_debug_info, }; + let allow_warnings = unit.compiler_config.allow_warnings; compile_test_prepared_db( db, config, - all_crate_ids.clone(), + main_crate_ids, test_crate_ids.clone(), - diagnostics_reporter, + allow_warnings, )? }; diff --git a/scarb/tests/build.rs b/scarb/tests/build.rs index 0a599cb4e..9550e8864 100644 --- a/scarb/tests/build.rs +++ b/scarb/tests/build.rs @@ -958,12 +958,6 @@ fn does_not_show_warnings_from_deps() { .current_dir(&second) .assert() .success(); - Scarb::quick_snapbox() - .arg("build") - .arg("--test") - .current_dir(&second) - .assert() - .success(); } #[test]