summaryrefslogtreecommitdiff
path: root/test_util
AgeCommit message (Collapse)Author
2024-02-23chore: revert submodule creation in test_util (#22572)David Sherret
Looks accidentally added back in https://github.com/denoland/deno/pull/22563/files
2024-02-23feat: infer dependencies from package.json (#22563)Marvin Hagemeister
<!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/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. --> This PR enhances the `deno publish` command to infer dependencies from `package.json` if present.
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-16chore: move `test_util/wpt` to `tests/wpt/suite` (#22412)Asher Gomez
As discussed with @mmastrac. I'll move `tools/wpt` to `tests/wpt` in a follow-up PR. --------- 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: update WPT (#22312)Bartek Iwańczuk
Fixes https://github.com/denoland/deno/issues/22257
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-26refactor: change cli/ to use hyper 1.1 (#21705)Bartek Iwańczuk
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-12-02chore: update std to 0.208.0 (#21318)Asher Gomez
Re-attempt at #21284. I was more thorough this time. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.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-22Revert "chore: update to `std@0.207.0` (#21284)" (#21295)Bartek Iwańczuk
This reverts commit 20aa0796e6ff7651cdfce4d0292bdb11da5dfe2e. `main` has been failing consistenly on `kv_undelivered_test` and `serve_test` after this upgrade.
2023-11-22chore: update to `std@0.207.0` (#21284)Asher Gomez
Closes #21002
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-18chore: update wpt (#21255)Leo Kettmeir
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