From 336b4246ad00aa518b69b2ef76d5c1c8c9ab7a4c Mon Sep 17 00:00:00 2001 From: Radu Matei Date: Sun, 9 Jan 2022 23:46:38 +0200 Subject: [PATCH] fix: update expected body in HTTP tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the expected response body from https://api.brigade.sh/healthz to be an empty response. This partially addresses https://github.com/deislabs/wasi-experimental-http/issues/81 by fixing the failing tests, but the larger issue remains — finding a test endpoint we could use to properly test the response body. Signed-off-by: Radu Matei --- tests/as/index.ts | 2 +- tests/rust/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/as/index.ts b/tests/as/index.ts index e8c71b4..079fdd3 100644 --- a/tests/as/index.ts +++ b/tests/as/index.ts @@ -23,7 +23,7 @@ export function get(): void { check(res, 200, "content-type"); let bytes = res.bodyReadAll(); let body = String.UTF8.decode(bytes.buffer); - if (!body.includes("OK")) { + if (!body.includes("")) { Console.write("got " + body); abort(); } diff --git a/tests/rust/src/lib.rs b/tests/rust/src/lib.rs index c525b9d..3a24418 100644 --- a/tests/rust/src/lib.rs +++ b/tests/rust/src/lib.rs @@ -8,7 +8,7 @@ pub extern "C" fn get() { let str = std::str::from_utf8(&res.body_read_all().unwrap()) .unwrap() .to_string(); - assert_eq!(str, r#""OK""#); + assert_eq!(str, r#""#); assert_eq!(res.status_code, 200); assert!(!res .header_get("content-type".to_string())