1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00
denoland-deno/cli/tools
Nayeem Rahman d592cf07d6
refactor(lsp): store test definitions in adjacency list (#20330)
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:
61f08d5a71/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-31 14:04:15 +02:00
..
bench fix(bench): explicit timers don't force high precision measurements (#20272) 2023-08-31 14:02:40 +02:00
coverage chore: update to Rust 1.72 (#20258) 2023-08-31 14:02:40 +02:00
init fix(cli/init): update to assert/mod.ts (#19924) 2023-07-24 19:57:01 +00:00
repl fix(ext/web): add stream tests to detect v8slice split bug (#20253) 2023-08-24 09:01:07 -06:00
test refactor(lsp): store test definitions in adjacency list (#20330) 2023-08-31 14:04:15 +02:00
vendor fix(unstable): disable importing from the vendor directory (#20067) 2023-08-21 18:23:27 +05:30
bundle.rs refactor: use "deno_config" crate (#20260) 2023-08-24 09:01:53 -06:00
check.rs refactor: upgrade deno_ast 0.28 and deno_semver 0.4 (#20193) 2023-08-21 18:23:28 +05:30
compile.rs feat(compile): Add --no-terminal to compile command (#17991) 2023-07-28 18:46:26 +03:00
doc.rs Reland "fix(cli): don't store blob and data urls in the module cache" (#18581) 2023-07-02 00:52:30 +02:00
fmt.rs fix(ext/web): add stream tests to detect v8slice split bug (#20253) 2023-08-24 09:01:07 -06:00
info.rs refactor: upgrade deno_ast 0.28 and deno_semver 0.4 (#20193) 2023-08-21 18:23:28 +05:30
installer.rs refactor: use "deno_config" crate (#20260) 2023-08-24 09:01:53 -06:00
lint.rs feat(unstable): rename deno_modules to vendor (#20065) 2023-08-06 21:56:56 -04:00
mod.rs feat(compile): unstable npm and node specifier support (#19005) 2023-05-10 20:06:59 -04:00
run.rs Reland "fix(cli): don't store blob and data urls in the module cache" (#18581) 2023-07-02 00:52:30 +02:00
task.rs chore(core): bump and trim deps (#20265) 2023-08-31 14:02:40 +02:00
upgrade.rs chore(cli): remove atty crate (#20275) 2023-08-31 14:02:39 +02:00