1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

chore: Deprecate worker itests (#25514)

This commit is contained in:
Mohammad Sulaiman 2024-09-09 18:07:41 +03:00 committed by GitHub
parent 5126ccb842
commit 582be0adc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 107 additions and 125 deletions

View file

@ -68,5 +68,3 @@ mod test;
mod upgrade;
#[path = "watcher_tests.rs"]
mod watcher;
#[path = "worker_tests.rs"]
mod worker;

View file

@ -1,119 +0,0 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
use test_util::itest;
itest!(worker_error {
args: "run -A workers/worker_error.ts",
output: "workers/worker_error.ts.out",
exit_code: 1,
});
itest!(worker_nested_error {
args: "run -A workers/worker_nested_error.ts",
output: "workers/worker_nested_error.ts.out",
exit_code: 1,
});
itest!(worker_async_error {
args: "run -A --quiet --reload workers/worker_async_error.ts",
output: "workers/worker_async_error.ts.out",
http_server: true,
exit_code: 1,
});
itest!(worker_message_handler_error {
args: "run -A --quiet --reload workers/worker_message_handler_error.ts",
output: "workers/worker_message_handler_error.ts.out",
http_server: true,
exit_code: 1,
});
itest!(nonexistent_worker {
args: "run --allow-read workers/nonexistent_worker.ts",
output: "workers/nonexistent_worker.out",
exit_code: 1,
});
itest!(_084_worker_custom_inspect {
args: "run --allow-read workers/custom_inspect/main.ts",
output: "workers/custom_inspect/main.out",
});
itest!(error_worker_permissions_local {
args: "run --reload workers/error_worker_permissions_local.ts",
output: "workers/error_worker_permissions_local.ts.out",
exit_code: 1,
});
itest!(error_worker_permissions_remote {
args: "run --reload workers/error_worker_permissions_remote.ts",
http_server: true,
output: "workers/error_worker_permissions_remote.ts.out",
exit_code: 1,
});
itest!(worker_permissions_remote_remote {
args: "run --quiet --reload --allow-net=localhost:4545 workers/permissions_remote_remote.ts",
output: "workers/permissions_remote_remote.ts.out",
http_server: true,
exit_code: 1,
});
itest!(worker_permissions_dynamic_remote {
args: "run --quiet --reload --allow-net --unstable-worker-options workers/permissions_dynamic_remote.ts",
output: "workers/permissions_dynamic_remote.ts.out",
http_server: true,
exit_code: 1,
});
itest!(worker_permissions_data_remote {
args: "run --quiet --reload --allow-net=localhost:4545 workers/permissions_data_remote.ts",
output: "workers/permissions_data_remote.ts.out",
http_server: true,
exit_code: 1,
});
itest!(worker_permissions_blob_remote {
args: "run --quiet --reload --allow-net=localhost:4545 workers/permissions_blob_remote.ts",
output: "workers/permissions_blob_remote.ts.out",
http_server: true,
exit_code: 1,
});
itest!(worker_permissions_data_local {
args: "run --quiet --reload --allow-net=localhost:4545 workers/permissions_data_local.ts",
output: "workers/permissions_data_local.ts.out",
http_server: true,
exit_code: 1,
});
itest!(worker_permissions_blob_local {
args: "run --quiet --reload --allow-net=localhost:4545 workers/permissions_blob_local.ts",
output: "workers/permissions_blob_local.ts.out",
http_server: true,
exit_code: 1,
});
itest!(worker_terminate_tla_crash {
args: "run --quiet --reload workers/terminate_tla_crash.js",
output: "workers/terminate_tla_crash.js.out",
});
itest!(worker_error_event {
args: "run --quiet -A workers/error_event.ts",
output: "workers/error_event.ts.out",
exit_code: 1,
});
// Regression test for https://github.com/denoland/deno/issues/19903
itest!(worker_doest_stall_event_loop {
args: "run --quiet -A workers/worker_doest_stall_event_loop.ts",
output: "workers/worker_doest_stall_event_loop.ts.out",
exit_code: 0,
});
itest!(worker_ids_are_sequential {
args: "run --quiet -A workers/worker_ids_are_sequential.ts",
output: "workers/worker_ids_are_sequential.ts.out",
exit_code: 0,
});

View file

@ -0,0 +1,4 @@
{
"args": "run --allow-read custom_inspect/main.ts",
"output": "custom_inspect/main.out"
}

View file

@ -0,0 +1,5 @@
{
"args": "run --reload error_worker_permissions_local.ts",
"output": "error_worker_permissions_local.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"args": "run --reload error_worker_permissions_remote.ts",
"output": "error_worker_permissions_remote.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"args": "run --allow-read nonexistent_worker.ts",
"output": "nonexistent_worker.out",
"exitCode": 1
}

View file

@ -1,3 +1,3 @@
[WILDCARD]error: Uncaught (in worker "") Module not found "file:///[WILDCARD]/workers/doesnt_exist.js".
[WILDCARD]error: Uncaught (in worker "") Module not found "file:///[WILDCARD]/doesnt_exist.js".
error: Uncaught (in promise) Error: Unhandled error in child worker.
at Worker.#pollControl[WILDCARD]

View file

@ -0,0 +1,5 @@
{
"args": "run -A --quiet --reload worker_async_error.ts",
"output": "worker_async_error.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"args": "run --quiet -A worker_doest_stall_event_loop.ts",
"output": "worker_doest_stall_event_loop.ts.out",
"exitCode": 0
}

View file

@ -0,0 +1,5 @@
{
"args": "run -A worker_error.ts",
"output": "worker_error.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"args": "run --quiet -A error_event.ts",
"output": "error_event.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
function foo() {
throw new Error("foo");
}
foo();

View file

@ -0,0 +1,5 @@
{
"args": "run --quiet -A worker_ids_are_sequential.ts",
"output": "worker_ids_are_sequential.ts.out",
"exitCode": 0
}

View file

@ -0,0 +1,5 @@
{
"args": "run -A --quiet --reload worker_message_handler_error.ts",
"output": "worker_message_handler_error.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"args": "run -A worker_nested_error.ts",
"output": "worker_nested_error.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
function foo() {
throw new Error("foo");
}
foo();

View file

@ -0,0 +1,5 @@
const worker = new Worker(
import.meta.resolve("./error.ts"),
{ type: "module", name: "bar" },
);
setTimeout(() => worker.terminate(), 30000);

View file

@ -1,8 +1,8 @@
[WILDCARD]error: Uncaught (in worker "bar") (in promise) Error: foo[WILDCARD]
throw new Error("foo");
^
at foo ([WILDCARD]/workers/error.ts:[WILDCARD])
at [WILDCARD]/workers/error.ts:[WILDCARD]
at foo ([WILDCARD]/error.ts:[WILDCARD])
at [WILDCARD]/error.ts:[WILDCARD]
error: Uncaught (in worker "baz") (in promise) Error: Unhandled error in child worker.
at Worker.#pollControl [WILDCARD]
error: Uncaught (in promise) Error: Unhandled error in child worker.

View file

@ -0,0 +1,5 @@
{
"args": "run --quiet --reload --allow-net=localhost:4545 permissions_blob_local.ts",
"output": "permissions_blob_local.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"args": "run --quiet --reload --allow-net=localhost:4545 permissions_blob_remote.ts",
"output": "permissions_blob_remote.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"args": "run --quiet --reload --allow-net=localhost:4545 permissions_data_local.ts",
"output": "permissions_data_local.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"args": "run --quiet --reload --allow-net=localhost:4545 permissions_data_remote.ts",
"output": "permissions_data_remote.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"args": "run --quiet --reload --allow-net --unstable-worker-options ../../../testdata/workers/permissions_dynamic_remote.ts",
"output": "../../../testdata/workers/permissions_dynamic_remote.ts.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"args": "run --quiet --reload --allow-net=localhost:4545 ../../../testdata/workers/permissions_remote_remote.ts",
"output": "permissions_remote_remote.ts.out",
"exitCode": 1
}

View file

@ -1,4 +1,4 @@
error: Uncaught (in worker "") Requires net access to "example.com:443", run again with the --allow-net flag
at http://localhost:4545/workers/static_remote.ts:2:8
at http://localhost:4545/[WILDCARD]/static_remote.ts:2:8
error: Uncaught (in promise) Error: Unhandled error in child worker.
at Worker.#pollControl [WILDCARD]

View file

@ -0,0 +1,4 @@
{
"args": "run --quiet --reload terminate_tla_crash.js",
"output": "terminate_tla_crash.js.out"
}