From 3deacf34f6ab0dcf7e3bf94c0813cc878cf53a99 Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Wed, 27 Sep 2023 12:31:57 -0500 Subject: [PATCH 1/5] Update expired testdata TLS certs Our TLS certs for tests expired Sept 1, 2023. Create a new set for another year. --- development.md | 2 +- testdata/certs/README.md | 2 +- testdata/certs/server.crt | 50 +++++++++---------- testdata/certs/server.key | 100 +++++++++++++++++++------------------- 4 files changed, 77 insertions(+), 77 deletions(-) diff --git a/development.md b/development.md index 57755c05..5bf981ed 100644 --- a/development.md +++ b/development.md @@ -127,7 +127,7 @@ An example of how to create such a certificate follows: ```bash openssl \ req -x509 -newkey rsa:4096 \ - -keyout server.key -out ssl_certs/server.crt \ + -keyout testdata/certs/server.key -out testdata/certs/server.crt \ -days 365 -sha256 -nodes \ -subj '/CN=abq.rwx' \ -extensions san \ diff --git a/testdata/certs/README.md b/testdata/certs/README.md index 3cd28c54..e00c5594 100644 --- a/testdata/certs/README.md +++ b/testdata/certs/README.md @@ -1,4 +1,4 @@ The certificate in this folder are used for integration tests in `crates/abq_cli/tests`. -The certifiacte expires September 1, 2023. +The certifiacte expires September 27, 2024. diff --git a/testdata/certs/server.crt b/testdata/certs/server.crt index 81b696ea..72b48728 100644 --- a/testdata/certs/server.crt +++ b/testdata/certs/server.crt @@ -1,28 +1,28 @@ -----BEGIN CERTIFICATE----- -MIIEvTCCAqWgAwIBAgIJAP6ZpysymZpnMA0GCSqGSIb3DQEBCwUAMBIxEDAOBgNV -BAMMB2FicS5yd3gwHhcNMjIwOTAxMjE0MjAwWhcNMjMwOTAxMjE0MjAwWjASMRAw +MIIEvTCCAqWgAwIBAgIJAIpPWXSXbdNGMA0GCSqGSIb3DQEBCwUAMBIxEDAOBgNV +BAMMB2FicS5yd3gwHhcNMjMwOTI3MTczMTA1WhcNMjQwOTI2MTczMTA1WjASMRAw DgYDVQQDDAdhYnEucnd4MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA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bMCAwEAAaMWMBQwEgYDVR0R +BAswCYIHYWJxLnJ3eDANBgkqhkiG9w0BAQsFAAOCAgEAVvM0GP0IHDmbzvi4+p5i +KcDoMLF5b487Rq6gWfrFNJdBUGdE7s7/ML1nIHqXfSkC0vYbUPbZ4mCqzWUPppoI +KT7VFd2qM8dnCkac1VcZweNavyF0YWqZJUEhvwmsIRGLTy+KPA9/HRAJeGs+8g+r +VCuajTduS9WbEK8PqwIFg9UNfGMotYzW1i8S0OyvXW0qJBOtgDRV6NHZUWUkqMED +c7+6yQ2H2rMDdTgT/7A9+1SEESsh3mXGBklpgYaHhxW5/vQz0ib0ZGNIRnMKkDJf +XgW1lPY7DB1KJeSjS6XDuRoNKUEJ5I/qyj8poDObzKK4/WD32LgPudVqN9yuXn8L +qeFpwuzMT8+Z56BJH5ECuMOr3OU5fVSehfGgwSS1HlY1MvVlctfXqdX3fE5Gfml4 +tfrqAOyoQpEyvN3HbjzmgvwHuPLfSQps9kqxxt/h6x85Pt7oLC8Qyy2Mn3FByMp2 +D2Dz1J2Ba1pXVmm6tCrhqMcwzmIJQoFOSO5SDHw8xi14K5STE/TSJxJXrpzmkXVK +3ojtmkcOnnbai1PZepSwIPSUq49r9ulXjGNigq73TpH6VEb9pkPrIDQ63kYCzZEy +P4jr0v60nBSq7ToJ+jdCXFRO3cB7+tLrWnYixRJ7YoAvsTMIEXfIXmkCgZ1Gyacn +GKfUHq5Fi953yB2iKCITzPI= -----END CERTIFICATE----- diff --git a/testdata/certs/server.key b/testdata/certs/server.key index 08e94965..b6697116 100644 --- a/testdata/certs/server.key +++ b/testdata/certs/server.key @@ -1,52 +1,52 @@ -----BEGIN PRIVATE KEY----- -MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQC0/+ZE1bxI4G37 -wUei20jZib5z7fYJJ4EQltuouH/U1dbn4qjMajIK6Ya7e7Ux63mrYZ+8k9+p43OO -HiUhYZNFkM19K1KcAQ9fcH4g7jbR4xCuzjS1V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6ufrDhs+cCI2LESKhIWawEZ+ +b8hAo63NyZGi6TMuFBO93bua3iBKNiqHYg9HKTOFq26nJzaOgwo6WXttYKgaV15O +6Rhj7QUb5d4EjaNuWXCh6GHjQlq47J7NK6Uk+ED3Z57J6CHijKIHOj7MankJ/DfH +4HWkUFBWvVWUUwxEJUkZjbhSbMFsZA8pXrT1otmBAoIBAQCPhHmX+weudRa2fq/S +nBJr9AXqjreZrdIuRsrNBuPuztoF5r2bNwrJlHqg3VFkxPJAjrIksuLlAB9GJYkg +s9HoPIbO5lj4FD4LZ/x3Lw9jMA5CigqU0lFC4kL3XLyp9foN4c8faWgsBPRVt0PV +en6x0J0iwy4M3zi4GUnGEwcms0Vfr7r3/ieI0UOjSKjNwI7uZjjWdS1okeRmmvFK +yWn0n2MmvNZzWt5fZWkANsEsFDZKKLhejCtOOJkyXJRMnpQwI/fS2aGs1NEmd0iY +ET9DevPhrV82FvDg36jGG2+3LQ93crdwLcUObZ3mrTTEb/vzDxrE6gXnA5e7+eM2 +0yB1AoIBAAsB2f9e+CzKIbp7fWuLlwKWcZf0Y8YvLVPhfBjT/BK20X5IPJlc3for +U9pdaGJ4C87dwaHCI54xt4RYPmIm+isDPgNGFHuP3e9xnp45FPBkqDAx9ObBPyA6 +P6WPxsef7zJiHZfrA0rNNlbbGc21gZEfPMFj+k6SsmVAgZeQHdpz6QOCnwR1yZ+9 +9vZ4J2R0/GYoExHPrSOPYgLzfyDKoa+tj9qfDdLdPHcgGuxAW7sRiPHWghY5wEju +JgZt46xmlXMB25gn8DWP3+5XRAqzfxee6Q6FW14O3OSUU3Ype8VriKMnY0mguLjF +0KRc50Tu0nPYKosi/MV4HYna6UGtPis= -----END PRIVATE KEY----- From cc353b4e1350e76359c8ca8ac3730b4e73cfd5df Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Wed, 27 Sep 2023 12:54:58 -0500 Subject: [PATCH 2/5] Make sure to communicate native runner info even if tests fail Prior to this commit, an ABQ worker that observed a native runner failure would bail with an error, without communicating the native runner's information. This could pose a problem, because if the worker ran any tests, we attempt to write to reporters regardless of whether the worker succeeded or errored. As such, when it is available, make sure to bubble up the native runner information to the reporters, even in error scenarios. --- crates/abq_cli/src/workers.rs | 2 +- crates/abq_cli/tests/cli.rs | 158 ++++++++++++++++++ .../generic_test_runner/src/lib.rs | 36 ++-- .../generic_test_runner/tests/simulation.rs | 11 +- crates/abq_workers/src/workers.rs | 13 +- 5 files changed, 206 insertions(+), 14 deletions(-) diff --git a/crates/abq_cli/src/workers.rs b/crates/abq_cli/src/workers.rs index ee0eeee8..46daa2a8 100644 --- a/crates/abq_cli/src/workers.rs +++ b/crates/abq_cli/src/workers.rs @@ -152,7 +152,7 @@ async fn do_shutdown( .. } = worker_pool.shutdown().await; - tracing::debug!("Workers shutdown"); + tracing::debug!(?status, "Workers shutdown"); let finalized_reporters = reporting_handle.join().await; diff --git a/crates/abq_cli/tests/cli.rs b/crates/abq_cli/tests/cli.rs index 448b3da5..4588c8ff 100644 --- a/crates/abq_cli/tests/cli.rs +++ b/crates/abq_cli/tests/cli.rs @@ -4735,3 +4735,161 @@ fn warn_on_different_runner_command() { term(queue_proc); } + +#[test] +#[with_protocol_version] +#[serial] +fn write_partial_rwx_v1_json_results_on_early_runner_termination() { + let name = "warn_on_different_runner_command"; + let conf = CSConfigOptions { + use_auth_token: true, + tls: true, + }; + + let (_queue_proc, queue_addr) = setup_queue!(name, conf); + + let proto = AbqProtocolVersion::V0_2.get_supported_witness().unwrap(); + + let manifest = vec![ + TestOrGroup::test(Test::new( + proto, + "test1".to_string(), + [], + Default::default(), + )), + TestOrGroup::test(Test::new( + proto, + "test2".to_string(), + [], + Default::default(), + )), + ]; + + let manifest = ManifestMessage::new(Manifest::new(manifest, Default::default())); + + let simulation = [ + Connect, + // + // Write spawn message + OpaqueWrite(pack(legal_spawned_message(proto))), + // + // Write the manifest if we need to. + // Otherwise handle the one test. + IfGenerateManifest { + then_do: vec![OpaqueWrite(pack(&manifest))], + else_do: vec![ + // + // Read init context message + write ACK + OpaqueRead, + OpaqueWrite(pack(InitSuccessMessage::new(proto))), + // Read first test, write okay + OpaqueRead, + OpaqueWrite(pack(RawTestResultMessage::fake(proto))), + // Read second test, bail + OpaqueRead, + Exit(1), + ], + }, + // + // Finish + Exit(0), + ]; + + let packed = pack_msgs_to_disk(simulation); + let rwx_v1_json = tempfile::NamedTempFile::new().unwrap(); + + let test_args = { + let simulator = native_runner_simulation_bin(); + let simfile_path = packed.path.display().to_string(); + let rwx_v1_json_path = rwx_v1_json.path().display().to_string(); + let args = vec![ + format!("test"), + format!("--worker=0"), + format!("--queue-addr={queue_addr}"), + format!("--run-id=test-run-id"), + format!("--reporter=rwx-v1-json={rwx_v1_json_path}"), + ]; + let mut args = conf.extend_args_for_client(args); + args.extend([s!("--"), simulator, simfile_path]); + args + }; + + let CmdOutput { + stdout, + stderr, + exit_status, + } = Abq::new(format!("{name}_worker0")).args(test_args).run(); + + assert!(!exit_status.success()); + assert_eq!(exit_status.code(), Some(ExitCode::ABQ_ERROR.get())); + + assert!( + stdout.contains("2 tests, 1 failures"), + "STDOUT:\n{stdout}\nSTDERR:\n{stderr}" + ); + assert!( + stderr.contains("ABQ had an error communicating with the native runner"), + "STDOUT:\n{stdout}\nSTDERR:\n{stderr}" + ); + + let rwx_v1_json = std::fs::read_to_string(rwx_v1_json.path()).unwrap(); + let rwx_v1_json: serde_json::Value = serde_json::from_str(&rwx_v1_json).unwrap(); + insta::assert_json_snapshot!(rwx_v1_json, { + }, @r###" + { + "$schema": "https://raw.githubusercontent.com/rwx-research/test-results-schema/main/v1.json", + "framework": { + "kind": "RSpec", + "language": "Ruby" + }, + "summary": { + "canceled": 0, + "failed": 0, + "otherErrors": 1, + "pended": 0, + "quarantined": 0, + "retries": 0, + "skipped": 0, + "status": { + "kind": "failed" + }, + "successful": 1, + "tests": 1, + "timedOut": 0, + "todo": 0 + }, + "tests": [ + { + "attempt": { + "durationInNanoseconds": 0, + "finishedAt": "1994-11-05T13:17:30Z", + "meta": { + "abq_metadata": { + "runner": 1, + "worker": 0 + } + }, + "startedAt": "1994-11-05T13:15:30Z", + "status": { + "kind": "successful" + }, + "stderr": "", + "stdout": "" + }, + "id": "zzz-faux", + "lineage": [ + "TopLevel", + "SubModule", + "Test" + ], + "location": { + "column": 15, + "file": "a/b/x.file", + "line": 10 + }, + "name": "zzz-faux" + } + ] + } + "###); +} diff --git a/crates/abq_runners/generic_test_runner/src/lib.rs b/crates/abq_runners/generic_test_runner/src/lib.rs index b7c19be3..0fe366ec 100644 --- a/crates/abq_runners/generic_test_runner/src/lib.rs +++ b/crates/abq_runners/generic_test_runner/src/lib.rs @@ -89,8 +89,8 @@ impl RunnerConnection { } } -#[derive(Debug)] -pub struct NativeRunnerInfo { +#[derive(Debug, Clone)] +pub struct NativeRunnerConfiguration { protocol: ProtocolWitness, specification: NativeRunnerSpecification, } @@ -103,7 +103,7 @@ pub struct NativeRunnerInfo { pub async fn open_native_runner_connection( listener: &mut TcpListener, timeout: Duration, -) -> Result<(NativeRunnerInfo, RunnerConnection), GenericRunnerErrorKind> { +) -> Result<(NativeRunnerConfiguration, RunnerConnection), GenericRunnerErrorKind> { let start = Instant::now(); let ( NativeRunnerSpawnedMessage { @@ -134,7 +134,7 @@ pub async fn open_native_runner_connection( match protocol_version.get_supported_witness() { None => Err(ProtocolVersionError::NotCompatible.into()), Some(witness) => { - let runner_info = NativeRunnerInfo { + let runner_info = NativeRunnerConfiguration { protocol: witness, specification: runner_specification, }; @@ -148,6 +148,7 @@ macro_rules! try_setup { $err.located(here!()).map_err(|e| GenericRunnerError { error: e, output: StdioOutput::empty(), + native_runner_info: None, })? }; } @@ -177,12 +178,14 @@ async fn retrieve_manifest<'a>( return Err(GenericRunnerError { error, output: final_stdio_output.into(), + native_runner_info: Some(native_runner.get_native_runner_info()), }); } Err(error) => { return Err(GenericRunnerError { error, output: final_stdio_output.into(), + native_runner_info: Some(native_runner.get_native_runner_info()), }); } } @@ -227,7 +230,7 @@ pub enum GenericRunnerErrorKind { Io(#[from] io::Error), #[error("{0}")] ProtocolVersion(#[from] ProtocolVersionError), - #[error("{0}")] + #[error("ABQ had an error communicating with the native runner: {0}")] NativeRunner(#[from] NativeTestRunnerError), } @@ -235,6 +238,7 @@ pub enum GenericRunnerErrorKind { pub struct GenericRunnerError { pub error: LocatedError, pub output: StdioOutput, + pub native_runner_info: Option, } impl std::fmt::Display for GenericRunnerError { @@ -244,10 +248,14 @@ impl std::fmt::Display for GenericRunnerError { } impl GenericRunnerError { - pub fn no_captures(kind: LocatedError) -> Self { + pub fn no_captures( + kind: LocatedError, + native_runner_info: Option, + ) -> Self { Self { error: kind, output: StdioOutput::empty(), + native_runner_info, } } } @@ -348,7 +356,7 @@ struct NativeRunnerState { // Needed to keep the port alive. _tcp_listener: TcpListener, conn: RunnerConnection, - runner_info: NativeRunnerInfo, + runner_info: NativeRunnerConfiguration, runner_meta: RunnerMeta, for_manifest_generation: bool, } @@ -508,7 +516,11 @@ impl<'a> NativeRunnerHandle<'a> { protocol_version_timeout, ) .await; - return Err(GenericRunnerError { error, output }); + return Err(GenericRunnerError { + error, + output, + native_runner_info: None, + }); } }; @@ -665,10 +677,10 @@ impl<'a> NativeRunnerHandle<'a> { Ok(()) } - fn get_native_runner_info(self) -> queue::NativeRunnerInfo { + fn get_native_runner_info(&self) -> queue::NativeRunnerInfo { queue::NativeRunnerInfo { protocol_version: self.state.runner_info.protocol.get_version(), - specification: self.state.runner_info.specification, + specification: self.state.runner_info.specification.clone(), } } } @@ -858,6 +870,7 @@ async fn run_help( Err(err) => Err(GenericRunnerError { error: err, output: StdioOutput { stderr, stdout }, + native_runner_info: Some(native_runner_handle.get_native_runner_info()), }), } } @@ -899,7 +912,7 @@ async fn execute_all_tests<'a>( runner_meta: RunnerMeta, test_timeout: Duration, ) -> Result { - let NativeRunnerInfo { + let NativeRunnerConfiguration { protocol: _, specification: runner_spec, } = &native_runner_handle.runner_info; @@ -1531,6 +1544,7 @@ pub fn execute_wrapped_runner( return Err(GenericRunnerError { error: io::Error::new(io::ErrorKind::InvalidInput, error).located(here!()), output: StdioOutput::empty(), + native_runner_info: None, }); } diff --git a/crates/abq_runners/generic_test_runner/tests/simulation.rs b/crates/abq_runners/generic_test_runner/tests/simulation.rs index 004b2de5..62225f7c 100644 --- a/crates/abq_runners/generic_test_runner/tests/simulation.rs +++ b/crates/abq_runners/generic_test_runner/tests/simulation.rs @@ -633,7 +633,16 @@ fn native_runner_fails_while_executing_tests() { let (error, mut results, _notified_all_run) = run_simulated_runner_to_error(simulation, None, Box::new(get_next_tests)); - let GenericRunnerError { error: _, output } = error; + let GenericRunnerError { + error: _, + output, + native_runner_info, + } = error; + + assert!( + native_runner_info.is_some(), + "Native runner info should be defined because some tests ran" + ); check_bytes!(&output.stdout, b"I failed catastrophically"); check_bytes!( diff --git a/crates/abq_workers/src/workers.rs b/crates/abq_workers/src/workers.rs index 30308666..d69dae9f 100644 --- a/crates/abq_workers/src/workers.rs +++ b/crates/abq_workers/src/workers.rs @@ -303,7 +303,10 @@ impl WorkerPool { Err(GenericRunnerError { error: kind, output, + native_runner_info: this_native_runner_info, }) => { + native_runner_info = native_runner_info.or(this_native_runner_info); + let LocatedError { error, location: Location { file, line, column }, @@ -538,6 +541,7 @@ async fn start_test_like_runner( return Err(GenericRunnerError::no_captures( io::Error::new(io::ErrorKind::Unsupported, "will not return manifest") .located(here!()), + None, )); } TestLikeRunner::ExitWith(ec) => { @@ -572,6 +576,7 @@ async fn start_test_like_runner( .await; return Err(GenericRunnerError::no_captures( GenericRunnerErrorKind::NativeRunner(oob.into()).located(here!()), + None, )); } }; @@ -649,7 +654,12 @@ async fn test_like_runner_exec_loop( 'tests_done: loop { let NextWorkBundle { work, eow } = match tests_fetcher.get_next_tests().await { Ok(bundle) => bundle, - Err(e) => return Some(Err(GenericRunnerError::no_captures(e.located(here!())))), + Err(e) => { + return Some(Err(GenericRunnerError::no_captures( + e.located(here!()), + None, + ))) + } }; for WorkerTest { @@ -661,6 +671,7 @@ async fn test_like_runner_exec_loop( return Some(Err(GenericRunnerError::no_captures( io::Error::new(io::ErrorKind::Unsupported, "will not return test") .located(here!()), + None, ))); } From ab46fcb7d61e398b8e0c9790ebdd5ea124940825 Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Wed, 27 Sep 2023 12:59:35 -0500 Subject: [PATCH 3/5] Unconditionally use "other" framework if native runner info is missing Although the native runner info will be filled in the rwx v1 json reporter whenever possible, as a defensive strategy to avoid bailing out from runs, use the "other" specification if there are cases where the runner info is missing. --- crates/reporters/rwx_v1_json/src/lib.rs | 35 ++++++++--- ...n_framework_if_runner_info_is_missing.snap | 60 +++++++++++++++++++ 2 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_unknown_framework_if_runner_info_is_missing.snap diff --git a/crates/reporters/rwx_v1_json/src/lib.rs b/crates/reporters/rwx_v1_json/src/lib.rs index 8238e564..b1ee0419 100644 --- a/crates/reporters/rwx_v1_json/src/lib.rs +++ b/crates/reporters/rwx_v1_json/src/lib.rs @@ -522,13 +522,7 @@ impl Collector { let framework = match runner_specification { Some(spec) => spec.into(), - None => { - assert!( - reified_schema_tests.is_empty(), - "runner specification may only be unknown if no tests were run on a node" - ); - Framework::other() - } + None => Framework::other(), }; TestResults { @@ -914,4 +908,31 @@ mod test { let json = String::from_utf8(buf).expect("not utf8 JSON"); insta::assert_snapshot!(json) } + + #[test] + fn generates_rwx_v1_json_with_unknown_framework_if_runner_info_is_missing() { + let mut collector = Collector::default(); + + collector.push_result(&TestResult::new( + RunnerMeta::fake(), + TestResultSpec { + status: Status::Failure { + exception: None, + backtrace: None, + }, + id: "id1".to_string(), + display_name: "app::module::test1".to_string(), + output: Some("I failed once".to_string()), + ..TestResultSpec::fake() + }, + )); + + let mut buf = vec![]; + collector + .write_json_pretty(&mut buf, None) + .expect("failed to write"); + + let json = String::from_utf8(buf).expect("not utf8 JSON"); + insta::assert_snapshot!(json) + } } diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_unknown_framework_if_runner_info_is_missing.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_unknown_framework_if_runner_info_is_missing.snap new file mode 100644 index 00000000..9577aad8 --- /dev/null +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_unknown_framework_if_runner_info_is_missing.snap @@ -0,0 +1,60 @@ +--- +source: crates/reporters/rwx_v1_json/src/lib.rs +expression: json +--- +{ + "$schema": "https://raw.githubusercontent.com/rwx-research/test-results-schema/main/v1.json", + "framework": { + "kind": "other", + "language": "other" + }, + "summary": { + "status": { + "kind": "failed" + }, + "tests": 1, + "otherErrors": 0, + "retries": 0, + "canceled": 0, + "failed": 1, + "pended": 0, + "quarantined": 0, + "skipped": 0, + "successful": 0, + "timedOut": 0, + "todo": 0 + }, + "tests": [ + { + "id": "id1", + "name": "app::module::test1", + "lineage": [ + "TopLevel", + "SubModule", + "Test" + ], + "location": { + "file": "a/b/x.file", + "line": 10, + "column": 15 + }, + "attempt": { + "durationInNanoseconds": 0, + "meta": { + "abq_metadata": { + "runner": 1, + "worker": 0 + } + }, + "status": { + "kind": "failed", + "message": "I failed once" + }, + "stderr": "my stdout", + "stdout": "my stderr", + "startedAt": "1994-11-05T13:15:30Z", + "finishedAt": "1994-11-05T13:17:30Z" + } + } + ] +} From 1bdf0d84faa6df1d1b767b727843cd4610110571 Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Wed, 27 Sep 2023 13:21:20 -0500 Subject: [PATCH 4/5] Report native runner errors as "other errors" in the rwx v1 json reporter --- crates/abq_cli/src/report.rs | 1 + crates/abq_cli/src/reporting.rs | 2 +- crates/abq_cli/src/workers.rs | 6 +- crates/abq_cli/tests/cli.rs | 7 +- crates/abq_reporting/src/lib.rs | 1 + .../abq_reporting_test_utils/src/lib.rs | 1 + crates/abq_workers/src/workers.rs | 7 ++ crates/reporters/rwx_v1_json/src/lib.rs | 119 +++++++++++++++--- ...rwx_v1_json_for_all_statuses__compact.snap | 2 +- ..._rwx_v1_json_for_all_statuses__pretty.snap | 3 +- ..._v1_json_for_successful_runs__compact.snap | 2 +- ...x_v1_json_for_successful_runs__pretty.snap | 3 +- ..._json_with_retries_ultimately_failing.snap | 3 +- ...on_with_retries_ultimately_succeeding.snap | 3 +- ...n_framework_if_runner_info_is_missing.snap | 3 +- ...x_v1_json__test__javascript_jest_lang.snap | 3 +- ...tive_runner_error_seen_as_other_error.snap | 3 +- ...st__retries_with_nested_past_attempts.snap | 3 +- ...bq_rwx_v1_json__test__ruby_rspec_lang.snap | 3 +- ...t__writes_passed_other_error_messages.snap | 68 ++++++++++ 20 files changed, 212 insertions(+), 31 deletions(-) create mode 100644 crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__writes_passed_other_error_messages.snap diff --git a/crates/abq_cli/src/report.rs b/crates/abq_cli/src/report.rs index 6b81724d..91b9dc6a 100644 --- a/crates/abq_cli/src/report.rs +++ b/crates/abq_cli/src/report.rs @@ -181,6 +181,7 @@ fn process_results( let completed_summary = &CompletedSummary { native_runner_info: Some(native_runner_info), + other_error_messages: vec![], }; for reporter in reporters { diff --git a/crates/abq_cli/src/reporting.rs b/crates/abq_cli/src/reporting.rs index a436999a..92a84f20 100644 --- a/crates/abq_cli/src/reporting.rs +++ b/crates/abq_cli/src/reporting.rs @@ -229,7 +229,7 @@ impl Reporter for RwxV1JsonReporter { .map(|runner| &runner.specification); self.collector - .write_json(fd, opt_specification) + .write_json(fd, opt_specification, summary.other_error_messages.clone()) .map_err(|_| ReportingError::FailedToFormat)?; Ok(()) diff --git a/crates/abq_cli/src/workers.rs b/crates/abq_cli/src/workers.rs index 46daa2a8..016c6909 100644 --- a/crates/abq_cli/src/workers.rs +++ b/crates/abq_cli/src/workers.rs @@ -174,7 +174,11 @@ async fn do_shutdown( } let native_runner_info = native_runner_info.clone(); - let completed_summary = CompletedSummary { native_runner_info }; + let other_error_messages = status.error_messages().cloned().unwrap_or_default(); + let completed_summary = CompletedSummary { + native_runner_info, + other_error_messages, + }; let (suite_result, errors) = finalized_reporters.finish(&completed_summary); diff --git a/crates/abq_cli/tests/cli.rs b/crates/abq_cli/tests/cli.rs index 4588c8ff..d4a866be 100644 --- a/crates/abq_cli/tests/cli.rs +++ b/crates/abq_cli/tests/cli.rs @@ -4842,10 +4842,15 @@ fn write_partial_rwx_v1_json_results_on_early_runner_termination() { "kind": "RSpec", "language": "Ruby" }, + "otherErrors": [ + { + "message": "ABQ had an error communicating with the native runner: early eof at crates/abq_runners/generic_test_runner/src/lib.rs@1035:87" + } + ], "summary": { "canceled": 0, "failed": 0, - "otherErrors": 1, + "otherErrors": 2, "pended": 0, "quarantined": 0, "retries": 0, diff --git a/crates/abq_reporting/src/lib.rs b/crates/abq_reporting/src/lib.rs index 5d7db58e..bc683306 100644 --- a/crates/abq_reporting/src/lib.rs +++ b/crates/abq_reporting/src/lib.rs @@ -16,6 +16,7 @@ pub struct CompletedSummary { /// The native test runner that was in use for this test run. /// Can be [None] if the returned worker never ran any tests. pub native_runner_info: Option, + pub other_error_messages: Vec, } #[derive(Debug, Error)] diff --git a/crates/abq_test_support/abq_reporting_test_utils/src/lib.rs b/crates/abq_test_support/abq_reporting_test_utils/src/lib.rs index 35b05a14..788457f1 100644 --- a/crates/abq_test_support/abq_reporting_test_utils/src/lib.rs +++ b/crates/abq_test_support/abq_reporting_test_utils/src/lib.rs @@ -53,6 +53,7 @@ pub fn mock_summary() -> CompletedSummary { host: "zmachine".to_owned(), }, }), + other_error_messages: vec![], } } diff --git a/crates/abq_workers/src/workers.rs b/crates/abq_workers/src/workers.rs index d69dae9f..e61c414f 100644 --- a/crates/abq_workers/src/workers.rs +++ b/crates/abq_workers/src/workers.rs @@ -110,6 +110,13 @@ pub enum WorkersExitStatus { impl WorkersExitStatus { pub const SUCCESS: Self = Self::Completed(ExitCode::SUCCESS); + + pub fn error_messages(&self) -> Option<&Vec> { + match self { + Self::Completed(_) => None, + Self::Error { errors } => Some(errors), + } + } } #[derive(Debug)] diff --git a/crates/reporters/rwx_v1_json/src/lib.rs b/crates/reporters/rwx_v1_json/src/lib.rs index b1ee0419..cde077ea 100644 --- a/crates/reporters/rwx_v1_json/src/lib.rs +++ b/crates/reporters/rwx_v1_json/src/lib.rs @@ -4,7 +4,10 @@ use std::{collections::HashMap, io::Write, ops::Deref}; use abq_utils::net_protocol::{ entity::RunnerMeta, - runners::{self, NativeRunnerSpecification, Status, TestResult, TestResultSpec, TestRuntime}, + runners::{ + self, MetadataMap, NativeRunnerSpecification, Status, TestResult, TestResultSpec, + TestRuntime, + }, }; // Note: this is intentionally permissive right now for `kind` and `language` until we have @@ -159,6 +162,10 @@ impl Summary { self.status = SummaryStatus::Failed; } } + + fn account_other_errors(&mut self, len: u64) { + self.other_errors += len; + } } #[derive(Serialize, Deserialize, Clone)] @@ -418,6 +425,31 @@ impl From<&TestResult> for TestSketch { } } +#[derive(Serialize, Deserialize, Clone)] +struct OtherError { + #[serde(skip_serializing_if = "Option::is_none")] + location: Option, + #[serde(skip_serializing_if = "Option::is_none")] + meta: Option, + #[serde(skip_serializing_if = "Option::is_none")] + exception: Option, + message: String, + #[serde(skip_serializing_if = "Option::is_none")] + backtrace: Option>, +} + +impl OtherError { + fn from_message(message: String) -> Self { + Self { + location: None, + meta: None, + exception: None, + message, + backtrace: None, + } + } +} + // Note: this does not currently implement support for otherErrors nor derivedFrom // derivedFrom is not necessary for ABQ (it's not parsing original test results files) // otherErrors are not exposed to the reporters right now @@ -428,6 +460,8 @@ pub struct TestResults { framework: Framework, summary: Summary, tests: Vec, + #[serde(rename = "otherErrors")] + other_errors: Vec, } #[derive(Default, Clone)] @@ -492,25 +526,38 @@ impl Collector { self, writer: impl Write, runner_specification: Option<&NativeRunnerSpecification>, + other_error_messages: Vec, ) -> Result<(), String> { - serde_json::to_writer(writer, &self.test_results(runner_specification)) - .map_err(|e| e.to_string()) + serde_json::to_writer( + writer, + &self.test_results(runner_specification, other_error_messages), + ) + .map_err(|e| e.to_string()) } pub fn write_json_pretty( self, writer: impl Write, runner_specification: Option<&NativeRunnerSpecification>, + other_error_messages: Vec, ) -> Result<(), String> { - serde_json::to_writer_pretty(writer, &self.test_results(runner_specification)) - .map_err(|e| e.to_string()) + serde_json::to_writer_pretty( + writer, + &self.test_results(runner_specification, other_error_messages), + ) + .map_err(|e| e.to_string()) } - fn test_results(self, runner_specification: Option<&NativeRunnerSpecification>) -> TestResults { + fn test_results( + self, + runner_specification: Option<&NativeRunnerSpecification>, + other_error_messages: Vec, + ) -> TestResults { let mut summary = Summary::default(); self.tests.values().for_each(|test| summary.account(test)); summary.account_native_runner_errors(self.native_runner_errors); + summary.account_other_errors(other_error_messages.len() as _); let reified_schema_tests = if cfg!(test) { let mut ordered_tests: Vec = self.tests.into_values().map(Into::into).collect(); @@ -525,6 +572,11 @@ impl Collector { None => Framework::other(), }; + let other_errors = other_error_messages + .into_iter() + .map(OtherError::from_message) + .collect(); + TestResults { schema: "https://raw.githubusercontent.com/rwx-research/test-results-schema/main/v1.json" @@ -532,6 +584,7 @@ impl Collector { framework, summary, tests: reified_schema_tests, + other_errors, } } } @@ -626,7 +679,7 @@ mod test { let mut buf = vec![]; collector .clone() - .write_json(&mut buf, Some(&NativeRunnerSpecification::fake())) + .write_json(&mut buf, Some(&NativeRunnerSpecification::fake()), vec![]) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); insta::assert_snapshot!("generates_rwx_v1_json_for_all_statuses__compact", json) @@ -636,7 +689,7 @@ mod test { let mut buf = vec![]; collector .clone() - .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake())) + .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake()), vec![]) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); insta::assert_snapshot!("generates_rwx_v1_json_for_all_statuses__pretty", json) @@ -664,7 +717,7 @@ mod test { let mut buf = vec![]; collector .clone() - .write_json(&mut buf, Some(&NativeRunnerSpecification::fake())) + .write_json(&mut buf, Some(&NativeRunnerSpecification::fake()), vec![]) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); insta::assert_snapshot!("generates_rwx_v1_json_for_successful_runs__compact", json) @@ -674,7 +727,7 @@ mod test { let mut buf = vec![]; collector .clone() - .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake())) + .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake()), vec![]) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); insta::assert_snapshot!("generates_rwx_v1_json_for_successful_runs__pretty", json) @@ -729,7 +782,7 @@ mod test { let mut buf = vec![]; collector - .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake())) + .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake()), vec![]) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); @@ -781,7 +834,7 @@ mod test { let mut buf = vec![]; collector - .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake())) + .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake()), vec![]) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); @@ -842,7 +895,7 @@ mod test { let mut buf = vec![]; collector - .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake())) + .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake()), vec![]) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); @@ -858,7 +911,7 @@ mod test { let mut buf = vec![]; collector - .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake())) + .write_json_pretty(&mut buf, Some(&NativeRunnerSpecification::fake()), vec![]) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); @@ -881,7 +934,7 @@ mod test { let mut buf = vec![]; collector - .write_json_pretty(&mut buf, Some(&runner_spec)) + .write_json_pretty(&mut buf, Some(&runner_spec), vec![]) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); insta::assert_snapshot!(json) @@ -903,7 +956,7 @@ mod test { let mut buf = vec![]; collector - .write_json_pretty(&mut buf, Some(&runner_spec)) + .write_json_pretty(&mut buf, Some(&runner_spec), vec![]) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); insta::assert_snapshot!(json) @@ -929,7 +982,39 @@ mod test { let mut buf = vec![]; collector - .write_json_pretty(&mut buf, None) + .write_json_pretty(&mut buf, None, vec![]) + .expect("failed to write"); + + let json = String::from_utf8(buf).expect("not utf8 JSON"); + insta::assert_snapshot!(json) + } + + #[test] + fn writes_passed_other_error_messages() { + let mut collector = Collector::default(); + + collector.push_result(&TestResult::new( + RunnerMeta::fake(), + TestResultSpec { + status: Status::Failure { + exception: None, + backtrace: None, + }, + id: "id1".to_string(), + display_name: "app::module::test1".to_string(), + output: Some("I failed once".to_string()), + ..TestResultSpec::fake() + }, + )); + + let other_errors = vec![ + "Something else weird happened during in test suite".to_owned(), + "Today, 1 = 2".to_owned(), + ]; + + let mut buf = vec![]; + collector + .write_json_pretty(&mut buf, None, other_errors) .expect("failed to write"); let json = String::from_utf8(buf).expect("not utf8 JSON"); diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_all_statuses__compact.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_all_statuses__compact.snap index 1789d1b7..7ae97016 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_all_statuses__compact.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_all_statuses__compact.snap @@ -2,4 +2,4 @@ source: crates/reporters/rwx_v1_json/src/lib.rs expression: json --- -{"$schema":"https://raw.githubusercontent.com/rwx-research/test-results-schema/main/v1.json","framework":{"kind":"other","language":"other","providedKind":"zframework","providedLanguage":"zlang"},"summary":{"status":{"kind":"failed"},"tests":5,"otherErrors":0,"retries":0,"canceled":0,"failed":2,"pended":1,"quarantined":0,"skipped":1,"successful":1,"timedOut":0,"todo":0},"tests":[{"id":"id1","name":"app::module::test1","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":11000000,"meta":{"abq_metadata":{"runner":1,"worker":3},"some":"value"},"status":{"kind":"successful"},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}},{"id":"id2","name":"app::module::test2","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":22000000,"meta":{"abq_metadata":{"runner":4,"worker":2}},"status":{"kind":"failed","exception":"test-exception","message":"Test 2 failed","backtrace":["file1.cpp:10","file2.cpp:20"]},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}},{"id":"id3","name":"app::module::test3","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":33000000,"meta":{"abq_metadata":{"runner":8,"worker":1}},"status":{"kind":"failed"},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}},{"id":"id4","name":"app::module::test4","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":44000000,"meta":{"abq_metadata":{"runner":3,"worker":0}},"status":{"kind":"pended","message":"Test 4 pending"},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}},{"id":"id5","name":"app::module::test5","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":55000000,"meta":{"abq_metadata":{"runner":1,"worker":5}},"status":{"kind":"skipped"},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}}]} +{"$schema":"https://raw.githubusercontent.com/rwx-research/test-results-schema/main/v1.json","framework":{"kind":"other","language":"other","providedKind":"zframework","providedLanguage":"zlang"},"summary":{"status":{"kind":"failed"},"tests":5,"otherErrors":0,"retries":0,"canceled":0,"failed":2,"pended":1,"quarantined":0,"skipped":1,"successful":1,"timedOut":0,"todo":0},"tests":[{"id":"id1","name":"app::module::test1","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":11000000,"meta":{"abq_metadata":{"runner":1,"worker":3},"some":"value"},"status":{"kind":"successful"},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}},{"id":"id2","name":"app::module::test2","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":22000000,"meta":{"abq_metadata":{"runner":4,"worker":2}},"status":{"kind":"failed","exception":"test-exception","message":"Test 2 failed","backtrace":["file1.cpp:10","file2.cpp:20"]},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}},{"id":"id3","name":"app::module::test3","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":33000000,"meta":{"abq_metadata":{"runner":8,"worker":1}},"status":{"kind":"failed"},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}},{"id":"id4","name":"app::module::test4","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":44000000,"meta":{"abq_metadata":{"runner":3,"worker":0}},"status":{"kind":"pended","message":"Test 4 pending"},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}},{"id":"id5","name":"app::module::test5","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":55000000,"meta":{"abq_metadata":{"runner":1,"worker":5}},"status":{"kind":"skipped"},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}}],"otherErrors":[]} diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_all_statuses__pretty.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_all_statuses__pretty.snap index 5afc51ff..45e48dc4 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_all_statuses__pretty.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_all_statuses__pretty.snap @@ -185,5 +185,6 @@ expression: json "finishedAt": "1994-11-05T13:17:30Z" } } - ] + ], + "otherErrors": [] } diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_successful_runs__compact.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_successful_runs__compact.snap index 651b3369..0e913931 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_successful_runs__compact.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_successful_runs__compact.snap @@ -2,4 +2,4 @@ source: crates/reporters/rwx_v1_json/src/lib.rs expression: json --- -{"$schema":"https://raw.githubusercontent.com/rwx-research/test-results-schema/main/v1.json","framework":{"kind":"other","language":"other","providedKind":"zframework","providedLanguage":"zlang"},"summary":{"status":{"kind":"successful"},"tests":1,"otherErrors":0,"retries":0,"canceled":0,"failed":0,"pended":0,"quarantined":0,"skipped":0,"successful":1,"timedOut":0,"todo":0},"tests":[{"id":"id1","name":"app::module::test1","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":11000000,"meta":{"abq_metadata":{"runner":1,"worker":0}},"status":{"kind":"successful"},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}}]} +{"$schema":"https://raw.githubusercontent.com/rwx-research/test-results-schema/main/v1.json","framework":{"kind":"other","language":"other","providedKind":"zframework","providedLanguage":"zlang"},"summary":{"status":{"kind":"successful"},"tests":1,"otherErrors":0,"retries":0,"canceled":0,"failed":0,"pended":0,"quarantined":0,"skipped":0,"successful":1,"timedOut":0,"todo":0},"tests":[{"id":"id1","name":"app::module::test1","lineage":["TopLevel","SubModule","Test"],"location":{"file":"a/b/x.file","line":10,"column":15},"attempt":{"durationInNanoseconds":11000000,"meta":{"abq_metadata":{"runner":1,"worker":0}},"status":{"kind":"successful"},"stderr":"my stdout","stdout":"my stderr","startedAt":"1994-11-05T13:15:30Z","finishedAt":"1994-11-05T13:17:30Z"}}],"otherErrors":[]} diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_successful_runs__pretty.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_successful_runs__pretty.snap index b2eedaa6..9b6b7a07 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_successful_runs__pretty.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_for_successful_runs__pretty.snap @@ -57,5 +57,6 @@ expression: json "finishedAt": "1994-11-05T13:17:30Z" } } - ] + ], + "otherErrors": [] } diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_retries_ultimately_failing.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_retries_ultimately_failing.snap index 121aa442..85986993 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_retries_ultimately_failing.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_retries_ultimately_failing.snap @@ -94,5 +94,6 @@ expression: json } ] } - ] + ], + "otherErrors": [] } diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_retries_ultimately_succeeding.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_retries_ultimately_succeeding.snap index 5f1603ee..db1728a1 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_retries_ultimately_succeeding.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_retries_ultimately_succeeding.snap @@ -93,5 +93,6 @@ expression: json } ] } - ] + ], + "otherErrors": [] } diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_unknown_framework_if_runner_info_is_missing.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_unknown_framework_if_runner_info_is_missing.snap index 9577aad8..6134c208 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_unknown_framework_if_runner_info_is_missing.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__generates_rwx_v1_json_with_unknown_framework_if_runner_info_is_missing.snap @@ -56,5 +56,6 @@ expression: json "finishedAt": "1994-11-05T13:17:30Z" } } - ] + ], + "otherErrors": [] } diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__javascript_jest_lang.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__javascript_jest_lang.snap index 2f3b6aa4..40a8615e 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__javascript_jest_lang.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__javascript_jest_lang.snap @@ -24,5 +24,6 @@ expression: json "timedOut": 0, "todo": 0 }, - "tests": [] + "tests": [], + "otherErrors": [] } diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__native_runner_error_seen_as_other_error.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__native_runner_error_seen_as_other_error.snap index 2cc9f4e7..9f9e10cb 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__native_runner_error_seen_as_other_error.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__native_runner_error_seen_as_other_error.snap @@ -26,5 +26,6 @@ expression: json "timedOut": 0, "todo": 0 }, - "tests": [] + "tests": [], + "otherErrors": [] } diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__retries_with_nested_past_attempts.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__retries_with_nested_past_attempts.snap index f39d1147..26d3b3e1 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__retries_with_nested_past_attempts.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__retries_with_nested_past_attempts.snap @@ -111,5 +111,6 @@ expression: json } ] } - ] + ], + "otherErrors": [] } diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__ruby_rspec_lang.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__ruby_rspec_lang.snap index e5cb8af5..2ee13a5c 100644 --- a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__ruby_rspec_lang.snap +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__ruby_rspec_lang.snap @@ -24,5 +24,6 @@ expression: json "timedOut": 0, "todo": 0 }, - "tests": [] + "tests": [], + "otherErrors": [] } diff --git a/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__writes_passed_other_error_messages.snap b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__writes_passed_other_error_messages.snap new file mode 100644 index 00000000..925d8a61 --- /dev/null +++ b/crates/reporters/rwx_v1_json/src/snapshots/abq_rwx_v1_json__test__writes_passed_other_error_messages.snap @@ -0,0 +1,68 @@ +--- +source: crates/reporters/rwx_v1_json/src/lib.rs +expression: json +--- +{ + "$schema": "https://raw.githubusercontent.com/rwx-research/test-results-schema/main/v1.json", + "framework": { + "kind": "other", + "language": "other" + }, + "summary": { + "status": { + "kind": "failed" + }, + "tests": 1, + "otherErrors": 2, + "retries": 0, + "canceled": 0, + "failed": 1, + "pended": 0, + "quarantined": 0, + "skipped": 0, + "successful": 0, + "timedOut": 0, + "todo": 0 + }, + "tests": [ + { + "id": "id1", + "name": "app::module::test1", + "lineage": [ + "TopLevel", + "SubModule", + "Test" + ], + "location": { + "file": "a/b/x.file", + "line": 10, + "column": 15 + }, + "attempt": { + "durationInNanoseconds": 0, + "meta": { + "abq_metadata": { + "runner": 1, + "worker": 0 + } + }, + "status": { + "kind": "failed", + "message": "I failed once" + }, + "stderr": "my stdout", + "stdout": "my stderr", + "startedAt": "1994-11-05T13:15:30Z", + "finishedAt": "1994-11-05T13:17:30Z" + } + } + ], + "otherErrors": [ + { + "message": "Something else weird happened during in test suite" + }, + { + "message": "Today, 1 = 2" + } + ] +} From c04e1eaabfd7ba848142429fea43ea70835bef0b Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Wed, 27 Sep 2023 14:01:13 -0500 Subject: [PATCH 5/5] Always capture stderr for tests needing it --- crates/abq_cli/tests/cli.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/abq_cli/tests/cli.rs b/crates/abq_cli/tests/cli.rs index d4a866be..c461de5a 100644 --- a/crates/abq_cli/tests/cli.rs +++ b/crates/abq_cli/tests/cli.rs @@ -4717,11 +4717,17 @@ fn warn_on_different_runner_command() { args }; - let instance1 = Abq::new(format!("{name}_inst1")).args(test_args(0)).run(); + let instance1 = Abq::new(format!("{name}_inst1")) + .args(test_args(0)) + .always_capture_stderr(true) + .run(); assert!(instance1.exit_status.success()); - let instance2 = Abq::new(format!("{name}_inst2")).args(test_args(1)).run(); + let instance2 = Abq::new(format!("{name}_inst2")) + .args(test_args(1)) + .always_capture_stderr(true) + .run(); assert!(instance2.exit_status.success()); @@ -4818,7 +4824,10 @@ fn write_partial_rwx_v1_json_results_on_early_runner_termination() { stdout, stderr, exit_status, - } = Abq::new(format!("{name}_worker0")).args(test_args).run(); + } = Abq::new(format!("{name}_worker0")) + .args(test_args) + .always_capture_stderr(true) + .run(); assert!(!exit_status.success()); assert_eq!(exit_status.code(), Some(ExitCode::ABQ_ERROR.get()));