From eda3850f84f24b71e02512c1ba2d6bf2e3daa2fd Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 23 Nov 2023 11:20:40 -0500 Subject: chore: add upgrade prompt integration test (#21273) 1. Adds an upgrade prompt integration test. 1. Adds a test for when the upgrade check takes a long time in the repl. --- test_util/src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test_util/src/lib.rs') diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index 97ae46479..c38f2bb0f 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -1273,6 +1273,24 @@ async fn main_server( .unwrap(), ) } + (&hyper::Method::GET, "/upgrade/sleep/release-latest.txt") => { + tokio::time::sleep(Duration::from_secs(45)).await; + return Ok( + Response::builder() + .status(StatusCode::OK) + .body(Body::from("99999.99.99")) + .unwrap(), + ); + } + (&hyper::Method::GET, "/release-latest.txt") => { + return Ok( + Response::builder() + .status(StatusCode::OK) + // use a deno version that will never happen + .body(Body::from("99999.99.99")) + .unwrap(), + ); + } _ => { let mut file_path = testdata_path().to_path_buf(); file_path.push(&req.uri().path()[1..].replace("%2f", "/")); -- cgit v1.2.3