From f5e46c9bf2f50d66a953fa133161fc829cecff06 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Sat, 10 Feb 2024 13:22:13 -0700 Subject: chore: move cli/tests/ -> tests/ (#22369) This looks like a massive PR, but it's only a move from cli/tests -> tests, and updates of relative paths for files. This is the first step towards aggregate all of the integration test files under tests/, which will lead to a set of integration tests that can run without the CLI binary being built. While we could leave these tests under `cli`, it would require us to keep a more complex directory structure for the various test runners. In addition, we have a lot of complexity to ignore various test files in the `cli` project itself (cargo publish exclusion rules, autotests = false, etc). And finally, the `tests/` folder will eventually house the `test_ffi`, `test_napi` and other testing code, reducing the size of the root repo directory. For easier review, the extremely large and noisy "move" is in the first commit (with no changes -- just a move), while the remainder of the changes to actual files is in the second commit. --- tests/testdata/run/warn_on_deprecated_api/main.js | 32 +++++++++++ tests/testdata/run/warn_on_deprecated_api/main.out | 16 ++++++ .../run/warn_on_deprecated_api/main.verbose.out | 65 ++++++++++++++++++++++ .../warn_on_deprecated_api/main_disabled_env.out | 15 +++++ .../warn_on_deprecated_api/main_disabled_flag.out | 14 +++++ tests/testdata/run/warn_on_deprecated_api/mod.ts | 11 ++++ 6 files changed, 153 insertions(+) create mode 100644 tests/testdata/run/warn_on_deprecated_api/main.js create mode 100644 tests/testdata/run/warn_on_deprecated_api/main.out create mode 100644 tests/testdata/run/warn_on_deprecated_api/main.verbose.out create mode 100644 tests/testdata/run/warn_on_deprecated_api/main_disabled_env.out create mode 100644 tests/testdata/run/warn_on_deprecated_api/main_disabled_flag.out create mode 100644 tests/testdata/run/warn_on_deprecated_api/mod.ts (limited to 'tests/testdata/run/warn_on_deprecated_api') diff --git a/tests/testdata/run/warn_on_deprecated_api/main.js b/tests/testdata/run/warn_on_deprecated_api/main.js new file mode 100644 index 000000000..a464be60a --- /dev/null +++ b/tests/testdata/run/warn_on_deprecated_api/main.js @@ -0,0 +1,32 @@ +import { runEcho as runEcho2 } from "http://localhost:4545/run/warn_on_deprecated_api/mod.ts"; + +const p = Deno.run({ + cmd: [ + Deno.execPath(), + "eval", + "console.log('hello world')", + ], +}); +await p.status(); +p.close(); + +async function runEcho() { + const p = Deno.run({ + cmd: [ + Deno.execPath(), + "eval", + "console.log('hello world')", + ], + }); + await p.status(); + p.close(); +} + +await runEcho(); +await runEcho(); + +for (let i = 0; i < 10; i++) { + await runEcho(); +} + +await runEcho2(); diff --git a/tests/testdata/run/warn_on_deprecated_api/main.out b/tests/testdata/run/warn_on_deprecated_api/main.out new file mode 100644 index 000000000..ff44c885f --- /dev/null +++ b/tests/testdata/run/warn_on_deprecated_api/main.out @@ -0,0 +1,16 @@ +Download http://localhost:4545/run/warn_on_deprecated_api/mod.ts +warning: Use of deprecated "Deno.run()" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details. +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world diff --git a/tests/testdata/run/warn_on_deprecated_api/main.verbose.out b/tests/testdata/run/warn_on_deprecated_api/main.verbose.out new file mode 100644 index 000000000..184051de1 --- /dev/null +++ b/tests/testdata/run/warn_on_deprecated_api/main.verbose.out @@ -0,0 +1,65 @@ +Download http://localhost:4545/run/warn_on_deprecated_api/mod.ts +warning: Use of deprecated "Deno.run()" API. This API will be removed in Deno 2. + +See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations + +Stack trace: + at [WILDCARD]warn_on_deprecated_api/main.js:3:16 + +hint: Use "Deno.Command()" API instead. + +hello world +warning: Use of deprecated "Deno.run()" API. This API will be removed in Deno 2. + +See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations + +Stack trace: + at runEcho ([WILDCARD]warn_on_deprecated_api/main.js:14:18) + at [WILDCARD]warn_on_deprecated_api/main.js:25:7 + +hint: Use "Deno.Command()" API instead. + +hello world +warning: Use of deprecated "Deno.run()" API. This API will be removed in Deno 2. + +See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations + +Stack trace: + at runEcho ([WILDCARD]warn_on_deprecated_api/main.js:14:18) + at [WILDCARD]warn_on_deprecated_api/main.js:26:7 + +hint: Use "Deno.Command()" API instead. + +hello world +warning: Use of deprecated "Deno.run()" API. This API will be removed in Deno 2. + +See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations + +Stack trace: + at runEcho ([WILDCARD]warn_on_deprecated_api/main.js:14:18) + at [WILDCARD]warn_on_deprecated_api/main.js:29:9 + +hint: Use "Deno.Command()" API instead. + +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +warning: Use of deprecated "Deno.run()" API. This API will be removed in Deno 2. + +See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations + +Stack trace: + at runEcho (http://localhost:4545/run/warn_on_deprecated_api/mod.ts:2:18) + at [WILDCARD]warn_on_deprecated_api/main.js:32:7 + +hint: Use "Deno.Command()" API instead. +hint: It appears this API is used by a remote dependency. Try upgrading to the latest version of that dependency. + +hello world diff --git a/tests/testdata/run/warn_on_deprecated_api/main_disabled_env.out b/tests/testdata/run/warn_on_deprecated_api/main_disabled_env.out new file mode 100644 index 000000000..ef85a6f99 --- /dev/null +++ b/tests/testdata/run/warn_on_deprecated_api/main_disabled_env.out @@ -0,0 +1,15 @@ +Download http://localhost:4545/run/warn_on_deprecated_api/mod.ts +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world diff --git a/tests/testdata/run/warn_on_deprecated_api/main_disabled_flag.out b/tests/testdata/run/warn_on_deprecated_api/main_disabled_flag.out new file mode 100644 index 000000000..ce3755d16 --- /dev/null +++ b/tests/testdata/run/warn_on_deprecated_api/main_disabled_flag.out @@ -0,0 +1,14 @@ +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world +hello world diff --git a/tests/testdata/run/warn_on_deprecated_api/mod.ts b/tests/testdata/run/warn_on_deprecated_api/mod.ts new file mode 100644 index 000000000..f74632b2c --- /dev/null +++ b/tests/testdata/run/warn_on_deprecated_api/mod.ts @@ -0,0 +1,11 @@ +export async function runEcho() { + const p = Deno.run({ + cmd: [ + Deno.execPath(), + "eval", + "console.log('hello world')", + ], + }); + await p.status(); + p.close(); +} -- cgit v1.2.3