summaryrefslogtreecommitdiff
path: root/test_util/src
AgeCommit message (Collapse)Author
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-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-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>
2023-05-31refactor: further work on node http client (#19327)Leo Kettmeir
Closes https://github.com/denoland/deno/issues/18300
2023-05-27fix(compile): inline symlinks as files outside node_modules dir and warn for ↵David Sherret
directories (#19285) If a symlink within the `node_modules` directory lies outside that directory, it will now warn and inline the file. For directories, it will just warn for now. Probably fixes #19251 (I'm still unable to reproduce).
2023-05-26fix(compile): implicit read permission to npm vfs (#19281)David Sherret
Closes #19280
2023-05-26chore(lsp/tests): diagnostic synchronization (reland) (#19270)David Sherret
Merge on approval as it fixes the flaky test.
2023-05-26Revert "chore(lsp/tests): diagnostic synchronization (#19264)" (#19268)Bartek Iwańczuk
This reverts commit 89026abe395c22eb2ace4ea5f948189daa1dadf1. This change caused LSP benchmarks to fail on `main`.
2023-05-26chore(lsp/tests): diagnostic synchronization (#19264)David Sherret
Fixes the flaky lsp test by having better synchronization of diagnostics between the client and server for testing purposes.
2023-05-22feat(lsp): support lockfile and node_modules directory (#19203)David Sherret
This adds support for the lockfile and node_modules directory to the lsp. In the case of the node_modules directory, it is only enabled when explicitly opted into via `"nodeModulesDir": true` in the configuration file. This is to reduce the language server automatically modifying the node_modules directory when the user doesn't want it to. Closes #16510 Closes #16373
2023-05-23refactor: further work on node http client (#19211)Leo Kettmeir
2023-05-22chore(cli): One Rust test per JS and Node unit test file (#19199)Matt Mastracci
This runs our `js_unit_tests` and `node_unit_tests` in parallel, one rust test per JS unit test file. Some of our JS tests don't like running in parallel due to port requirements, so this also makes those use a specific port-per-file. This does not attempt to make the node-compat tests work.
2023-05-21feat(unstable): add more options to Deno.createHttpClient (#17385)Leo Kettmeir
2023-05-19feat(vendor): support for npm specifiers (#19186)David Sherret
We never properly added support for this. This fixes vendoring when it has npm or node specifiers. Vendoring occurs by adding a `"nodeModulesDir": true` property to deno.json then it uses a local node_modules directory. This can be opted out by setting `"nodeModulesDir": false` or running with `--node-modules-dir=false`. Closes #18090 Closes #17210 Closes #17619 Closes #16778
2023-05-17fix(npm): improved optional dependency support (#19135)David Sherret
Note: If the package information has already been cached, then this requires running with `--reload` or for the registry information to be fetched some other way (ex. the cache busting). Closes #15544 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-17fix: support "fetch" over HTTPS for IP addresses (#18499)Bartek Iwańczuk
This commit adds support for connecting to IP addresses over HTTPS. This is done by updating "rustls" to "0.21.0" and other related crates. Closes https://github.com/denoland/deno/issues/7660 Closes https://github.com/denoland/deno/issues/17967 --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-05-11feat(lsp): ability to configure document pre-load limit (#19097)David Sherret
Adds a `deno.preloadLimit` option (ex. `"deno.preloadLimit": 2000`) which specifies how many file entries to traverse on the file system when the lsp loads or its configuration changes. Closes #18955
2023-05-10feat(compile): unstable npm and node specifier support (#19005)David Sherret
This is the initial support for npm and node specifiers in `deno compile`. The npm packages are included in the binary and read from it via a virtual file system. This also supports the `--node-modules-dir` flag, dependencies specified in a package.json, and npm binary commands (ex. `deno compile --unstable npm:cowsay`) Closes #16632
2023-04-22refactor: rewrite tests to "fastwebsockets" crate (#18781)Bartek Iwańczuk
Migrating off of `tokio-tungstenite` crate. --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>