summaryrefslogtreecommitdiff
path: root/test_util
AgeCommit message (Collapse)Author
2023-11-14chore: switch compile tests over to the TestBuilder (#21180)David Sherret
2023-11-13chore: update wpt (#21178)Leo Kettmeir
For #20849
2023-11-11chore(ext/node): use libz-sys w/`zlib-ng` feature in node (#21158)Matt Mastracci
We only want one zlib dependency. Zlib dependencies are reorganized so they use a hidden `__vendored_zlib_ng` flag in cli that enables zlib-ng for both libz-sys (used by ext/node) and flate2 (used by deno_web).
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-28Revert "chore: update deno_std submodule (#20994)" (#21001)Bartek Iwańczuk
This reverts commit 6e2abb2b13af5dff5d631fb1bc0c279c49ebd066.
2023-10-27chore: update deno_std submodule (#20994)Bartek Iwańczuk
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-10-10fix(ext/web): writability of `ReadableStream.from` (#20836)Luca Casonato
Fixes a WPT in `URL` and `ReadableStream`. Some unrelated WPT expectation changes due to WPT update.
2023-09-24fix(lsp): resolve remote import maps (#20651)Nayeem Rahman
2023-09-24refactor(lsp): implement "deno.cacheOnSave" server-side (#20632)Nayeem Rahman
2023-09-21refactor(lsp): store language sections in WorkspaceSettings (#20593)Nayeem Rahman
When sending configuration requests to the client, reads `javascript` and `typescript` sections in addition to `deno`. The LSP's initialization options now accepts `javascript` and `typescript` namespaces.
2023-09-18feat(unstable): package manager (#20517)David Sherret
Adds an experimental unstable built-in package manager to Deno, but it is currently not usable because the registry infrastructure hasn't been setup and it points to a non-existent url by default. The default registry url can be configured via the `DENO_REGISTRY_URL` environment variable.
2023-09-15feat(ext/node): http2.connect() API (#19671)Bartek Iwańczuk
This commit improves compatibility of "node:http2" module by polyfilling "connect" method and "ClientHttp2Session" class. Basic operations like streaming, header and trailer handling are working correctly. Refing/unrefing is still a TODO and "npm:grpc-js/grpc" is not yet working correctly. --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-09-14refactor: remove `DENO_UNSTABLE_NPM_SYNC_DOWNLOAD` and custom sync ↵David Sherret
functionality (#20504) https://github.com/denoland/deno/pull/20488 enables us to remove this functionality. This is better because our test suite is now not testing a separate code path.
2023-09-14chore(tests): ability to pattern match unordered lines (#20488)David Sherret
This adds the ability to pattern match unordered lines. For example, the downloading messages may appear in any order ``` [UNORDERED_START] Download https://localhost:4546/a.ts Download https://localhost:4546/b.ts [UNORDERED_END] Hello! ``` Additionally, I've made the pattern matching slightly more strict and the output better.
2023-09-13feat(lsp): WorkspaceSettings::disablePaths (#20475)Nayeem Rahman
2023-09-09Reland "refactor(lsp): clean up "enablePaths" handling (#20388)" (#20423)Nayeem Rahman
2023-09-08Revert "refactor(lsp): clean up "enablePaths" handling (#20388)" (#20419)Nayeem Rahman
This reverts commit 4a11603c76b13ecf92ce3141ec317a42ae9f8d1d.
2023-09-08refactor(lsp): clean up "enablePaths" handling (#20388)Nayeem Rahman
Previously we pre-computed enabled paths into `Config::enabled_paths`, and had to keep updating it. Now we determine enabled paths directly from `Config::settings` on demand as a single source of truth. Removes `Config::root_uri`. If `InitializeParams::rootUri` is given, and it doesn't correspond to a folder in `InitializeParams::workspaceFolders`, prepend it to `Config::workspace_folders` as a mocked folder. Includes groundwork for https://github.com/denoland/vscode_deno/issues/908. In a minor version cycle or two we can fix that in vscode_deno, and it won't break for Deno versions post this patch due to the corrected deserialization logic for `enablePaths`.
2023-09-02fix(lsp): properly handle disabled configuration requests (#20358)Nayeem Rahman
Fixes #19802. Properly respect when clients do not have the `workspace/configuration` capability, a.k.a. when an editor cannot provide scoped settings on request from the LSP. - Fix one spot where we weren't checking for the capability before sending this request. - For `enablePaths`, fall back to the settings passed in the initialization options in more cases. - Respect the `workspace/configuration` capability in the test harness client. See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_configuration.
2023-08-29chore(cli): use NPM_CONFIG_REGISTRY for all tests (#20320)Matt Mastracci
We never want tests to hit the real npm registry because this causes test flakes. In addition, we set a sentinal "unset" value for `NPM_CONFIG_REGISTRY` to ensure that all tests requiring npm go through the test server.
2023-08-26chore: update to Rust 1.72 (#20258)林炳权
<!-- Before submitting a PR, please read https://deno.com/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> As the title. --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-08-22feat(ext/kv): connect to remote database (#20178)Heyang Zhou
This patch adds a `remote` backend for `ext/kv`. This supports connection to Deno Deploy and potentially other services compatible with the KV Connect protocol.
2023-08-17fix(unstable): disable importing from the vendor directory (#20067)David Sherret
Some people might get think they need to import from this directory, which could cause confusion and duplicate dependencies. Additionally, the `vendor` directory has special behaviour in the language server, so importing from the folder will definitely cause confusion and issues there.
2023-08-10chore: upgrade fastwebsockets to 0.4.4 (#19089)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/19041
2023-08-09chore(test_util): Increate pty timeout to 15s to avoid flakes (#20109)Matt Mastracci
Mac builds are occasionally flaking out on these.
2023-08-03chore: fix pty support on Macs (#20037)Matt Mastracci
Many of the CI tests have been failing on my M2 Pro mac (Ventura 13.4) when running inside of a vscode terminal (a strange `ENOTTY` error). This modifies the pty-handling code to use libc directly rather than the older pty library that appears mostly unmaintained (outside of @littledivy's fork). As a bonus, this should allow us to run pty tests on the mac CI runner. After this PR, the tests now complete with 100% success on my local machine. Before this PR, I needed to pass `CI=true` to get my local test suite to pass.
2023-08-02feat(unstable/lsp): support navigating to deno_modules folder (#20030)David Sherret
Closes #20015 Closes https://github.com/denoland/vscode_deno/issues/850 (only for deno_modules, but I don't think this will be possible for the global cache)
2023-08-02feat(unstable): optional `deno_modules` directory (#19977)David Sherret
Closes #15633
2023-08-01fix: retry module download once if server errored (#17252)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/17251 Closes #19970 This commits adds logic to retry failed module downloads once. Both request and server errors are handled and the retry is done after 50 ms wait time.
2023-07-28chore: remove unused dependencies (#19962)Divy Srivastava
2023-07-28feat: Deno.createHttpClient allowHost (#19689)Leo Kettmeir
This adds an option to allow using the host header in a fetch call. Closes https://github.com/denoland/deno/issues/16840 Ref https://github.com/denoland/deno/issues/11017
2023-07-26chore: fix benchmarks (#19958)David Sherret
2023-07-26fix(lsp): handle import mapped `node:` specifier (#19956)David Sherret
Closes https://github.com/denoland/vscode_deno/issues/805
2023-07-26fix(check): should bust check cache when json module or npm resolution ↵David Sherret
changes (#19941) A small part of #19928.
2023-07-21fix(lsp): handle watched files events from symlinked config files (#19898)David Sherret
Related to https://github.com/denoland/vscode_deno/issues/784
2023-07-20fix(lsp): auto-discover deno.json in more cases (#19894)David Sherret
We weren't auto-discovering the deno.json in two cases: 1. A project that didn't have a deno.json and just added one. 2. After a syntax error in the deno.json. This now rediscovers it in both these cases. Closes https://github.com/denoland/vscode_deno/issues/867
2023-06-26feat(lock): skip saving declaration files in the lockfile (#19447)David Sherret
This is also a performance improvement because declaration file hashes don't need to be stored in the lockfile. Closes #19444
2023-06-26chore: Ensure copyright line is the first in the file (#19608)Matt Mastracci
The copyright checker was allowing files with code above the copyright line in a few places, mainly as a result of IDEs ordering imports improperly. This makes the check more robust, and adds a whitelist of valid lines that may appear before the copyright line.
2023-06-26chore: fix typos (#19572)Martin Fischer
2023-06-13fix(lsp): update import map config when deno.json changes (#19476)David Sherret
Half of #19468
2023-06-10chore(tests): test_util - Add `PathRef` (#19450)David Sherret
This adds a new `PathRef` struct to test_util for making it easier to work with paths in test code. I'm going to expand on this more in the future.
2023-06-09chore(tests): add `.use_symlinked_temp_dir()` to `TestBuilder` (#19435)David Sherret
This allows easily using a symlinked temporary directory, which is useful for debugging issues locally that happen on the CI with a symlinked temporary directory. For example: ```rs let context = TestContextBuilder::new() .use_temp_cwd() .use_symlinked_temp_dir() // add this .build(); ```
2023-06-08chore: update wpt (#19422)Leo Kettmeir
2023-06-06fix(node/http): use fake socket and proper url handling (#19340)Leo Kettmeir
Fixes https://github.com/denoland/deno/issues/19349 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>