Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(desktop-gpui): the picker smoke reads the probe's own verdict, not any nested pass

Richie McIlroyc5754539ef58
diff --git a/apps/desktop-gpui/src/picker_probe.rs b/apps/desktop-gpui/src/picker_probe.rs
index 077b74c69..64dd85906 100644
--- a/apps/desktop-gpui/src/picker_probe.rs
+++ b/apps/desktop-gpui/src/picker_probe.rs
@@ -76,8 +76,13 @@ pub fn run(main: WindowHandle<MainWindow>, cx: &mut App) {
let passed = modes
.iter()
.all(|mode| mode["cameraAboveOverlays"].as_bool() == Some(true));
- let report = serde_json::json!({ "passed": passed, "modes": modes });
- if let Err(error) = std::fs::write(output, report.to_string()) {
+ let report = serde_json::json!({ "modes": modes });
+ // The verdict leads so `run.sh` can read it without parsing JSON:
+ // nested checks carry `passed` keys of their own.
+ if let Err(error) = std::fs::write(
+ output,
+ format!("{{\"passed\":{passed},{}", &report.to_string()[1..]),
+ ) {
tracing::error!(%error, "Could not write picker probe results");
}
cx.update(|cx| cx.quit());
diff --git a/scripts/picker-smoke/run.sh b/scripts/picker-smoke/run.sh
index 5b5d13fd2..0a2552c5e 100755
--- a/scripts/picker-smoke/run.sh
+++ b/scripts/picker-smoke/run.sh
@@ -33,4 +33,4 @@ if [ ! -s "$report" ]; then
fi
cat "$report"
echo
-grep -q '"passed":true' "$report"
+grep -q '^{"passed":true,' "$report"