From e21c87b0b25a6c9d05dd567fa12ed8edc39f5ac5 Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Thu, 12 Dec 2024 15:32:55 -0300 Subject: [PATCH 1/8] Introduce `--format json` for `nargo test` and handle a few cases --- tooling/nargo_cli/src/cli/test_cmd.rs | 6 +- .../nargo_cli/src/cli/test_cmd/formatters.rs | 73 +++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/tooling/nargo_cli/src/cli/test_cmd.rs b/tooling/nargo_cli/src/cli/test_cmd.rs index 32512eba5bb..1bd2627e6fb 100644 --- a/tooling/nargo_cli/src/cli/test_cmd.rs +++ b/tooling/nargo_cli/src/cli/test_cmd.rs @@ -12,7 +12,7 @@ use acvm::{BlackBoxFunctionSolver, FieldElement}; use bn254_blackbox_solver::Bn254BlackBoxSolver; use clap::Args; use fm::FileManager; -use formatters::{Formatter, PrettyFormatter, TerseFormatter}; +use formatters::{Formatter, JsonFormatter, PrettyFormatter, TerseFormatter}; use nargo::{ insert_all_files_for_workspace_into_file_manager, ops::TestStatus, package::Package, parse_all, prepare_package, workspace::Workspace, PrintOutput, @@ -71,6 +71,8 @@ enum Format { Pretty, /// Display one character per test Terse, + /// Output a JSON Lines document + Json, } impl Format { @@ -78,6 +80,7 @@ impl Format { match self { Format::Pretty => Box::new(PrettyFormatter), Format::Terse => Box::new(TerseFormatter), + Format::Json => Box::new(JsonFormatter), } } } @@ -87,6 +90,7 @@ impl Display for Format { match self { Format::Pretty => write!(f, "pretty"), Format::Terse => write!(f, "terse"), + Format::Json => write!(f, "json"), } } } diff --git a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs index 2a791930f60..a448ea4abe3 100644 --- a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs +++ b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs @@ -2,6 +2,7 @@ use std::{io::Write, panic::RefUnwindSafe, time::Duration}; use fm::FileManager; use nargo::ops::TestStatus; +use serde_json::json; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, StandardStreamLock, WriteColor}; use super::TestResult; @@ -317,6 +318,78 @@ impl Formatter for TerseFormatter { } } +pub(super) struct JsonFormatter; + +impl Formatter for JsonFormatter { + fn package_start(&self, package_name: &str, test_count: usize) -> std::io::Result<()> { + let json = json!({"type": "suite", "event": "started", "name": package_name, "test_count": test_count}); + println!("{json}"); + Ok(()) + } + + fn test_end( + &self, + test_result: &TestResult, + _current_test_count: usize, + _total_test_count: usize, + _file_manager: &FileManager, + _show_output: bool, + _deny_warnings: bool, + _silence_warnings: bool, + ) -> std::io::Result<()> { + let name = &test_result.name; + let exec_time = test_result.time_to_run.as_secs_f64(); + let json = match &test_result.status { + TestStatus::Pass => { + json!({"type": "test", "event": "ok", "name": name, "exec_time": exec_time}) + } + TestStatus::Fail { message, error_diagnostic } => { + let mut stdout = String::new(); + if !test_result.output.is_empty() { + stdout.push_str(&test_result.output.trim_end()); + stdout.push('\n'); + } + stdout.push_str(message); + let stdout = stdout.trim(); + json!({"type": "test", "event": "failed", "name": name, "exec_time": exec_time, "stdout": stdout}) + } + TestStatus::Skipped => { + json!({"type": "test", "event": "skipped", "name": name, "exec_time": exec_time}) + } + TestStatus::CompileError(file_diagnostic) => { + json!({"type": "test", "event": "failed", "name": name, "exec_time": exec_time}) + } + }; + println!("{json}"); + Ok(()) + } + + fn package_end( + &self, + _package_name: &str, + test_results: &[TestResult], + _file_manager: &FileManager, + _show_output: bool, + _deny_warnings: bool, + _silence_warnings: bool, + ) -> std::io::Result<()> { + let mut passed = 0; + let mut failed = 0; + let mut skipped = 0; + for test_result in test_results { + match &test_result.status { + TestStatus::Pass => passed += 1, + TestStatus::Fail { .. } | TestStatus::CompileError(..) => failed += 1, + TestStatus::Skipped => skipped += 1, + } + } + let event = if failed == 0 { "ok" } else { "failed" }; + let json = json!({"type": "suite", "event": event, "passed": passed, "failed": failed, "skipped": skipped}); + println!("{json}"); + Ok(()) + } +} + fn package_start(package_name: &str, test_count: usize) -> std::io::Result<()> { let plural = if test_count == 1 { "" } else { "s" }; println!("[{package_name}] Running {test_count} test function{plural}"); From bc65a7c4ae16024659128b500921118be270694e Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Thu, 12 Dec 2024 16:23:42 -0300 Subject: [PATCH 2/8] Show diagnostics --- compiler/fm/src/file_map.rs | 24 ++--- compiler/noirc_errors/src/reporter.rs | 2 +- .../nargo_cli/src/cli/test_cmd/formatters.rs | 89 +++++++++++++++---- 3 files changed, 86 insertions(+), 29 deletions(-) diff --git a/compiler/fm/src/file_map.rs b/compiler/fm/src/file_map.rs index ba552fe5156..857c7460fb9 100644 --- a/compiler/fm/src/file_map.rs +++ b/compiler/fm/src/file_map.rs @@ -80,6 +80,19 @@ impl FileMap { pub fn all_file_ids(&self) -> impl Iterator { self.name_to_id.values() } + + pub fn get_name(&self, file_id: FileId) -> Result { + let name = self.files.get(file_id.as_usize())?.name().clone(); + + // See if we can make the file name a bit shorter/easier to read if it starts with the current directory + if let Some(current_dir) = &self.current_dir { + if let Ok(name_without_prefix) = name.0.strip_prefix(current_dir) { + return Ok(PathString::from_path(name_without_prefix.to_path_buf())); + } + } + + Ok(name) + } } impl Default for FileMap { fn default() -> Self { @@ -97,16 +110,7 @@ impl<'a> Files<'a> for FileMap { type Source = &'a str; fn name(&self, file_id: Self::FileId) -> Result { - let name = self.files.get(file_id.as_usize())?.name().clone(); - - // See if we can make the file name a bit shorter/easier to read if it starts with the current directory - if let Some(current_dir) = &self.current_dir { - if let Ok(name_without_prefix) = name.0.strip_prefix(current_dir) { - return Ok(PathString::from_path(name_without_prefix.to_path_buf())); - } - } - - Ok(name) + self.get_name(file_id) } fn source(&'a self, file_id: Self::FileId) -> Result { diff --git a/compiler/noirc_errors/src/reporter.rs b/compiler/noirc_errors/src/reporter.rs index f029b4e6de8..e57775d9a7f 100644 --- a/compiler/noirc_errors/src/reporter.rs +++ b/compiler/noirc_errors/src/reporter.rs @@ -272,7 +272,7 @@ fn convert_diagnostic( diagnostic.with_message(&cd.message).with_labels(secondary_labels).with_notes(notes) } -fn stack_trace<'files>( +pub fn stack_trace<'files>( files: &'files impl Files<'files, FileId = fm::FileId>, call_stack: &[Location], ) -> String { diff --git a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs index a448ea4abe3..43542b2a8a5 100644 --- a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs +++ b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs @@ -2,7 +2,8 @@ use std::{io::Write, panic::RefUnwindSafe, time::Duration}; use fm::FileManager; use nargo::ops::TestStatus; -use serde_json::json; +use noirc_errors::{reporter::stack_trace, FileDiagnostic}; +use serde_json::{json, Map}; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, StandardStreamLock, WriteColor}; use super::TestResult; @@ -332,34 +333,61 @@ impl Formatter for JsonFormatter { test_result: &TestResult, _current_test_count: usize, _total_test_count: usize, - _file_manager: &FileManager, - _show_output: bool, + file_manager: &FileManager, + show_output: bool, _deny_warnings: bool, - _silence_warnings: bool, + silence_warnings: bool, ) -> std::io::Result<()> { - let name = &test_result.name; - let exec_time = test_result.time_to_run.as_secs_f64(); - let json = match &test_result.status { + let mut json = Map::new(); + json.insert("type".to_string(), json!("test")); + json.insert("name".to_string(), json!(&test_result.name)); + json.insert("exec_time".to_string(), json!(test_result.time_to_run.as_secs_f64())); + + let mut stdout = String::new(); + if show_output && !test_result.output.is_empty() { + stdout.push_str(test_result.output.trim()); + } + + match &test_result.status { TestStatus::Pass => { - json!({"type": "test", "event": "ok", "name": name, "exec_time": exec_time}) + json.insert("event".to_string(), json!("ok")); } TestStatus::Fail { message, error_diagnostic } => { - let mut stdout = String::new(); - if !test_result.output.is_empty() { - stdout.push_str(&test_result.output.trim_end()); + json.insert("event".to_string(), json!("failed")); + + if !stdout.is_empty() { stdout.push('\n'); } - stdout.push_str(message); - let stdout = stdout.trim(); - json!({"type": "test", "event": "failed", "name": name, "exec_time": exec_time, "stdout": stdout}) + stdout.push_str(message.trim()); + + if let Some(diagnostic) = error_diagnostic { + if !(diagnostic.diagnostic.is_warning() && silence_warnings) { + stdout.push('\n'); + stdout.push_str(&diagnostic_to_string(diagnostic, file_manager)); + } + } } TestStatus::Skipped => { - json!({"type": "test", "event": "skipped", "name": name, "exec_time": exec_time}) + json.insert("event".to_string(), json!("skipped")); } - TestStatus::CompileError(file_diagnostic) => { - json!({"type": "test", "event": "failed", "name": name, "exec_time": exec_time}) + TestStatus::CompileError(diagnostic) => { + json.insert("event".to_string(), json!("failed")); + + if !(diagnostic.diagnostic.is_warning() && silence_warnings) { + if !stdout.is_empty() { + stdout.push('\n'); + } + stdout.push_str(&diagnostic_to_string(diagnostic, file_manager)); + } } - }; + } + + if !stdout.is_empty() { + json.insert("stdout".to_string(), json!(stdout)); + } + + let json = json!(json); + println!("{json}"); Ok(()) } @@ -395,3 +423,28 @@ fn package_start(package_name: &str, test_count: usize) -> std::io::Result<()> { println!("[{package_name}] Running {test_count} test function{plural}"); Ok(()) } + +fn diagnostic_to_string(file_diagnostic: &FileDiagnostic, file_manager: &FileManager) -> String { + let file_map = file_manager.as_file_map(); + + let custom_diagnostic = &file_diagnostic.diagnostic; + let mut message = String::new(); + message.push_str(custom_diagnostic.message.trim()); + + for note in &custom_diagnostic.notes { + message.push('\n'); + message.push_str(note.trim()); + } + + if let Ok(name) = file_map.get_name(file_diagnostic.file_id) { + message.push('\n'); + message.push_str(&format!("at {name}")); + } + + if !custom_diagnostic.call_stack.is_empty() { + message.push('\n'); + message.push_str(&stack_trace(file_map, &custom_diagnostic.call_stack)); + } + + message +} From 2c0f4304d36c3197f79f0562fbf4e93864ac130f Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Thu, 12 Dec 2024 16:28:12 -0300 Subject: [PATCH 3/8] Adjust newlines --- tooling/nargo_cli/src/cli/test_cmd/formatters.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs index 43542b2a8a5..3cca5afdf41 100644 --- a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs +++ b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs @@ -387,8 +387,8 @@ impl Formatter for JsonFormatter { } let json = json!(json); - println!("{json}"); + Ok(()) } From a22a86caa61093ea03778edcd4a3a8522d888e98 Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Fri, 13 Dec 2024 09:42:05 -0300 Subject: [PATCH 4/8] Show test start event in JSON output, and split events in sync and async --- tooling/nargo_cli/src/cli/test_cmd.rs | 24 +++- .../nargo_cli/src/cli/test_cmd/formatters.rs | 108 ++++++++++++++++-- 2 files changed, 120 insertions(+), 12 deletions(-) diff --git a/tooling/nargo_cli/src/cli/test_cmd.rs b/tooling/nargo_cli/src/cli/test_cmd.rs index 1bd2627e6fb..1fd4ed2d873 100644 --- a/tooling/nargo_cli/src/cli/test_cmd.rs +++ b/tooling/nargo_cli/src/cli/test_cmd.rs @@ -215,6 +215,12 @@ impl<'a> TestRunner<'a> { ) -> bool { let mut all_passed = true; + for (package_name, total_test_count) in test_count_per_package { + self.formatter + .package_start_async(package_name, *total_test_count) + .expect("Could not display package start"); + } + let (sender, receiver) = mpsc::channel(); let iter = &Mutex::new(tests.into_iter()); thread::scope(|scope| { @@ -232,6 +238,10 @@ impl<'a> TestRunner<'a> { break; }; + self.formatter + .test_start_async(&test.name, &test.package_name) + .expect("Could not display test start"); + let time_before_test = std::time::Instant::now(); let (status, output) = match catch_unwind(test.runner) { Ok((status, output)) => (status, output), @@ -259,6 +269,16 @@ impl<'a> TestRunner<'a> { time_to_run, }; + self.formatter + .test_end_async( + &test_result, + self.file_manager, + self.args.show_output, + self.args.compile_options.deny_warnings, + self.args.compile_options.silence_warnings, + ) + .expect("Could not display test start"); + if thread_sender.send(test_result).is_err() { break; } @@ -279,7 +299,7 @@ impl<'a> TestRunner<'a> { let total_test_count = *total_test_count; self.formatter - .package_start(package_name, total_test_count) + .package_start_sync(package_name, total_test_count) .expect("Could not display package start"); // Check if we have buffered test results for this package @@ -489,7 +509,7 @@ impl<'a> TestRunner<'a> { current_test_count: usize, total_test_count: usize, ) -> std::io::Result<()> { - self.formatter.test_end( + self.formatter.test_end_sync( test_result, current_test_count, total_test_count, diff --git a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs index 3cca5afdf41..cd62d88df4e 100644 --- a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs +++ b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs @@ -8,11 +8,40 @@ use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, StandardStreamLoc use super::TestResult; +/// A formatter for showing test results. +/// +/// The order of events is: +/// 1. Compilation of all packages happen (in parallel). There's no formatter method for this. +/// 2. If compilation is successful, one `package_start_async` for each package. +/// 3. For each test, one `test_start_async` event. +/// 4. For each package, sequentially: +/// a. A `package_start_sync` event +/// b. One `test_end` event for each test +/// a. A `package_end` event +/// +/// The reason we have some `sync` and `async` events is that formatters that show output +/// to humans rely on the `sync` events to show a more readable and understandable output, +/// and formatters that output to a machine-readable format (like JSON) rely on the `async` +/// events to show the results as soon as they are available, regardless of a package ordering. pub(super) trait Formatter: Send + Sync + RefUnwindSafe { - fn package_start(&self, package_name: &str, test_count: usize) -> std::io::Result<()>; + fn package_start_async(&self, package_name: &str, test_count: usize) -> std::io::Result<()>; + + fn package_start_sync(&self, package_name: &str, test_count: usize) -> std::io::Result<()>; + + fn test_start_async(&self, name: &str, package_name: &str) -> std::io::Result<()>; + + #[allow(clippy::too_many_arguments)] + fn test_end_async( + &self, + test_result: &TestResult, + file_manager: &FileManager, + show_output: bool, + deny_warnings: bool, + silence_warnings: bool, + ) -> std::io::Result<()>; #[allow(clippy::too_many_arguments)] - fn test_end( + fn test_end_sync( &self, test_result: &TestResult, current_test_count: usize, @@ -37,11 +66,30 @@ pub(super) trait Formatter: Send + Sync + RefUnwindSafe { pub(super) struct PrettyFormatter; impl Formatter for PrettyFormatter { - fn package_start(&self, package_name: &str, test_count: usize) -> std::io::Result<()> { + fn package_start_async(&self, _package_name: &str, _test_count: usize) -> std::io::Result<()> { + Ok(()) + } + + fn package_start_sync(&self, package_name: &str, test_count: usize) -> std::io::Result<()> { package_start(package_name, test_count) } - fn test_end( + fn test_start_async(&self, _name: &str, _package_name: &str) -> std::io::Result<()> { + Ok(()) + } + + fn test_end_async( + &self, + _test_result: &TestResult, + _file_manager: &FileManager, + _show_output: bool, + _deny_warnings: bool, + _silence_warnings: bool, + ) -> std::io::Result<()> { + Ok(()) + } + + fn test_end_sync( &self, test_result: &TestResult, _current_test_count: usize, @@ -175,11 +223,30 @@ impl Formatter for PrettyFormatter { pub(super) struct TerseFormatter; impl Formatter for TerseFormatter { - fn package_start(&self, package_name: &str, test_count: usize) -> std::io::Result<()> { + fn package_start_async(&self, _package_name: &str, _test_count: usize) -> std::io::Result<()> { + Ok(()) + } + + fn package_start_sync(&self, package_name: &str, test_count: usize) -> std::io::Result<()> { package_start(package_name, test_count) } - fn test_end( + fn test_start_async(&self, _name: &str, _package_name: &str) -> std::io::Result<()> { + Ok(()) + } + + fn test_end_async( + &self, + _test_result: &TestResult, + _file_manager: &FileManager, + _show_output: bool, + _deny_warnings: bool, + _silence_warnings: bool, + ) -> std::io::Result<()> { + Ok(()) + } + + fn test_end_sync( &self, test_result: &TestResult, current_test_count: usize, @@ -322,17 +389,25 @@ impl Formatter for TerseFormatter { pub(super) struct JsonFormatter; impl Formatter for JsonFormatter { - fn package_start(&self, package_name: &str, test_count: usize) -> std::io::Result<()> { + fn package_start_async(&self, package_name: &str, test_count: usize) -> std::io::Result<()> { let json = json!({"type": "suite", "event": "started", "name": package_name, "test_count": test_count}); println!("{json}"); Ok(()) } - fn test_end( + fn package_start_sync(&self, _package_name: &str, _test_count: usize) -> std::io::Result<()> { + Ok(()) + } + + fn test_start_async(&self, name: &str, package_name: &str) -> std::io::Result<()> { + let json = json!({"type": "test", "event": "started", "name": name, "suite": package_name}); + println!("{json}"); + Ok(()) + } + + fn test_end_async( &self, test_result: &TestResult, - _current_test_count: usize, - _total_test_count: usize, file_manager: &FileManager, show_output: bool, _deny_warnings: bool, @@ -392,6 +467,19 @@ impl Formatter for JsonFormatter { Ok(()) } + fn test_end_sync( + &self, + _test_result: &TestResult, + _current_test_count: usize, + _total_test_count: usize, + _file_manager: &FileManager, + _show_output: bool, + _deny_warnings: bool, + _silence_warnings: bool, + ) -> std::io::Result<()> { + Ok(()) + } + fn package_end( &self, _package_name: &str, From e9510d4fe97344d690928c5ff4ea20c6557c52d9 Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Fri, 13 Dec 2024 09:43:01 -0300 Subject: [PATCH 5/8] skipped -> ignored --- tooling/nargo_cli/src/cli/test_cmd/formatters.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs index cd62d88df4e..480c2ffe0af 100644 --- a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs +++ b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs @@ -443,7 +443,7 @@ impl Formatter for JsonFormatter { } } TestStatus::Skipped => { - json.insert("event".to_string(), json!("skipped")); + json.insert("event".to_string(), json!("ignored")); } TestStatus::CompileError(diagnostic) => { json.insert("event".to_string(), json!("failed")); @@ -491,16 +491,16 @@ impl Formatter for JsonFormatter { ) -> std::io::Result<()> { let mut passed = 0; let mut failed = 0; - let mut skipped = 0; + let mut ignored = 0; for test_result in test_results { match &test_result.status { TestStatus::Pass => passed += 1, TestStatus::Fail { .. } | TestStatus::CompileError(..) => failed += 1, - TestStatus::Skipped => skipped += 1, + TestStatus::Skipped => ignored += 1, } } let event = if failed == 0 { "ok" } else { "failed" }; - let json = json!({"type": "suite", "event": event, "passed": passed, "failed": failed, "skipped": skipped}); + let json = json!({"type": "suite", "event": event, "passed": passed, "failed": failed, "ignored": ignored}); println!("{json}"); Ok(()) } From 04c0592e498996af9951aeb46cff72dc8110807f Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Fri, 13 Dec 2024 09:44:24 -0300 Subject: [PATCH 6/8] Adjust comments --- tooling/nargo_cli/src/cli/test_cmd/formatters.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs index 480c2ffe0af..1b9b2d50378 100644 --- a/tooling/nargo_cli/src/cli/test_cmd/formatters.rs +++ b/tooling/nargo_cli/src/cli/test_cmd/formatters.rs @@ -13,16 +13,17 @@ use super::TestResult; /// The order of events is: /// 1. Compilation of all packages happen (in parallel). There's no formatter method for this. /// 2. If compilation is successful, one `package_start_async` for each package. -/// 3. For each test, one `test_start_async` event. +/// 3. For each test, one `test_start_async` event +/// (there's no `test_start_sync` event because it would happen right before `test_end_sync`) /// 4. For each package, sequentially: /// a. A `package_start_sync` event /// b. One `test_end` event for each test /// a. A `package_end` event /// /// The reason we have some `sync` and `async` events is that formatters that show output -/// to humans rely on the `sync` events to show a more readable and understandable output, +/// to humans rely on the `sync` events to show a more predictable output (package by package), /// and formatters that output to a machine-readable format (like JSON) rely on the `async` -/// events to show the results as soon as they are available, regardless of a package ordering. +/// events to show things as soon as they happen, regardless of a package ordering. pub(super) trait Formatter: Send + Sync + RefUnwindSafe { fn package_start_async(&self, package_name: &str, test_count: usize) -> std::io::Result<()>; From 622d8eab2e334b55eb25cdb13fc09df210704c94 Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Fri, 13 Dec 2024 12:17:24 -0300 Subject: [PATCH 7/8] Run external checks with `--format json` --- .github/workflows/test-js-packages.yml | 2 +- scripts/check-critical-libraries.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-js-packages.yml b/.github/workflows/test-js-packages.yml index dde0deed0cf..fac708b712d 100644 --- a/.github/workflows/test-js-packages.yml +++ b/.github/workflows/test-js-packages.yml @@ -591,7 +591,7 @@ jobs: - name: Run nargo test working-directory: ./test-repo/${{ matrix.project.path }} - run: nargo test -q --silence-warnings + run: nargo test --silence-warnings --format json env: NARGO_IGNORE_TEST_FAILURES_FROM_FOREIGN_CALLS: true diff --git a/scripts/check-critical-libraries.sh b/scripts/check-critical-libraries.sh index f8e474d23de..aaa88d55611 100755 --- a/scripts/check-critical-libraries.sh +++ b/scripts/check-critical-libraries.sh @@ -31,7 +31,7 @@ for REPO in ${REPOS_TO_CHECK[@]}; do TAG=$(getLatestReleaseTagForRepo $REPO) git clone $REPO -c advice.detachedHead=false --depth 1 --branch $TAG $TMP_DIR - nargo test -q --program-dir $TMP_DIR + nargo test --program-dir $TMP_DIR --format json rm -rf $TMP_DIR done From 294b0b6bb06678af5c7b4c4890708ce9d4a4a341 Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Fri, 13 Dec 2024 12:42:06 -0300 Subject: [PATCH 8/8] Revert "Run external checks with `--format json`" This reverts commit 622d8eab2e334b55eb25cdb13fc09df210704c94. --- .github/workflows/test-js-packages.yml | 2 +- scripts/check-critical-libraries.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-js-packages.yml b/.github/workflows/test-js-packages.yml index fac708b712d..dde0deed0cf 100644 --- a/.github/workflows/test-js-packages.yml +++ b/.github/workflows/test-js-packages.yml @@ -591,7 +591,7 @@ jobs: - name: Run nargo test working-directory: ./test-repo/${{ matrix.project.path }} - run: nargo test --silence-warnings --format json + run: nargo test -q --silence-warnings env: NARGO_IGNORE_TEST_FAILURES_FROM_FOREIGN_CALLS: true diff --git a/scripts/check-critical-libraries.sh b/scripts/check-critical-libraries.sh index aaa88d55611..f8e474d23de 100755 --- a/scripts/check-critical-libraries.sh +++ b/scripts/check-critical-libraries.sh @@ -31,7 +31,7 @@ for REPO in ${REPOS_TO_CHECK[@]}; do TAG=$(getLatestReleaseTagForRepo $REPO) git clone $REPO -c advice.detachedHead=false --depth 1 --branch $TAG $TMP_DIR - nargo test --program-dir $TMP_DIR --format json + nargo test -q --program-dir $TMP_DIR rm -rf $TMP_DIR done