diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-11-23 11:20:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-23 16:20:40 +0000 |
commit | eda3850f84f24b71e02512c1ba2d6bf2e3daa2fd (patch) | |
tree | 0ea304cd4406402cace81888769c30c2ecec7803 /test_util | |
parent | bf42467e215b20b36ec6b4bf30212e4beb2dd01f (diff) |
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.
Diffstat (limited to 'test_util')
-rw-r--r-- | test_util/src/builders.rs | 3 | ||||
-rw-r--r-- | test_util/src/lib.rs | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test_util/src/builders.rs b/test_util/src/builders.rs index ffc658902..80459af06 100644 --- a/test_util/src/builders.rs +++ b/test_util/src/builders.rs @@ -635,6 +635,9 @@ impl TestCommandBuilder { if !envs.contains_key("NPM_CONFIG_REGISTRY") { envs.insert("NPM_CONFIG_REGISTRY".to_string(), npm_registry_unset_url()); } + if !envs.contains_key("DENO_NO_UPDATE_CHECK") { + envs.insert("DENO_NO_UPDATE_CHECK".to_string(), "1".to_string()); + } for key in &self.envs_remove { envs.remove(key); } 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", "/")); |