From a417772bd7dc4f8508621ec7b2fb75f9bfeca955 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Thu, 8 Feb 2024 13:09:47 -0700 Subject: chore: Promote some integration tests to js_unit_tests (#22355) - Move a workers test to js_unit_tests and make it work - (slightly) repair the websocketstream_test and make it a JS unit test. This test was being ignored and rotted quite a bit, but there's some value in running as much of it as we can. - Merge the two websocket test files --- cli/tests/integration/js_unit_tests.rs | 5 ++-- cli/tests/integration/run_tests.rs | 43 ---------------------------------- cli/tests/integration/worker_tests.rs | 6 ----- 3 files changed, 3 insertions(+), 51 deletions(-) (limited to 'cli/tests/integration') diff --git a/cli/tests/integration/js_unit_tests.rs b/cli/tests/integration/js_unit_tests.rs index 951fc6f62..b037d473c 100644 --- a/cli/tests/integration/js_unit_tests.rs +++ b/cli/tests/integration/js_unit_tests.rs @@ -105,9 +105,10 @@ util::unit_test_factory!( webcrypto_test, webgpu_test, websocket_test, + websocketstream_test, webstorage_test, worker_permissions_test, - worker_types, + worker_test, write_file_test, write_text_file_test, ] @@ -123,7 +124,7 @@ fn js_unit_test(test: String) { .arg("cli/tests/config/deno.json") .arg("--no-lock") .arg("--unstable") - .arg("--location=http://js-unit-tests/foo/bar") + .arg("--location=http://127.0.0.1:4545/") .arg("--no-prompt"); // TODO(mmastrac): it would be better to just load a test CA for all tests diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 56eea9c8d..3d14bb0bb 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -4390,49 +4390,6 @@ itest!(ext_flag_takes_precedence_over_extension { exit_code: 0, }); -#[test] -fn websocket() { - let _g = util::http_server(); - - let script = util::testdata_path().join("run/websocket_test.ts"); - let root_ca = util::testdata_path().join("tls/RootCA.pem"); - let status = util::deno_cmd() - .arg("test") - .arg("--unstable") - .arg("--allow-net") - .arg("--cert") - .arg(root_ca) - .arg(script) - .spawn() - .unwrap() - .wait() - .unwrap(); - - assert!(status.success()); -} - -#[ignore] -#[test] -fn websocketstream() { - let _g = util::http_server(); - - let script = util::testdata_path().join("run/websocketstream_test.ts"); - let root_ca = util::testdata_path().join("tls/RootCA.pem"); - let status = util::deno_cmd() - .arg("test") - .arg("--unstable") - .arg("--allow-net") - .arg("--cert") - .arg(root_ca) - .arg(script) - .spawn() - .unwrap() - .wait() - .unwrap(); - - assert!(status.success()); -} - #[tokio::test(flavor = "multi_thread")] async fn websocketstream_ping() { let _g = util::http_server(); diff --git a/cli/tests/integration/worker_tests.rs b/cli/tests/integration/worker_tests.rs index cbd63d809..e2d1ef868 100644 --- a/cli/tests/integration/worker_tests.rs +++ b/cli/tests/integration/worker_tests.rs @@ -1,11 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -itest!(workers { - args: "test --reload --location http://127.0.0.1:4545/ -A --unstable-worker-options workers/test.ts", - output: "workers/test.ts.out", - http_server: true, -}); - itest!(worker_error { args: "run -A workers/worker_error.ts", output: "workers/worker_error.ts.out", -- cgit v1.2.3