summaryrefslogtreecommitdiff
path: root/cli/tools/test
AgeCommit message (Collapse)Author
2024-03-07fix(publish): make include and exclude work (#22720)David Sherret
1. Stops `deno publish` using some custom include/exclude behaviour from other sub commands 2. Takes ancestor directories into account when resolving gitignore 3. Backards compatible change that adds ability to unexclude an exclude by using a negated glob at a more specific level for all sub commands (see https://github.com/denoland/deno_config/pull/44).
2024-03-07fix(cli): limit test parallelism on Windows to avoid pipe error (#22776)Matt Mastracci
One last attempt to fix the parallelism issue on Windows.
2024-03-07fix(publish): properly display graph validation errors (#22775)David Sherret
The graph validation errors were displaying cryptically during publish. This fixes that.
2024-03-04fix(cli): remove possible deadlock in test channel (#22662)Matt Mastracci
The stderr stream could possibly starve the other bits of the output-redirecting event loop. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-03-04chore: fix typos (#22677)cui fliter
2024-03-01fix(cli): force flush output after test unloads (#22660)Matt Mastracci
Fixes flake in load_unload test
2024-03-01perf(cli): use new deno_core timers (#22569)Matt Mastracci
Improves #19100 Fixes #20356 Replaces #20428 Changes made in deno_core to support this: - [x] Errors must be handled in setTimeout callbacks - [x] Microtask ordering is not-quite-right - [x] Timer cancellation must be checked right before dispatch - [x] Timer sanitizer - [x] Move high-res timer to deno_core - [x] Timers need opcall tracing
2024-02-29fix(publish): disable provenance if not in GHA (#22638)Bartek Iwańczuk
The condition was wrong
2024-02-28fix(cli): ensure that pre- and post-test output is flushed at the ↵Matt Mastracci
appropriate times (#22611) Some `deno_std` tests were failing to print output that was resolved after the last test finished. In addition, output printed before tests began would sometimes appear above the "running X tests ..." line, and sometimes below it depending on timing. We now guarantee that all output is flushed before and after tests run, making the output consistent. Pre-test and post-test output are captured in `------ pre-test output ------` and `------ post-test output ------` blocks to differentiate them from the regular output blocks. Here's an example of a test (that is much noisier than normal, but an example of what the output will look like): ``` Check ./load_unload.ts ------- pre-test output ------- load ----- output end ----- running 1 test from ./load_unload.ts test ... ------- output ------- test ----- output end ----- test ... ok ([WILDCARD]) ------- post-test output ------- unload ----- output end ----- ```
2024-02-28chore(cli): rename `--trace-ops` to `--trace-leaks` (#22598)Matt Mastracci
As we add tracing to more types of runtime activity, `--trace-ops` is less useful of a name. `--trace-leaks` better reflects that this feature traces both ops and timers, and will eventually trace resource opening as well. This keeps `--trace-ops` as an alias for `--trace-leaks`, but prints a warning to the console suggesting migration to `--trace-leaks`. One test continues to use `--trace-ops` to test the deprecation warning. --------- Signed-off-by: Matt Mastracci <matthew@mastracci.com>
2024-02-27perf(cli): reduce overhead in test registration (#22552)Matt Mastracci
- Removes the origin call, since all origins are the same for an isolate (ie: the main module) - Collects the `TestDescription`s and sends them all at the same time inside of an Arc, allowing us to (later on) re-use these instead of cloning. Needs a follow-up pass to remove all the cloning, but that's a thread that is pretty long to pull --------- Signed-off-by: Matt Mastracci <matthew@mastracci.com>
2024-02-27chore: bump deno_core (#22596)Matt Mastracci
Migrations: - snapshot code updated - runtime stats API tweaks
2024-02-23refactor(cli): clean up test runner channels (#22422)Matt Mastracci
Gets us closer to solving #20707. Rewrites the `TestEventSender`: - Allow for explicit creation of multiple streams. This will allow for one-std{out,err}-per-worker - All test events are received along with a worker ID, allowing for eventual, proper parallel threading of test events. In theory this should open up proper interleaving of test output, however that is left for a future PR. I had some plans for a better performing synchronization primitive, but the inter-thread communication is tricky. This does, however, speed up the processing of large numbers of tests 15-25% (possibly even more on 100,000+). Before ``` ok | 1000 passed | 0 failed (32ms) ok | 10000 passed | 0 failed (276ms) ``` After ``` ok | 1000 passed | 0 failed (25ms) ok | 10000 passed | 0 failed (230ms) ```
2024-02-20perf(jsr): fast check cache and lazy fast check graph (#22485)David Sherret
2024-02-19chore(fs): rename `op_fs_file_stat_{async/sync}` ops (#22476)Asher Gomez
Renames `op_fs_fstat_{sync/async}` to `op_fs_file_stat_{async/sync}` in preparation of the upcoming removal of `Deno.fstat()` in v2.
2024-02-16refactor(cli): move op sanitizer to Rust (#22413)Matt Mastracci
The format of the sanitizers will change a little bit: - If multiple async ops leak and traces are on, we repeat the async op header once per stack trace. - All leaks are aggregated under a "Leaks detected:" banner as the new timers are eventually going to be added, and these are neither ops nor resources. - `1 async op` is now `An async op` - If ops and resources leak, we show both (rather than op leaks masking resources) Follow-on to https://github.com/denoland/deno/pull/22226
2024-02-16chore(ext/web): refactor timer ops before landing op sanitizer (#22435)Matt Mastracci
Splitting the sleep and interval ops allows us to detect an interval timer. We also remove the use of the `op_async_void_deferred` call. A future PR will be able to split the op sanitizer messages for timers and intervals.
2024-02-13chore: deno_core bump (#22407)Matt Mastracci
- Adding `None` flag for warmup script. - Modify opcall trace interface to match new Rust implementation
2024-02-10fix: cache bust jsr deps on constraint failure (#22372)David Sherret
Removes the `FileFetcher`'s internal cache because I don't believe it's necessary (we already cache this kind of stuff in places like deno_graph or config files in different places). Removing it fixes this bug because this functionality was already implemented in deno_graph and lowers memory usage of the CLI a little bit.
2024-02-09fix: upgrade to deno_ast 0.33 (#22341)David Sherret
* Uses diagnostics from deno_ast * Real fix for https://github.com/denoland/deno/pull/22310 * Moves `deno lint --json` code here * Upgrades swc Closes #22117 Closes #22109 Closes #21927 Closes #20993
2024-02-07chore: upgrade deno_core to 0.259.0 (#22311)Bartek Iwańczuk
This update brings number of ops available to user code down to 45.
2024-02-06chore(ws): remove unused op_ws_send_pong (#22283)Divy Srivastava
2024-02-05refactor(cli): Move op descriptions into Rust and prepare for op import (#22271)Matt Mastracci
This moves the op sanitizer descriptions into Rust code and prepares for eventual op import from `ext:core/ops`. We cannot import these ops from `ext:core/ops` as the testing infrastructure ops are not always present. Changes: - Op descriptions live in `cli` code and are currently accessible via an op for the older sanitizer code - `phf` dep moved to workspace root so we can use it here - `ops.op_XXX` changed to to `op_XXX` to prepare for op imports later on.
2024-02-05Reland refactor(cli): use new sanitizer for resources (#22226)Matt Mastracci
Originally in #22125 Reverted in #22153 because of #22148 Fixed in deno_core https://github.com/denoland/deno_core/pull/538 Test plan: 1. Check out: https://github.com/poolifier/poolifier-deno.git 2. `PATH=.../deno/target/release/:$PATH deno task test` 3. `ok | 13 passed (188 steps) | 0 failed (18s)`
2024-02-05refactor(cli): Add TestFailureDescription (#22267)Matt Mastracci
Extract zero-risk changes from #22226
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-27Revert "refactor(cli): use new sanitizer for resources (#22125)" (#22153)Bartek Iwańczuk
2024-01-26refactor(cli): use new sanitizer for resources (#22125)Matt Mastracci
Step 1 of the Rustification of sanitizers, which unblocks the faster timers. This replaces the resource sanitizer with a Rust one, using the new APIs in deno_core.
2024-01-15refactor: use globbing from deno_config (#21925)David Sherret
2024-01-08perf: skip expanding exclude globs (#21817)David Sherret
We were calling `expand_glob` on our excludes, which is very expensive and unnecessary because we can pattern match while traversing instead. 1. Doesn't expand "exclude" globs. Instead pattern matches while walking the directory. 2. Splits up the "include" into base paths and applicable file patterns. This causes less pattern matching to occur because we're only pattern matching on patterns that might match and not ones in completely unrelated directories.
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-13refactor(cli): update to new deno_core promise/call methods (#21519)Matt Mastracci
2023-12-08feat(lsp): provide quick fixes for specifiers that could be resolved ↵David Sherret
sloppily (#21506)
2023-12-07feat: add suggestions to module not found error messages for file urls (#21498)David Sherret
2023-12-05refactor(cli): refactor bench/test for future module changes (#21460)Matt Mastracci
Extracting some refactorings for the module work that will land in https://github.com/denoland/deno_core/pull/359/
2023-11-22fix: 'Promise was collected' error in REPL/jupyter (#21272)Bartek Iwańczuk
Fixes #20528
2023-11-01fix(test): --junit-path should handle when the dir doesn't exist (#21044)David Sherret
Closes https://github.com/denoland/deno/issues/21022
2023-10-31feat: deno run --unstable-hmr (#20876)Bartek Iwańczuk
This commit adds `--unstable-hmr` flag, that enabled Hot Module Replacement. This flag works like `--watch` and accepts the same arguments. If HMR is not possible the process will be restarted instead. Currently HMR is only supported in `deno run` subcommand. Upon HMR a `CustomEvent("hmr")` will be dispatched that contains information which file was changed in its `details` property. --------- Co-authored-by: Valentin Anger <syrupthinker@gryphno.de> Co-authored-by: David Sherret <dsherret@gmail.com>
2023-10-19refactor: add WatcherCommunicator helper struct (#20927)Bartek Iwańczuk
This commit introduces "WatcherCommunicator" struct that is used facilitate bi-directional communication between CLI file watcher and the watched function. Prerequisite for https://github.com/denoland/deno/pull/20876
2023-10-05feat(jupyter): support Deno.test() (#20778)Nayeem Rahman
2023-10-05refactor(test): support custom writer in PrettyTestReporter (#20783)Nayeem Rahman
2023-09-27fix(cli): panic with __runtime_js_sources (#20704)Luca Casonato
Also a drive-by cleanup elsewhere (removing unused enum). Fixes #20702
2023-09-17fix(lsp): include JSON modules in local import completions (#20536)Nayeem Rahman
2023-09-15fix(test): share fail fast tracker between threads (#20515)Nayeem Rahman
2023-09-14fix: output traces for op sanitizer in more cases (#20494)Luca Casonato
This adds traces for the "started outside test, closed inside test" case.
2023-09-08fix: empty include in config file excludes all (#20404)Nayeem Rahman
2023-09-06fix(test): apply filter before checking for "only" (#20389)Nayeem Rahman
2023-09-06fix: don't show filtered test suites as running (#20385)Marvin Hagemeister
2023-08-30refactor(lsp): store test definitions in adjacency list (#20330)Nayeem Rahman
Previously: ```rust pub struct TestDefinition { pub id: String, pub name: String, pub range: SourceRange, pub steps: Vec<TestDefinition>, } pub struct TestDefinitions { pub discovered: Vec<TestDefinition>, pub injected: Vec<lsp_custom::TestData>, pub script_version: String, } ``` Now: ```rust pub struct TestDefinition { pub id: String, pub name: String, pub range: Option<Range>, pub is_dynamic: bool, // True for 'injected' module, not statically detected but added at runtime. pub parent_id: Option<String>, pub step_ids: HashSet<String>, } pub struct TestModule { pub specifier: ModuleSpecifier, pub script_version: String, pub defs: HashMap<String, TestDefinition>, } ``` Storing the test tree as a literal tree diminishes the value of IDs, even though vscode stores them that way. This makes all data easily accessible from `TestModule`. It unifies the interface between 'discovered' and 'injected' tests. This unblocks some enhancements wrt syncing tests between the LSP and extension, such as this TODO: https://github.com/denoland/vscode_deno/blob/61f08d5a71536a0a5f7dce965955b09e6bd957e1/client/src/testing.ts#L251-L259 and https://github.com/denoland/vscode_deno/issues/900. We should also get more flexibility overall. `TestCollector` is cleaned up, now stores a `&mut TestModule` directly and registers tests as it comes across them with `TestModule::register()`. This method ensures sanity in the redundant data from having both of `TestDefinition::{parent_id,step_ids}`. All of the messy conversions between `TestDescription`, `LspTestDescription`, `TestDefinition`, `TestData` and `TestIdentifier` are cleaned up. They shouldn't have been using `impl From` and now the full list of tests is available to their implementations.
2023-08-27fix(lsp/testing): use full ancestry to compute static id of step (#20297)Nayeem Rahman
Fixes https://github.com/denoland/vscode_deno/issues/656. Test steps were ID'd by a checksum of `[origin, level, step_name]` which is incorrect. Now it's `[origin, ...ancestor_names, step_name]`.