diff options
| author | Matt Mastracci <matthew@mastracci.com> | 2024-01-26 17:24:16 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-26 17:24:16 -0500 |
| commit | 84fb2ad71b94ce773cefcbc868b160a73c52ab47 (patch) | |
| tree | 481599e289ae6472a96ee88f533b946aae69711a /cli/tools/test/reporters | |
| parent | 6109717c4a4d8139fdbf7165aac3bff2722e16d2 (diff) | |
refactor(cli): use new sanitizer for resources (#22125)
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.
Diffstat (limited to 'cli/tools/test/reporters')
| -rw-r--r-- | cli/tools/test/reporters/common.rs | 12 | ||||
| -rw-r--r-- | cli/tools/test/reporters/dot.rs | 6 | ||||
| -rw-r--r-- | cli/tools/test/reporters/pretty.rs | 6 |
3 files changed, 13 insertions, 11 deletions
diff --git a/cli/tools/test/reporters/common.rs b/cli/tools/test/reporters/common.rs index 3d9cdba46..1dc879667 100644 --- a/cli/tools/test/reporters/common.rs +++ b/cli/tools/test/reporters/common.rs @@ -33,7 +33,10 @@ pub(super) fn format_test_step_ancestry( result } -pub fn format_test_for_summary(cwd: &Url, desc: &TestDescription) -> String { +pub fn format_test_for_summary( + cwd: &Url, + desc: &TestFailureDescription, +) -> String { format!( "{} {}", &desc.name, @@ -78,7 +81,7 @@ pub(super) fn report_sigint( let mut formatted_pending = BTreeSet::new(); for id in tests_pending { if let Some(desc) = tests.get(id) { - formatted_pending.insert(format_test_for_summary(cwd, desc)); + formatted_pending.insert(format_test_for_summary(cwd, &desc.into())); } if let Some(desc) = test_steps.get(id) { formatted_pending @@ -107,7 +110,10 @@ pub(super) fn report_summary( #[allow(clippy::type_complexity)] // Type alias doesn't look better here let mut failures_by_origin: BTreeMap< String, - (Vec<(&TestDescription, &TestFailure)>, Option<&JsError>), + ( + Vec<(&TestFailureDescription, &TestFailure)>, + Option<&JsError>, + ), > = BTreeMap::default(); let mut failure_titles = vec![]; for (description, failure) in &summary.failures { diff --git a/cli/tools/test/reporters/dot.rs b/cli/tools/test/reporters/dot.rs index 0df000dad..39a4e44d9 100644 --- a/cli/tools/test/reporters/dot.rs +++ b/cli/tools/test/reporters/dot.rs @@ -113,7 +113,7 @@ impl TestReporter for DotTestReporter { self .summary .failures - .push((description.clone(), failure.clone())); + .push((description.into(), failure.clone())); } TestResult::Cancelled => { self.summary.failed += 1; @@ -162,11 +162,9 @@ impl TestReporter for DotTestReporter { TestStepResult::Failed(failure) => { self.summary.failed_steps += 1; self.summary.failures.push(( - TestDescription { + TestFailureDescription { id: desc.id, name: common::format_test_step_ancestry(desc, tests, test_steps), - ignore: false, - only: false, origin: desc.origin.clone(), location: desc.location.clone(), }, diff --git a/cli/tools/test/reporters/pretty.rs b/cli/tools/test/reporters/pretty.rs index 4a96192e6..c49081dd6 100644 --- a/cli/tools/test/reporters/pretty.rs +++ b/cli/tools/test/reporters/pretty.rs @@ -233,7 +233,7 @@ impl TestReporter for PrettyTestReporter { self .summary .failures - .push((description.clone(), failure.clone())); + .push((description.into(), failure.clone())); } TestResult::Cancelled => { self.summary.failed += 1; @@ -318,11 +318,9 @@ impl TestReporter for PrettyTestReporter { TestStepResult::Failed(failure) => { self.summary.failed_steps += 1; self.summary.failures.push(( - TestDescription { + TestFailureDescription { id: desc.id, name: common::format_test_step_ancestry(desc, tests, test_steps), - ignore: false, - only: false, origin: desc.origin.clone(), location: desc.location.clone(), }, |
