summaryrefslogtreecommitdiff
path: root/test_util/src
AgeCommit message (Collapse)Author
2024-02-19chore: move `test_util` to `tests/util/server` (#22444)Asher Gomez
As discussed with @mmastrac. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-02-15feat(unstable): single checksum per JSR package in the lockfile (#22421)David Sherret
This changes the lockfile to not store JSR specifiers in the "remote" section. Instead a single JSR integrity is stored per package in the lockfile, which is a hash of the version's `x.x.x_meta.json` file, which contains hashes for every file in the package. The hashes in this file are then compared against when loading. Additionally, when using `{ "vendor": true }` in a deno.json, the files can be modified without causing lockfile errors—the checksum is only checked when copying into the vendor folder and not afterwards (eventually we should add this behaviour for non-jsr specifiers as well). As part of this change, the `vendor` folder creation is not always automatic in the LSP and running an explicit cache command is necessary. The code required to track checksums in the LSP would have been too complex for this PR, so that all goes through deno_graph now. The vendoring is still automatic when running from the CLI.
2024-02-15chore: add DENO_FUTURE env var (#22318)Divy Srivastava
Closes https://github.com/denoland/deno/issues/22315 ``` ~> DENO_FUTURE=1 target/debug/deno > globalThis.window undefined ```
2024-02-14chore: rename DENO_REGISTRY_URL to JSR_URL (#22414)Nayeem Rahman
2024-02-13chore: move `test_util/std` to `tests/util/std` (#22402)Asher Gomez
Note: tests are not the only part of the codebase that uses `std`. Other parts, like `tools/`, do too. So, it could be argued that this is a little misleading. Either way, I'm doing this as discussed with @mmastrac.
2024-02-13feat: denort binary for `deno compile` (#22205)Divy Srivastava
This introduces the `denort` binary - a slim version of deno without tooling. The binary is used as the default for `deno compile`. Improves `deno compile` final size by ~2.5x (141 MB -> 61 MB) on Linux x86_64.
2024-02-12chore: continue tests/ re-org (#22396)Matt Mastracci
Split `node_compat_tests` into its own top-level test so its stdout doesn't stomp on the remainder of the tests.
2024-02-12feat(lsp): jsr support first pass (#22382)Nayeem Rahman
This implementation heavily depends on there being a lockfile, meaning JSR specifiers will always diagnose as uncached unless it's there. In practice this affects cases where a `deno.json` isn't being used. Our NPM specifier support isn't subject to this. The reason for this is that the version constraint solving code is currently buried in `deno_graph` and not usable from the LSP, so the only way to reuse that logic is the solved-version map in the lockfile's `packages.specifiers`.
2024-02-12chore: move test_ffi and test_nap to tests/ [WIP] (#22394)Matt Mastracci
Moving some additional NAPI and. FFI tests out of the tree root.
2024-02-12fix(console): support NO_COLOR and colors option in all scenarios (#21910)Leo Kettmeir
Noticed in #21607
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-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-07chore: use same test server for jsr tests (#22303)David Sherret
We had two test servers.
2024-02-06fix(publish): lazily parse sources (#22301)David Sherret
Closes #22290
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-01-30ci: actually fix main for linux-gnu (#22195)David Sherret
2024-01-30ci: fix failing upgrade_prompt test on main (#22193)David Sherret
Understandably accidentally caused by https://github.com/denoland/deno/pull/22187
2024-01-28chore(lsp): rename client-side command invocations (#22140)Nayeem Rahman
2024-01-22feat(lockfile): track JSR and npm dependencies in config file (#22004)David Sherret
See overview in https://github.com/denoland/deno_lockfile/pull/13
2024-01-09fix(ext/websocket): pass on uncaught errors in idleTimeout (#21846)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/21840 The problem was hard to reproduce as its a race condition. I've added a test that reproduces the problem 1/10 tries. We should move the idleTimeout handling to Rust (maybe even built into fastwebsocket).
2024-01-08fix(unstable/tar): skip node_modules, .git, and config "exclude" (#21816)David Sherret
2024-01-03chore: make test server less noisy (#21782)Bartek Iwańczuk
Test server was printing a lot of "early eof" messages eg when running `cargo test integration::npm`. This commit filters out these messages.
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-27refactor: simplify hyper, http, h2 deps (#21715)Bartek Iwańczuk
Main change is that: - "hyper" has been renamed to "hyper_v014" to signal that it's legacy - "hyper1" has been renamed to "hyper" and should be the default
2023-12-27refactor: finish test_util server cleanup, simplify dependencies (#21714)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/21578
2023-12-27refactor: rewrite remaining test server to Hyper 1.1 (#21708)Bartek Iwańczuk
Ref https://github.com/denoland/deno/issues/21578
2023-12-26refactor: fastwebsockets renames (#21707)Bartek Iwańczuk
We now use only a single version of "fastwebsockets" crate, so we no longer need to have an alias.
2023-12-25refactor: use hyper 1.0 in WS test server (#21698)Bartek Iwańczuk
2023-12-24refactor: use hyper 1.0 in grpc test server (#21584)Bartek Iwańczuk
Ref https://github.com/denoland/deno/issues/21578
2023-12-15refactor: check if scope and package exist before publish (#21575)Bartek Iwańczuk
Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2023-12-14refactor(test_util): move servers to a separate module (#21577)Bartek Iwańczuk
This commit has no functional changes, just moves all the testing servers to "test_util::servers" module to make "test_util/src/lib.rs" shorter.
2023-12-13test: integration tests for tarring/unfurling (#21544)Bartek Iwańczuk
2023-12-05feat(unstable): kv.watch() (#21147)Luca Casonato
This commit adds support for a new `kv.watch()` method that allows watching for changes to a key-value pair. This is useful for cases where you want to be notified when a key-value pair changes, but don't want to have to poll for changes. --------- Co-authored-by: losfair <zhy20000919@hotmail.com>
2023-11-27ci: make upgrade_lsp_repl_sleeps less flaky (#21363)David Sherret
Makes this test less flaky by allowing way more time for the test to occur in.
2023-11-23chore: provide error message when a deno.json will be auto-discovered by the ↵David Sherret
test suite (#21315)
2023-11-23chore: fix upgrade_prompt test on main (#21314)David Sherret
Issue was main does canary builds, which broke this test because it didn't handle searching for a canary release. Tested by building as canary locally.
2023-11-23chore: add upgrade prompt integration test (#21273)David Sherret
1. Adds an upgrade prompt integration test. 1. Adds a test for when the upgrade check takes a long time in the repl.
2023-11-21ci: attempt to make repl tests less flaky at startup on the CI (#21291)David Sherret
This is an attempt to fix this flakiness: ``` ---- integration::repl::assign_underscore stdout ---- deno_exe path /home/runner/work/deno/deno/target/release/deno command /home/runner/work/deno/deno/target/release/deno repl command cwd /tmp/deno-cli-testK3YASC ------ Start Full Text ------ "" ------- End Full Text ------- Next text: "" thread 'integration::repl::assign_underscore' panicked at test_util/src/pty.rs:41:11: Timed out. stack backtrace: ```
2023-11-17chore: combine `TestCommandBuilder` with `DenoCmd` (#21248)David Sherret
2023-11-17chore: various improvements to tests (#21222)David Sherret
2023-11-14feat(lsp): upgrade check on init and notification (#21105)Nayeem Rahman
2023-11-14chore: switch compile tests over to the TestBuilder (#21180)David Sherret
2023-11-08chore: refactor test_server and move to rustls-tokio-stream (#21117)Matt Mastracci
Remove tokio-rustls as a direct dependency of Deno and refactor test_server to reduce code duplication. All tcp and tls listener paths go through the same streams now, with the exception of the simpler Hyper http-only handlers (those can be done in a later follow-up). Minor bugs fixed: - gRPC server should only serve h2 - WebSocket over http/2 had a port overlap - Restored missing eye-catchers for some servers (still missing on Hyper ones)
2023-11-06fix(byonm): correct resolution for scoped packages (#21083)David Sherret
2023-11-01feat(ext/websocket): websockets over http2 (#21040)Matt Mastracci
Implements `WebSocket` over http/2. This requires a conformant http/2 server supporting the extended connect protocol. Passes approximately 100 new WPT tests (mostly `?wpt_flags=h2` versions of existing websockets APIs). This is implemented as a fallback when http/1.1 fails, so a server that supports both h1 and h2 WebSockets will still end up on the http/1.1 upgrade path. The patch also cleas up the websockets handshake to split it up into http, https+http1 and https+http2, making it a little less intertwined. This uncovered a likely bug in the WPT test server: https://github.com/web-platform-tests/wpt/issues/42896
2023-10-31chore: update ext/kv to use denokv_* crates (#20986)Luca Casonato
This commit updates the ext/kv module to use the denokv_* crates for the protocol and the sqlite backend. This also fixes a couple of bugs in the sqlite backend, and updates versionstamps to be updated less linearly.
2023-10-26chore: update base64 crate (#20877)Luca Casonato
2023-10-25feat(unstable): ability to `npm install` then `deno run main.ts` (#20967)David Sherret
This PR adds a new unstable "bring your own node_modules" (BYONM) functionality currently behind a `--unstable-byonm` flag (`"unstable": ["byonm"]` in a deno.json). This enables users to run a separate install command (ex. `npm install`, `pnpm install`) then run `deno run main.ts` and Deno will respect the layout of the node_modules directory as setup by the separate install command. It also works with npm/yarn/pnpm workspaces. For this PR, the behaviour is opted into by specifying `--unstable-byonm`/`"unstable": ["byonm"]`, but in the future we may make this the default behaviour as outlined in https://github.com/denoland/deno/issues/18967#issuecomment-1761248941 This is an extremely rough initial implementation. Errors are terrible in this and the LSP requires frequent restarts. Improvements will be done in follow up PRs.
2023-10-24perf(lsp): cleanup workspace settings scopes (#20937)Nayeem Rahman
2023-09-24fix(lsp): resolve remote import maps (#20651)Nayeem Rahman