summaryrefslogtreecommitdiff
path: root/tests/util
AgeCommit message (Collapse)Author
2024-11-14fix: otel resiliency (#26857)snek
Improving the breadth of collected data, and ensuring that the collected data is more likely to be successfully reported. - Use `log` crate in more places - Hook up `log` crate to otel - Switch to process-wide otel processors - Handle places that use `process::exit` Also adds a more robust testing framework, with a deterministic tracing setting. Refs: https://github.com/denoland/deno/issues/26852
2024-11-13feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a ↵David Sherret
package.json (#26439) This will respect `"type": "commonjs"` in a package.json to determine if `.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to be ESM it will be loaded as ESM though.
2024-11-06chore: serve node headers from a test server to fix flaky `node-gyp` test ↵Nathan Whitaker
(#26749) Fixes https://github.com/denoland/deno/issues/24749 Runs a server that just returns the header tarball and checksum, and sets the `NODEJS_ORG_MIRROR` env var so that `node-gyp` uses it instead of `nodejs.org`
2024-10-24chore: remove print debugging from test server (#26529)David Sherret
Accidentally added in https://github.com/denoland/deno/pull/26473/files
2024-10-24fix: `.npmrc` settings not being passed to install/add command (#26473)Marvin Hagemeister
We weren't passing the resolved npmrc settings to the install commands. This lead us to always fall back to the default registry url instead of using the one from npmrc. Fixes https://github.com/denoland/deno/issues/26139 Fixes https://github.com/denoland/deno/issues/26033 Fixes https://github.com/denoland/deno/issues/25924 Fixes https://github.com/denoland/deno/issues/25822 Fixes https://github.com/denoland/deno/issues/26152 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-21feat(lsp): interactive inlay hints (#26382)Nayeem Rahman
2024-10-19chore: update nix crate (#26422)Leo Kettmeir
Dedupes nix dependency, since `rustyline` depends on a newer version that what we currently use
2024-09-12chore: update `std` submodule (#25595)Asher Gomez
Unblocks #25551
2024-09-10feat(cli): use NotCapable error for permission errors (#25431)Luca Casonato
Closes #7394 --------- Co-authored-by: snek <snek@deno.com>
2024-09-02feat(lsp): html/css/yaml file formatting (#25353)Nayeem Rahman
2024-08-31chore: remove DENO_FUTURE=1 from spec tests (#25329)Bartek Iwańczuk
Towards https://github.com/denoland/deno/issues/25241
2024-08-24refactor(lsp): changes for lsp_types 0.97.0 (#25169)Nayeem Rahman
2024-08-21fix(lsp): resolve jsx import source with types mode (#25064)Nayeem Rahman
2024-07-29chore: upgrade to rust 1.80 (#24778)Satya Rohith
2024-07-25fix(unstable): move sloppy-import warnings to lint rule (#24710)David Sherret
Adds a new `no-sloppy-imports` lint rule and cleans up the lint code. Closes #22844 Closes https://github.com/denoland/deno_lint/issues/1293
2024-07-25chore: update to `std@2024.07.19` (#24715)Asher Gomez
2024-07-23fix(upgrade): do not error if config in cwd invalid (#24689)David Sherret
``` > deno upgrade error: Unsupported lockfile version 'invalid'. Try upgrading Deno or recreating the lockfile. V:\scratch > V:\deno\target\debug\deno upgrade Looking up latest version Local deno version 1.45.3 is the most recent release ``` Closes #24517 Closes #20729
2024-07-18Reland "refactor(fetch): reimplement fetch with hyper instead of reqwest" ↵Bartek Iwańczuk
(#24593) Originally landed in https://github.com/denoland/deno/commit/f6fd6619e708a515831f707438368d81b0c9aa56. Reverted in https://github.com/denoland/deno/pull/24574. This reland contains a fix that sends "Accept: */*" header for calls made from "FileFetcher". Absence of this header made downloading source code from JSR broken. This is tested by ensuring this header is present in the test server that servers JSR packages. --------- Co-authored-by: Sean McArthur <sean@seanmonstar.com>
2024-07-10chore: fix flaky publish::npm_workspace test (#24511)David Sherret
2024-07-10feat(node): Support executing npm package lifecycle scripts ↵Nathan Whitaker
(preinstall/install/postinstall) (#24487) Adds support for running npm package lifecycle scripts, opted into via a new `--allow-scripts` flag. With this PR, when running `deno cache` (or `DENO_FUTURE=1 deno install`) you can specify the `--allow-scripts=pkg1,pkg2` flag to run lifecycle scripts attached to the given packages. Note at the moment this only works when `nodeModulesDir` is true (using the local resolver). When a package with un-run lifecycle scripts is encountered, we emit a warning suggesting things may not work and to try running lifecycle scripts. Additionally, if a package script implicitly requires `node-gyp` and it's not found on the system, we emit a warning. Extra things in this PR: - Extracted out bits of `task.rs` into a separate module for reuse - Added a couple fields to `process.config` in order to support `node-gyp` (it relies on a few variables being there) - Drive by fix to downloading new npm packages to test registry --- TODO: - [x] validation for allow-scripts args (make sure it looks like an npm package) - [x] make allow-scripts matching smarter - [ ] figure out what issues this closes --- Review notes: - This adds a bunch of deps to our test registry due to using `node-gyp`, so it's pretty noisy
2024-07-04feat: npm workspace and better Deno workspace support (#24334)David Sherret
Adds much better support for the unstable Deno workspaces as well as support for npm workspaces. npm workspaces is still lacking in that we only install packages into the root node_modules folder. We'll make it smarter over time in order for it to figure out when to add node_modules folders within packages. This includes a breaking change in config file resolution where we stop searching for config files on the first found package.json unless it's in a workspace. For the previous behaviour, the root deno.json needs to be updated to be a workspace by adding `"workspace": ["./path-to-pkg-json-folder-goes-here"]`. See details in https://github.com/denoland/deno_config/pull/66 Closes #24340 Closes #24159 Closes #24161 Closes #22020 Closes #18546 Closes #16106 Closes #24160
2024-07-02chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24388)Bartek Iwańczuk
Reland of https://github.com/denoland/deno/pull/24056 that doesn't suffer from the problem that was discovered in https://github.com/denoland/deno/pull/24261. It uses upgraded `hyper` and `hyper-util` that fixed the previous problem in https://github.com/hyperium/hyper/pull/3691.
2024-07-01fix(windows): check USERPROFILE env var for finding home directory (#24384)David Sherret
2024-06-27fix(ext/node): discover .npmrc in user's homedir (#24021)Bartek Iwańczuk
This commit adds discovery of `.npmrc` files in user's homedir. This is not a perfect fix as it doesn't merge multiple `.npmrc` files together as per https://github.com/denoland/deno/issues/23954 but allows to fallback if no `.npmrc` file is discovered in the project root.
2024-06-19Revert "chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24056)" (#24262)Bartek Iwańczuk
This reverts commit fb31eaa9ca59f6daaee0210d5cd206185c7041b9. Reverting because users reported spurious errors when downloading dependencies - https://github.com/denoland/deno/issues/24260. Closes https://github.com/denoland/deno/issues/24260
2024-06-13chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24056)Bartek Iwańczuk
This commit updates Deno to use `reqwest` at 0.12.4 and `rustls` at 0.22. Other related crates were updated as well to match versions accepted by `reqwest` and `rustls`. Note: we are not using the latest available `rustls` yet, but this upgrade was non-trivial already, so a bump to 0.23 for `rustls` will be done in a separate commit. Closes #23370 --------- Signed-off-by: Ryan Dahl <ry@tinyclouds.org> Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-06-08fix(ext/node): lossy UTF-8 read node_modules files (#24140)Luca Casonato
Previously various reads of files in `node_modules` would error on invalid UTF-8. These were cases involving: - reading package.json from Rust - reading package.json from JS - reading CommonJS files from JS - reading CommonJS files from Rust (for ESM translation) - reading ESM files from Rust
2024-06-06chore: support `-- --nocapture` in the spec tests (#24113)David Sherret
2024-06-05fix(npm): use configured auth for tarball urls instead of scope auth (#24111)David Sherret
Deno was using the scope auth for the tarball urls, which is not always correct. We are going to do a release immediately for this issue.
2024-05-29perf(lsp): lock out requests until init is complete (#23998)Nayeem Rahman
2024-05-28feat(vendor): support modifying remote files in vendor folder without ↵David Sherret
checksum errors (#23979) Includes: * https://github.com/denoland/deno_graph/pull/486 * https://github.com/denoland/deno_graph/pull/488 * https://github.com/denoland/deno_lockfile/pull/25 * https://github.com/denoland/deno_lockfile/pull/22 * https://github.com/denoland/deno_graph/pull/483 * https://github.com/denoland/deno_graph/pull/470
2024-05-23FUTURE: initial support for .npmrc file (#23560)Bartek Iwańczuk
This commit adds initial support for ".npmrc" files. Currently we only discover ".npmrc" files next to "package.json" files and discovering these files in user home dir is left for a follow up. This pass supports "_authToken" and "_auth" configuration for providing authentication. LSP support has been left for a follow up PR. Towards https://github.com/denoland/deno/issues/16105
2024-05-22chore(repl): maybe improve repl test flakiness on the CI (#23933)David Sherret
These repl tests are still a bit flaky. Let's try this. https://github.com/denoland/deno/actions/runs/9176525869/job/25232001263
2024-05-15chore: Fix flaky semantic tokens caching test (#23831)Nathan Whitaker
The stderr stream from the LSP is consumed by a separate thread, so it may not have processed the part we care about yet. Instead, wait until you see the measure for the request you care about.
2024-05-15perf(lsp): Cache semantic tokens for open documents (#23799)Nathan Whitaker
VScode will typically send a `textDocument/semanticTokens/full` request followed by `textDocument/semanticTokens/range`, and occassionally request semantic tokens even when we know nothing has changed. Semantic tokens also get refreshed on each change. Computing semantic tokens is relatively heavy in TSC, so we should avoid it as much as possible. Caches the semantic tokens for open documents, to avoid making TSC do unnecessary work. Results in a noticeable improvement in local benchmarking before: ``` Starting Deno benchmark -> Start benchmarking lsp - Simple Startup/Shutdown (10 runs, mean: 383ms) - Big Document/Several Edits (5 runs, mean: 1079ms) - Find/Replace (10 runs, mean: 59ms) - Code Lens (10 runs, mean: 440ms) - deco-cx/apps Multiple Edits + Navigation (5 runs, mean: 9921ms) <- End benchmarking lsp ``` after: ``` Starting Deno benchmark -> Start benchmarking lsp - Simple Startup/Shutdown (10 runs, mean: 395ms) - Big Document/Several Edits (5 runs, mean: 1024ms) - Find/Replace (10 runs, mean: 56ms) - Code Lens (10 runs, mean: 438ms) - deco-cx/apps Multiple Edits + Navigation (5 runs, mean: 8927ms) <- End benchmarking lsp ```
2024-05-14fix(lsp): show reference code lens on methods (#23804)Nayeem Rahman
2024-05-14chore(tests): increase repl timeout on ci (#23812)David Sherret
https://github.com/denoland/deno/actions/runs/9084225162/job/24964698935 ``` ---- run::file_fetcher_preserves_permissions stdout ---- command /Users/runner/work/deno/deno/target/debug/deno repl --quiet command cwd /Users/runner/work/deno/deno/tests/testdata ------ Start Full Text ------ "const a = await import('http://localhost:4545/run/019_media_types.ts');\r\n" ------- End Full Text ------- Next text: "\r\n" thread 'run::file_fetcher_preserves_permissions' panicked at tests/integration/run_tests.rs:4615:15: Timed out. ``` Closes https://github.com/denoland/deno/issues/23690 Closes https://github.com/denoland/deno/issues/23682 Closes https://github.com/denoland/deno/issues/23625
2024-05-09fix(lsp): move sloppy import resolution from loader to resolver (#23751)Nathan Whitaker
Moves sloppy import resolution from the loader to the resolver. Also adds some test helper functions to make the lsp tests less verbose --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2024-05-08chore: enable clippy::print_stdout and clippy::print_stderr (#23732)David Sherret
1. Generally we should prefer to use the `log` crate. 2. I very often accidentally commit `eprintln`s. When we should use `println` or `eprintln`, it's not too bad to be a bit more verbose and ignore the lint rule.
2024-05-07chore: fix flaky net_listen_allow_localhost_4555 (#23726)David Sherret
Moves the test npm registry server port from `4558` to `426x`
2024-05-07chore(test): move npm registries to separate servers and to the ↵David Sherret
`tests/registry` folder (#23717) 1. Moves the npm registries to their own dedicated ports. 2. Moves the data files out of `tests/testdata/npm/registry` to `tests/registry/npm`.
2024-05-06fix(lsp): Pass diagnostic codes to TSC as numbers (#23720)Nathan Whitaker
Fixes the `Debug Failure` errors described in https://github.com/denoland/deno/issues/23643#issuecomment-2094552765 . The issue here was that we were passing diagnostic codes as strings but TSC expects the codes to be numbers. This resulted in some quick fixes not working (as illustrated by the test added here which fails before this PR). The first commit is the actual fix. The rest are just test related.
2024-05-03chore: maybe make watcher tests less flaky (#23683)David Sherret
Closes #23637
2024-05-03chore: move cert itests to spec tests (#23607)David Sherret
2024-05-03test: npm registry handles two test scopes (#23663)Bartek Iwańczuk
This commit updates our testing npm registry to handle additional `@denotest2` scope in addition to `@denotest` scope. I might have to update it further in the future to handle additional scopes, but it's good enough for now.
2024-04-30feat(cli): add support for jsxImportSourceTypes (#23419)Luca Casonato
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-04-27fix(compile): certain jsr specifiers sometimes can't load (#23567)David Sherret
When returning a jsr specifier for resolve it seems like deno core does not work properly and hangs. Closes https://github.com/denoland/deno/issues/23551 Closes https://github.com/denoland/deno/issues/23139
2024-04-26test: cleanup npm test registry code (#23578)Bartek Iwańczuk
Required for https://github.com/denoland/deno/pull/23560
2024-04-26test: update for private npm registry test server (#23572)Bartek Iwańczuk
Factored out from https://github.com/denoland/deno/pull/23560 to make it easier to review.
2024-04-25chore: rework TLS code in test server (#23566)Matt Mastracci
In order to make the reqwest/rustls upgrade more straightforward, we refactor the test server to depend on deno_tls.