mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
chore: Deprecate worker itests (#25514)
This commit is contained in:
parent
5126ccb842
commit
582be0adc2
61 changed files with 107 additions and 125 deletions
|
@ -68,5 +68,3 @@ mod test;
|
|||
mod upgrade;
|
||||
#[path = "watcher_tests.rs"]
|
||||
mod watcher;
|
||||
#[path = "worker_tests.rs"]
|
||||
mod worker;
|
||||
|
|
|
@ -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,
|
||||
});
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "run --allow-read custom_inspect/main.ts",
|
||||
"output": "custom_inspect/main.out"
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run --reload error_worker_permissions_local.ts",
|
||||
"output": "error_worker_permissions_local.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run --reload error_worker_permissions_remote.ts",
|
||||
"output": "error_worker_permissions_remote.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
5
tests/specs/worker/nonexistent_worker/__test__.jsonc
Normal file
5
tests/specs/worker/nonexistent_worker/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run --allow-read nonexistent_worker.ts",
|
||||
"output": "nonexistent_worker.out",
|
||||
"exitCode": 1
|
||||
}
|
|
@ -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]
|
5
tests/specs/worker/worker_async_error/__test__.jsonc
Normal file
5
tests/specs/worker/worker_async_error/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run -A --quiet --reload worker_async_error.ts",
|
||||
"output": "worker_async_error.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run --quiet -A worker_doest_stall_event_loop.ts",
|
||||
"output": "worker_doest_stall_event_loop.ts.out",
|
||||
"exitCode": 0
|
||||
}
|
5
tests/specs/worker/worker_error/__test__.jsonc
Normal file
5
tests/specs/worker/worker_error/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run -A worker_error.ts",
|
||||
"output": "worker_error.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
5
tests/specs/worker/worker_error_event/__test__.jsonc
Normal file
5
tests/specs/worker/worker_error_event/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run --quiet -A error_event.ts",
|
||||
"output": "error_event.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
5
tests/specs/worker/worker_error_event/error.ts
Normal file
5
tests/specs/worker/worker_error_event/error.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
function foo() {
|
||||
throw new Error("foo");
|
||||
}
|
||||
|
||||
foo();
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run --quiet -A worker_ids_are_sequential.ts",
|
||||
"output": "worker_ids_are_sequential.ts.out",
|
||||
"exitCode": 0
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run -A --quiet --reload worker_message_handler_error.ts",
|
||||
"output": "worker_message_handler_error.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
5
tests/specs/worker/worker_nested_error/__test__.jsonc
Normal file
5
tests/specs/worker/worker_nested_error/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run -A worker_nested_error.ts",
|
||||
"output": "worker_nested_error.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
5
tests/specs/worker/worker_nested_error/error.ts
Normal file
5
tests/specs/worker/worker_nested_error/error.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
function foo() {
|
||||
throw new Error("foo");
|
||||
}
|
||||
|
||||
foo();
|
5
tests/specs/worker/worker_nested_error/worker_error.ts
Normal file
5
tests/specs/worker/worker_nested_error/worker_error.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
const worker = new Worker(
|
||||
import.meta.resolve("./error.ts"),
|
||||
{ type: "module", name: "bar" },
|
||||
);
|
||||
setTimeout(() => worker.terminate(), 30000);
|
|
@ -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.
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run --quiet --reload --allow-net=localhost:4545 permissions_blob_local.ts",
|
||||
"output": "permissions_blob_local.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run --quiet --reload --allow-net=localhost:4545 permissions_blob_remote.ts",
|
||||
"output": "permissions_blob_remote.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run --quiet --reload --allow-net=localhost:4545 permissions_data_local.ts",
|
||||
"output": "permissions_data_local.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run --quiet --reload --allow-net=localhost:4545 permissions_data_remote.ts",
|
||||
"output": "permissions_data_remote.ts.out",
|
||||
"exitCode": 1
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -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]
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "run --quiet --reload terminate_tla_crash.js",
|
||||
"output": "terminate_tla_crash.js.out"
|
||||
}
|
Loading…
Reference in a new issue