summaryrefslogtreecommitdiff
path: root/test_util/src
AgeCommit message (Collapse)Author
2023-04-13refactor(cli,ext,ops): cleanup `regex` with `lazy-regex` (#17296)Yiyu Lin
- bump deps: the newest `lazy-regex` need newer `oncecell` and `regex` - reduce `unwrap` - remove dep `lazy_static` - make more regex cached --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-06fix(npm): reload an npm package's dependency's information when version not ↵David Sherret
found (#18622) This reloads an npm package's dependency's information when a version/version req/tag is not found. This PR applies only to dependencies of npm packages. It does NOT yet cause npm specifiers to have their dependency information cache busted. That requires a different solution, but this should help cache bust in more scenarios. Part of #16901, but doesn't close it yet
2023-04-01fix(check): ensure diagnostics caused by changes in other files get ↵David Sherret
invalidated between runs (#18541) Regression caused by the performance improvement in #18329. Figuring this out was hard. It's luckily still fast after this change. Closes #18516
2023-03-30fix(lsp): include all diagnosable documents on initialize (#17979)David Sherret
Closes https://github.com/denoland/vscode_deno/issues/797 Closes https://github.com/denoland/deno/issues/11190 Closes https://github.com/denoland/vscode_deno/issues/811 Closes https://github.com/denoland/vscode_deno/issues/761 Closes https://github.com/denoland/vscode_deno/issues/585 Closes https://github.com/denoland/vscode_deno/issues/561 Closes https://github.com/denoland/vscode_deno/issues/410
2023-03-30fix(repl): improve package.json support (#18497)David Sherret
1. Fixes a cosmetic issue in the repl where it would display lsp warning messages. 2. Lazily loads dependencies from the package.json on use. 3. Supports using bare specifiers from package.json in the REPL. Closes #17929 Closes #18494
2023-03-28chore: restore pty tests and make them run on the Linux CI (#18424)David Sherret
1. Rewrites the tests to be more back and forth rather than getting the output all at once (which I believe was causing the hangs on linux and maybe mac) 2. Runs the pty tests on the linux ci. 3. Fixes a bunch of tests that were just wrong. 4. Adds timeouts on the pty tests.
2023-03-27feat(core): initialize SQLite off-main-thread (#18401)Matt Mastracci
This gets SQLite off the flamegraph and reduces initialization time by somewhere between 0.2ms and 0.5ms. In addition, I took the opportunity to move all the cache management code to a single place and reduce duplication. While the PR has a net gain of lines, much of that is just being a bit more deliberate with how we're recovering from errors. The existing caches had various policies for dealing with cache corruption, so I've unified them and tried to isolate the decisions we make for recovery in a single place (see `open_connection` in `CacheDB`). The policy I chose was: 1. Retry twice to open on-disk caches 2. If that fails, try to delete the file and recreate it on-disk 3. If we fail to delete the file or re-create a new cache, use a fallback strategy that can be chosen per-cache: InMemory (temporary cache for the process run), BlackHole (ignore writes, return empty reads), or Error (fail on every operation). The caches all use the same general code now, and share the cache failure recovery policy. In addition, it cleans up a TODO in the `NodeAnalysisCache`.
2023-03-22chore(test_util): replace tempdir code w/tempdir crate (#18340)Matt Mastracci
2023-03-17fix(test_util): parse strace usecs/call in total line if present (#18241)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/18235
2023-03-17BREAKING(unstable): remove WebGPU (#18094)Leo Kettmeir
This PR _**temporarily**_ removes WebGPU (which has behind the `--unstable` flag in Deno), due to performance complications due to its presence. It will be brought back in the future; as a point of reference, Chrome will ship WebGPU to stable on 26/04/2023. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-15chore: add test for ws ping/pong (#18204)Divy Srivastava
This commit adds test for https://github.com/denoland/deno/issues/17761 which was fixed by https://github.com/denoland/deno/pull/17762. Verified that test fails on Deno 1.30.1
2023-03-15fix(lsp): avoid calling client while holding lock (#18197)David Sherret
2023-03-13fix(npm): show a progress bar when initializing the node_modules folder (#18136)David Sherret
Creating the node_modules folder when the packages are already downloaded can take a bit of time and not knowing what is going on can be confusing. It's better to show a progress bar.
2023-03-09refactor(tests/lsp): consolidate more into test LspClient and reduce ↵David Sherret
verbosity (#18100)
2023-03-09chore: update Rust to 1.68.0 (#18102)Bartek Iwańczuk
2023-03-08refactor(lsp): improve test client initialization (#18015)David Sherret
2023-03-06chore(tests): ability to capture stdout and stderr separately (#18035)David Sherret
This is to allow making assertions on stdout and stderr separately.
2023-03-03fix: lazily surface errors in package.json deps parsing (#17974)David Sherret
Closes #17941
2023-02-28chore(test): remove TestCommandOutput macros (#17975)David Sherret
2023-02-27chore: test builders for integration tests (#17965)David Sherret
Start of adding test builders to simplify integration tests. I only updated a few test files. We can complete upgrading over time.
2023-02-24fix: ensure concurrent non-statically analyzable dynamic imports do not ↵David Sherret
sometimes fail (#17923) Closes #17918
2023-02-22feat(task): support scripts in package.json (#17887)David Sherret
This is a super basic initial implementation. We don't create a `node_modules/.bin` folder at the moment and add it to the PATH like we should which is necessary to make command name resolution in the subprocess work properly (ex. you run a script that launches another script that then tries to launch an "npx command"... this won't work atm). Closes #17492
2023-02-22fix(npm): resolve node_modules dir relative to package.json instead of cwd ↵David Sherret
(#17885)
2023-02-20feat: auto-discover package.json for npm dependencies (#17272)Bartek Iwańczuk
This commits adds auto-discovery of "package.json" file when running "deno run" and "deno task" subcommands. In case of "deno run" the "package.json" is being looked up starting from the directory of the script that is being run, stopping early if "deno.json(c)" file is found (ie. FS tree won't be traversed "up" from "deno.json"). When "package.json" is discovered the "--node-modules-dir" flag is implied, leading to creation of local "node_modules/" directory - we did that, because most tools relying on "package.json" will expect "node_modules/" directory to be present (eg. Vite). Additionally "dependencies" and "devDependencies" specified in the "package.json" are downloaded on startup. This is a stepping stone to supporting bare specifier imports, but the actual integration will be done in a follow up commit. --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2023-02-15feat: wire up ext/node to the Node compatibility layer (#17785)Bartek Iwańczuk
This PR changes Node.js/npm compatibility layer to use polyfills for built-in Node.js embedded in the snapshot (that are coming from "ext/node" extension). As a result loading `std/node`, either from "https://deno.land/std@<latest>/" or from "DENO_NODE_COMPAT_URL" env variable were removed. All code that is imported via "npm:" specifiers now uses code embedded in the snapshot. Several fixes were applied to various modules in "ext/node" to make tests pass. --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-02-10feat(install): follow redirects for urls with no path (#17449)Kamil Ogórek
This change makes absolute urls, that contain no path like `deno install https://my-cli.io` to follow redirects and extract the name from it. It allows modifies `test_util` server listener on port `4550` (`REDIRECT_ABSOLUTE_PORT`) to allow for specifying `redirect_to` query param, that fill use that value for it's next redirect. Fixes https://github.com/denoland/deno/issues/17409
2023-02-03refactor: reland "preserve ProcState::file_fetcher between restarts" (#17636)Nayeem Rahman
Just some watcher init step that I thought would be "cloned over" but needs to be done again on reset.
2023-01-30Revert "fix(watch): preserve `ProcState::file_fetcher` between restarts ↵Bartek Iwańczuk
(#15466) (#17591) This reverts commit 3545bff678f20c3fdf17fe6b26f96cf1b74f917c.
2023-01-27chore: upgrade to Rust 1.67 (#17548)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-14chore: use rustfmt imports_granularity option (#17421)Divy Srivastava
Closes https://github.com/denoland/deno/issues/2699 Closes https://github.com/denoland/deno/issues/2347 Uses unstable rustfmt features. Since dprint invokes `rustfmt` we do not need to switch the cargo toolchain to nightly. Do we care about formatting stability of our codebase across Rust versions? (I don't)
2023-01-13chore: add `copyright_checker` tool and add the missing copyright (#17285)Yiyu Lin
2023-01-10fix(watch): preserve `ProcState::file_fetcher` between restarts (#15466)Nayeem Rahman
This commit changes "ProcState" to store "file_fetcher" field in an "Arc", allowing it to be preserved between restarts and thus keeping the state alive between the restarts. File watchers for "deno test" and "deno bench" now reset "ProcState" between restarts.
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-19chore(test): report correct cwd when running tests via itest macro (#17132)Kamil Ogórek
2022-12-19chore(test_util): use pty2 instead of pty (#17131)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/484 Removes dependency on winapi 0.2.x versions.
2022-12-07feat(npm): add support for `NPM_CONFIG_REGISTRY` (#16980)David Sherret
2022-11-30fix(lsp): analyze fs dependencies of dependencies to find npm package ↵David Sherret
requirements (#16866) Closes #16867
2022-11-28fix(npm): allow to inspect npm modules with --inspect-brk (#16841)Bartek Iwańczuk
2022-11-18chore: use Rust 1.65.0 (#16688)Aaron O'Mullan
2022-10-21feat(unstable/npm): initial type checking of npm specifiers (#16332)David Sherret
2022-10-16fix(cli/bench): skip strace table border (#16310)Marcos Casagrande
It crashes due to the table border output from `strace`, ``` % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- # this is skipped correctly 61.27 6.012053 678 8860 637 futex 0.00 0.000000 0 4 geteuid ------ ----------- ----------- --------- --------- ---------------- # this causes the crash 100.00 11.732230 25552 1205 total ``` It's flaky because that line is not always skipped from the output, for some reason that I've yet to find out.
2022-10-05feat(npm): implement Node API (#13633)Divy Srivastava
This PR implements the NAPI for loading native modules into Deno. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-09-22feat(npm): add flag for creating and resolving npm packages to a local ↵David Sherret
node_modules folder (#15971)
2022-09-19refactor: move out test files from root testdata directory into sub ↵David Sherret
directories (#15949)
2022-09-02fix(npm): respect `latest` dist tag for getting current version (#15746)David Sherret
2022-08-26chore(npm): add test for esm npm binary package (#15609)David Sherret
2022-08-25fix: avoid global declaration collisions in cjs (#15608)David Sherret
* Use a default stack size * 2 in debug for Windows because swc using so much stack size. We should look into this more later though.
2022-08-23feat: binary npm commands (#15542)David Sherret
2022-08-23fix(cache): do not attempt to emit non-emitable files (#15562)David Sherret
2022-08-22perf: cache swc dependency analysis and don't hold onto `ParsedSource`s in ↵David Sherret
memory (#15502)