summaryrefslogtreecommitdiff
path: root/cli/tests
AgeCommit message (Collapse)Author
2024-06-02fix: validate integer values in `Deno.exitCode` setter (#24068)Kenta Moriuchi
2024-05-29feat: Add `Deno.exitCode` API (#23609)Luke Edwards
This commits adds the ability to set a would-be exit code for the Deno process without forcing an immediate exit, through the new `Deno.exitCode` API. - **Implements `Deno.exitCode` getter and setter**: Adds support for setting and retrieving a would-be exit code via `Deno.exitCode`. This allows for asynchronous cleanup before process termination without immediately exiting. - **Ensures type safety**: The setter for `Deno.exitCode` validates that the provided value is a number, throwing a TypeError if not, to ensure that only valid exit codes are set. Closes to #23605 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-02-10chore: move cli/tests/ -> tests/ (#22369)Matt Mastracci
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.
2024-02-10fix: cache bust jsr deps on constraint failure (#22372)David Sherret
Removes the `FileFetcher`'s internal cache because I don't believe it's necessary (we already cache this kind of stuff in places like deno_graph or config files in different places). Removing it fixes this bug because this functionality was already implemented in deno_graph and lowers memory usage of the CLI a little bit.
2024-02-09fix: lockfile was sometimes getting corrupt when changing config deps (#22359)David Sherret
Tests are in the deno_lockfile repo. Closes #22250
2024-02-09refactor: split integration tests from CLI (part 1) (#22308)Matt Mastracci
This PR separates integration tests from CLI tests into a new project named `cli_tests`. This is a prerequisite for an integration test runner that can work with either the CLI binary in the current project, or one that is built ahead of time. ## Background Rust does not have the concept of artifact dependencies yet (https://github.com/rust-lang/cargo/issues/9096). Because of this, the only way we can ensure a binary is built before running associated tests is by hanging tests off the crate with the binary itself. Unfortunately this means that to run those tests, you _must_ build the binary and in the case of the deno executable that might be a 10 minute wait in release mode. ## Implementation To allow for tests to run with and without the requirement that the binary is up-to-date, we split the integration tests into a project of their own. As these tests would not require the binary to build itself before being run as-is, we add a stub integration `[[test]]` target in the `cli` project that invokes these tests using `cargo test`. The stub test runner we add has `harness = false` so that we can get access to a `main` function. This `main` function's sole job is to `execvp` the command `cargo test -p deno_cli`, effectively "calling" another cargo target. This ensures that the deno executable is always correctly rebuilt before running the stub test runner from `cli`, and gets us closer to be able to run the entire integration test suite on arbitrary deno executables (and therefore split the build into multiple phases). The new `cli_tests` project lives within `cli` to avoid a large PR. In later PRs, the test data will be split from the `cli` project. As there are a few thousand files, it'll be better to do this as a completely separate PR to avoid noise.
2024-02-09chore: completely disable websocketstream_test (#22360)Matt Mastracci
2024-02-09fix: upgrade to deno_ast 0.33 (#22341)David Sherret
* Uses diagnostics from deno_ast * Real fix for https://github.com/denoland/deno/pull/22310 * Moves `deno lint --json` code here * Upgrades swc Closes #22117 Closes #22109 Closes #21927 Closes #20993
2024-02-08chore(cli): disable some of the restored WSS tests (#22357)Matt Mastracci
2024-02-08chore: Promote some integration tests to js_unit_tests (#22355)Matt Mastracci
- 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
2024-02-07chore: use @test_util for node_compat tests (#22331)Matt Mastracci
2024-02-07chore(cli): Use @test_util for relative path for unit tests (#22327)Matt Mastracci
This removes the majority of `../../../../../../test_util` relative imports from the codebase, allowing us to move this code more easily in the future.
2024-02-07fix(node): handle brotli compression end chunk sizes (#22322)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22259
2024-02-07fix: enable "--allow-sys=cpus" for "deno run" (#22260)restlessronin
Fixes #22221 with the suggested fix, and added "cpus" to the existing tests.
2024-02-07chore: remove op_spawn_child test (#22314)Bartek Iwańczuk
This test is not needed because the op is not available to user code anymore. This brings number of ops exposed to user code down to 15.
2024-02-07chore: don't expose FFI ops to user code (#22313)Bartek Iwańczuk
This commit removes some not really necessary FFI tests and in effect removes them from being accessible from the user code. This lowers the number of ops accessible to user code to 16.
2024-02-07chore: use same test server for jsr tests (#22303)David Sherret
We had two test servers.
2024-02-07chore: upgrade deno_core to 0.259.0 (#22311)Bartek Iwańczuk
This update brings number of ops available to user code down to 45.
2024-02-06fix(publish): handle diagnostic outside graph (#22310)David Sherret
Hacky quick fix. The real fix is a lot more work to do (move the `SourceTextInfo` into all the diagnostics in order to make this less error pone). I've already started on it, but it will require a lot of downstream create changes. Closes #22288
2024-02-07chore: remove unneeded benchmark (#22300)Bartek Iwańczuk
Brings down the number of ops available to user code to 49.
2024-02-06fix(publish): 'explit' typo (#22296)John Spurlock
2024-02-06fix(publish): lazily parse sources (#22301)David Sherret
Closes #22290
2024-02-06fix(lsp): disable no-cache diagnostics for jsr specifiers (#22284)Nayeem Rahman
2024-02-06fix: Support Symbol.metadata (#22282)Bartek Iwańczuk
This commit adds support for "Symbol.metadata" which was omitted when adding support for the Decorators Proposal. Closes https://github.com/denoland/deno/issues/22111
2024-02-06chore(ws): remove unused op_ws_send_pong (#22283)Divy Srivastava
2024-02-06fix(node): add `cp` to fs/promises (#22263)Divy Srivastava
2024-02-06refactor: don't expose some ops (#22281)Bartek Iwańczuk
This commit brings down the number of ops exposed to user code to 51.
2024-02-06refactor: don't expose ops to user code (#22273)Bartek Iwańczuk
Brings the number of ops exposed to user code down to 58.
2024-02-05refactor(cli): Move op descriptions into Rust and prepare for op import (#22271)Matt Mastracci
This moves the op sanitizer descriptions into Rust code and prepares for eventual op import from `ext:core/ops`. We cannot import these ops from `ext:core/ops` as the testing infrastructure ops are not always present. Changes: - Op descriptions live in `cli` code and are currently accessible via an op for the older sanitizer code - `phf` dep moved to workspace root so we can use it here - `ops.op_XXX` changed to to `op_XXX` to prepare for op imports later on.
2024-02-05Reland refactor(cli): use new sanitizer for resources (#22226)Matt Mastracci
Originally in #22125 Reverted in #22153 because of #22148 Fixed in deno_core https://github.com/denoland/deno_core/pull/538 Test plan: 1. Check out: https://github.com/poolifier/poolifier-deno.git 2. `PATH=.../deno/target/release/:$PATH deno task test` 3. `ok | 13 passed (188 steps) | 0 failed (18s)`
2024-02-06fix(unstable): validate kv list selector (#22265)Heyang Zhou
Check that in a `KvListSelector`, `start` and `end` are actually within the keyspace bounds defined by `prefix`, if both are present.
2024-02-05fix(ext/node): fix timeout param validation in cp.execFile (#22262)Yoshiya Hinosawa
2024-02-05feat(unstable): `Deno.FsFile.lock[Sync]()` and `Deno.FsFile.unlock[Sync]()` ↵Asher Gomez
(#22235) Closes #22178.
2024-02-04chore: remove opcall_test.ts (#22227)Bartek Iwańczuk
This test should be in `deno_core`. Ref https://github.com/denoland/deno_core/issues/533
2024-02-02docs: point to new "Deno 1.x to 2.x Migration Guide" (#22199)Asher Gomez
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-02-01fix(fs): copyFile NUL path on macOS (#22216)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22211
2024-02-01fix(publish): add node specifiers (#22213)Leo Kettmeir
2024-02-01fix(node): add `ppid` getter for `node:process` (#22167)Yusuke Tanaka
This commit adds `ppid` getter for `node:process` to improve Node compatibility one step further. There is one problem though, which is that `Deno.ppid`, which `process.ppid` internally calls, is actually of type `bigint` although it's supposed to be `number`. I filed an issue for this (#22166). For the time being, explciit type conversion from `bigint` to `number` is applied to match the Node.js behavior.
2024-02-01fix(ext/node): add `aes256` algorithm support (#22198)Asher Gomez
Towards #21804
2024-02-01fix(node): `util.callbackify` (#22200)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22180 Matches the Node.js implementation more closely. Removed types, they do not help just make it harder to debug with stack traces.
2024-02-01refactor: load bytes in deno_graph (#22212)David Sherret
Upgrades deno_graph to 0.64 where deno_graph is now responsible for turning bytes into a string. This is in preparation for Wasm modules.
2024-02-01fix(publish): rename --no-fast-check to --no-zap (#22214)Bartek Iwańczuk
Also prints an information about the flag when there are `zap` errors.
2024-01-31chore: temporarily disable deprecation warnings (#22204)Bartek Iwańczuk
2024-01-31refactor: remove imported ops from Deno.core.ops (#22194)Bartek Iwańczuk
This commit adds a list of ops to `runtime/99_main.js` that are currently relying on getting them from `Deno.core.ops`. All ops that are not present in the list are removed from `Deno.core.ops` on startup (they are imported from "virtual op module" - `ext:core/ops`) making them effectively inaccessible to user code. This change lowers the number of ops exposed to user code from 650 to around 260. This number should be gradually decreased in follow-up PRs.
2024-01-31chore: disable test-fs-watchfile.js on Mac ARM (#22209)Bartek Iwańczuk
This is super flaky on new Mac ARM runner. Disabling for now to unblock main branch.
2024-01-31chore(publish): add --no-fast-check flag (#22203)Bartek Iwańczuk
2024-01-30fix(lsp): don't normalize urls in cache command params (#22182)Nayeem Rahman
2024-01-30fix(lockfile): only consider package.json beside lockfile in workspace ↵David Sherret
property (#22179) Closes https://github.com/denoland/deno/issues/22176 (see detail there)
2024-01-30fix(runtime): return number from `op_ppid` instead of bigint (#22169)Yusuke Tanaka
Fixes #22166
2024-01-28chore(lsp): rename client-side command invocations (#22140)Nayeem Rahman