Unnamed repository; edit this file 'description' to name the repository.
Merge pull request #18897 from duncanawoods/master
fix: Make test_runner::TestState::stdout optional to fix parsing cargo test json output
HKalbasi 2025-01-16
parent 759a9e6 · parent 04c06b4 · commit 7d337c7
-rw-r--r--crates/rust-analyzer/src/test_runner.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/test_runner.rs b/crates/rust-analyzer/src/test_runner.rs
index 503b3ee43a..3edfb812cf 100644
--- a/crates/rust-analyzer/src/test_runner.rs
+++ b/crates/rust-analyzer/src/test_runner.rs
@@ -18,7 +18,11 @@ pub(crate) enum TestState {
Started,
Ok,
Ignored,
- Failed { stdout: String },
+ Failed {
+ // the stdout field is not always present depending on cargo test flags
+ #[serde(skip_serializing_if = "String::is_empty", default)]
+ stdout: String,
+ },
}
#[derive(Debug, Deserialize)]