Skip to content

Commit 47c4716

Browse files
authored
fix smoke (#834)
Signed-off-by: Jessie Frazelle <github@jessfraz.com>
1 parent d1a5359 commit 47c4716

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

kittycad/tests/win_ca_smoke.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
use std::time::Duration;
44

55
use anyhow::{anyhow, Context, Result};
6+
use serde::Deserialize;
67
use tokio::time::sleep;
78

9+
#[derive(Deserialize)]
10+
struct SmokeStatus {
11+
status: String,
12+
}
13+
814
#[cfg_attr(not(target_os = "windows"), ignore)]
915
#[tokio::test(flavor = "current_thread")]
1016
async fn win_ca_smoke() -> Result<()> {
@@ -46,11 +52,26 @@ async fn win_ca_smoke() -> Result<()> {
4652
.await
4753
.context("reading body from win-ca smoke target")?;
4854

49-
if body.trim() == "ok" {
55+
let trimmed = body.trim();
56+
57+
if trimmed.eq_ignore_ascii_case("ok") {
5058
println!("win-ca smoke OK");
5159
return Ok(());
5260
}
5361

62+
if let Ok(json) = serde_json::from_str::<SmokeStatus>(trimmed) {
63+
if json.status.trim().eq_ignore_ascii_case("ok") {
64+
println!("win-ca smoke OK");
65+
return Ok(());
66+
}
67+
68+
return Err(anyhow!(
69+
"unexpected JSON status {:?} from {}",
70+
json.status,
71+
target
72+
));
73+
}
74+
5475
return Err(anyhow!(
5576
"unexpected response body {:?} from {}",
5677
body,

0 commit comments

Comments
 (0)