Skip to content

Commit 1bb6e94

Browse files
Rename process_results to xml_from_report
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 111e162 commit 1bb6e94

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/framework.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ pub trait TestFramework: Send + Sync {
288288
/// their JUnit output.
289289
///
290290
/// Default implementation returns the input unchanged (assumes JUnit XML).
291-
fn process_results(&self, raw_output: &str) -> FrameworkResult<String> {
291+
fn xml_from_report(&self, raw_output: &str) -> FrameworkResult<String> {
292292
Ok(raw_output.to_string())
293293
}
294294
}

src/framework/vitest.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::provider::Command;
1212
///
1313
/// Uses `vitest list --json --includeTaskLocation` for test discovery and
1414
/// JSON output with `--reporter=json --includeTaskLocation` for results,
15-
/// which are converted to JUnit XML via `process_results`.
15+
/// which are converted to JUnit XML via `xml_from_report`.
1616
pub struct VitestFramework {
1717
config: VitestFrameworkConfig,
1818
/// The program to invoke (first token of `command`).
@@ -241,7 +241,7 @@ impl TestFramework for VitestFramework {
241241
"json"
242242
}
243243

244-
fn process_results(&self, raw_output: &str) -> super::FrameworkResult<String> {
244+
fn xml_from_report(&self, raw_output: &str) -> super::FrameworkResult<String> {
245245
use quick_xml::Writer;
246246
use quick_xml::events::{BytesDecl, BytesEnd, BytesStart, BytesText, Event};
247247
use std::io::Cursor;
@@ -463,7 +463,7 @@ mod tests {
463463
}
464464

465465
#[test]
466-
fn test_process_results_converts_json_with_lines() -> Result<(), Box<dyn std::error::Error>> {
466+
fn test_xml_from_report_converts_json_with_lines() -> Result<(), Box<dyn std::error::Error>> {
467467
let config = VitestFrameworkConfig::default();
468468
let fw = VitestFramework::new(config)?;
469469

@@ -491,7 +491,7 @@ mod tests {
491491
}]
492492
}"#;
493493

494-
let junit = fw.process_results(json)?;
494+
let junit = fw.xml_from_report(json)?;
495495

496496
// The file path in classname depends on CWD stripping; just check
497497
// that the line number suffix is present and the structure is correct.
@@ -516,7 +516,7 @@ mod tests {
516516
}
517517

518518
#[test]
519-
fn test_process_results_skips_pending() -> Result<(), Box<dyn std::error::Error>> {
519+
fn test_xml_from_report_skips_pending() -> Result<(), Box<dyn std::error::Error>> {
520520
let config = VitestFrameworkConfig::default();
521521
let fw = VitestFramework::new(config)?;
522522

@@ -544,7 +544,7 @@ mod tests {
544544
}]
545545
}"#;
546546

547-
let junit = fw.process_results(json)?;
547+
let junit = fw.xml_from_report(json)?;
548548

549549
assert!(
550550
junit.contains("runs"),
@@ -561,7 +561,7 @@ mod tests {
561561
}
562562

563563
#[test]
564-
fn test_process_results_skips_skipped() -> Result<(), Box<dyn std::error::Error>> {
564+
fn test_xml_from_report_skips_skipped() -> Result<(), Box<dyn std::error::Error>> {
565565
let config = VitestFrameworkConfig::default();
566566
let fw = VitestFramework::new(config)?;
567567

@@ -589,7 +589,7 @@ mod tests {
589589
}]
590590
}"#;
591591

592-
let junit = fw.process_results(json)?;
592+
let junit = fw.xml_from_report(json)?;
593593

594594
assert!(
595595
junit.contains("runs"),
@@ -606,11 +606,11 @@ mod tests {
606606
}
607607

608608
#[test]
609-
fn test_process_results_rejects_invalid_input() -> Result<(), Box<dyn std::error::Error>> {
609+
fn test_xml_from_report_rejects_invalid_input() -> Result<(), Box<dyn std::error::Error>> {
610610
let config = VitestFrameworkConfig::default();
611611
let fw = VitestFramework::new(config)?;
612612

613-
let result = fw.process_results("not json");
613+
let result = fw.xml_from_report("not json");
614614
assert!(result.is_err());
615615

616616
Ok(())

src/orchestrator/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ impl<'a, S: Sandbox, D: TestFramework> TestRunner<'a, S, D> {
408408
// Convert raw output to JUnit XML (vitest produces JSON, others pass through)
409409
let junit_xml = self
410410
.framework
411-
.process_results(&raw_content)
411+
.xml_from_report(&raw_content)
412412
.map_err(|e| anyhow::anyhow!("Failed to process test results: {}", e))?;
413413

414414
// Count testcases in the processed JUnit XML

0 commit comments

Comments
 (0)