1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
use crate::model::{Location, MultipartBody, RedactionConfig};
use crate::report::shape_diagnosis::ShapeMismatchDiagnosis;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
/// Category of failure for structured error reporting.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
#[serde(rename_all = "snake_case")]
pub enum FailureCategory {
AssertionFailed,
ConnectionError,
Timeout,
ParseError,
CaptureError,
UnresolvedTemplate,
/// The step's asserted or captured JSONPath missed on a JSON object
/// response whose shape differs from the expected path in a way
/// that the [`crate::report::shape_diagnosis`] heuristic could
/// explain with a high-confidence replacement (NAZ-415). This is
/// set *only* when the diagnosis yielded at least one `High`
/// candidate; lower-confidence drift is left as `AssertionFailed`
/// / `CaptureError` with a `response_shape_mismatch` hint attached,
/// so we never downgrade a real assertion failure silently.
ResponseShapeMismatch,
/// The step was not executed because a capture referenced in its
/// request failed in an earlier step of the same test. Carrying a
/// distinct category (rather than re-emitting `UnresolvedTemplate`)
/// lets reports collapse cascade fallout under the root cause
/// without misrepresenting the later step as a fresh failure.
SkippedDueToFailedCapture,
/// The step was not executed because `fail_fast_within_test` is on
/// and an earlier step in the same test already failed.
SkippedDueToFailFast,
/// The step was not executed because its inline `if:` / `unless:`
/// predicate evaluated falsy / truthy respectively. Distinct from
/// the other skipped categories because there is no underlying
/// failure — the skip is a feature, not fallout. Steps carrying
/// this category are reported with `passed: true` so tests don't
/// fail when a conditional branch legitimately skips.
SkippedByCondition,
}
/// Stable machine-readable failure code for programmatic handling.
#[derive(Debug, Clone, Copy, Serialize, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum ErrorCode {
AssertionMismatch,
CaptureExtractionFailed,
PollConditionNotMet,
RequestTimedOut,
ConnectionRefused,
DnsResolutionFailed,
TlsVerificationFailed,
RedirectLimitExceeded,
NetworkError,
InterpolationFailed,
ValidationFailed,
ConfigurationError,
ParseError,
/// Paired with `SkippedDueToFailedCapture` / `SkippedDueToFailFast`
/// so consumers can filter cascade fallout from primary failures.
SkippedDependency,
}
/// Result of a single assertion check.
#[derive(Debug, Clone)]
pub struct AssertionResult {
/// What was asserted (e.g., "status", "body $.name", "header content-type")
pub assertion: String,
/// Whether it passed
pub passed: bool,
/// Expected value (for display)
pub expected: String,
/// Actual value (for display)
pub actual: String,
/// Human-readable message
pub message: String,
/// Optional unified diff for whole-body mismatches
pub diff: Option<String>,
/// Source location of the assertion operator key in the originating
/// YAML file. Optional for backwards compatibility and because not
/// every assertion originates from a YAML node (e.g. the synthetic
/// `runtime`/`interpolation` assertions manufactured by the runner).
pub location: Option<Location>,
/// Structured response-shape drift hint (NAZ-415). Populated when a
/// body-assertion JSONPath missed on an object response whose shape
/// the heuristic could describe; the runner lifts this to the
/// step-level `response_shape_mismatch` field for reporting.
pub response_shape_mismatch: Option<ShapeMismatchDiagnosis>,
}
impl AssertionResult {
pub fn pass(
assertion: impl Into<String>,
expected: impl Into<String>,
actual: impl Into<String>,
) -> Self {
let assertion = assertion.into();
let expected = expected.into();
let actual = actual.into();
Self {
message: format!("{}: OK", assertion),
assertion,
passed: true,
expected,
actual,
diff: None,
location: None,
response_shape_mismatch: None,
}
}
pub fn fail(
assertion: impl Into<String>,
expected: impl Into<String>,
actual: impl Into<String>,
message: impl Into<String>,
) -> Self {
Self {
assertion: assertion.into(),
passed: false,
expected: expected.into(),
actual: actual.into(),
message: message.into(),
diff: None,
location: None,
response_shape_mismatch: None,
}
}
pub fn fail_with_diff(
assertion: impl Into<String>,
expected: impl Into<String>,
actual: impl Into<String>,
message: impl Into<String>,
diff: impl Into<String>,
) -> Self {
Self {
assertion: assertion.into(),
passed: false,
expected: expected.into(),
actual: actual.into(),
message: message.into(),
diff: Some(diff.into()),
location: None,
response_shape_mismatch: None,
}
}
/// Attach a source location to this assertion result. Used by the
/// runner to stamp each assertion with the position of its YAML
/// operator key so downstream consumers can anchor failures on
/// the exact source range.
pub fn with_location(mut self, location: Option<Location>) -> Self {
self.location = location;
self
}
/// Attach a [`ShapeMismatchDiagnosis`] to a failing assertion. The
/// diagnosis is lifted to the step's `response_shape_mismatch`
/// field when the runner assembles the [`StepResult`], and the
/// step's category is upgraded to
/// [`FailureCategory::ResponseShapeMismatch`] only when the
/// diagnosis is high confidence — see
/// [`crate::report::shape_diagnosis`] for the heuristic.
pub fn with_shape_diagnosis(mut self, diagnosis: ShapeMismatchDiagnosis) -> Self {
self.response_shape_mismatch = Some(diagnosis);
self
}
}
/// Result of executing a single step.
#[derive(Debug, Clone)]
pub struct StepResult {
pub name: String,
/// Optional human-readable description carried over from `Step.description`.
/// Included in the JSON report and rendered in the human formatter.
pub description: Option<String>,
/// Mirrors `Step.debug` so renderers can decide whether to embed
/// request/response for this step even when it passes (NAZ-244).
pub debug: bool,
pub passed: bool,
pub duration_ms: u64,
pub assertion_results: Vec<AssertionResult>,
/// HTTP request details (included in JSON output for failed steps)
pub request_info: Option<RequestInfo>,
/// HTTP response details (included in JSON output for failed steps)
pub response_info: Option<ResponseInfo>,
/// Category of failure (for structured error taxonomy in JSON output)
pub error_category: Option<FailureCategory>,
/// HTTP response status code (available for all executed steps)
pub response_status: Option<u16>,
/// Brief summary of the response (e.g., "200 OK", "Array[3] items")
pub response_summary: Option<String>,
/// Names of captures set by this step
pub captures_set: Vec<String>,
/// Source location of the step's `name:` node in the originating
/// YAML file. Optional for backwards compatibility (e.g. steps
/// expanded from an `include:` directive do not carry locations in
/// the first iteration of this feature).
pub location: Option<Location>,
/// Structured response-shape drift hint (NAZ-415). Populated when a
/// body-assertion or capture JSONPath missed on a JSON object
/// response and the shape-diagnosis heuristic produced at least
/// one observation (keys + type) — candidate fixes may be empty if
/// the heuristic couldn't suggest anything, but the observed shape
/// is still carried for agent consumption.
pub response_shape_mismatch: Option<ShapeMismatchDiagnosis>,
}
impl StepResult {
pub fn total_assertions(&self) -> usize {
self.assertion_results.len()
}
pub fn passed_assertions(&self) -> usize {
self.assertion_results.iter().filter(|a| a.passed).count()
}
pub fn failed_assertions(&self) -> usize {
self.assertion_results.iter().filter(|a| !a.passed).count()
}
pub fn failures(&self) -> Vec<&AssertionResult> {
self.assertion_results
.iter()
.filter(|a| !a.passed)
.collect()
}
pub fn error_code(&self) -> Option<ErrorCode> {
let message = self.primary_failure_message().unwrap_or_default();
let lower = message.to_ascii_lowercase();
match self.error_category {
Some(FailureCategory::AssertionFailed) => Some(ErrorCode::AssertionMismatch),
// Drift is a specific kind of assertion miss — surfaces the
// same `AssertionMismatch` code so callers that only filter
// by code see no regression, while the category distinguishes.
Some(FailureCategory::ResponseShapeMismatch) => Some(ErrorCode::AssertionMismatch),
Some(FailureCategory::CaptureError) => Some(ErrorCode::CaptureExtractionFailed),
Some(FailureCategory::Timeout) => {
if self
.assertion_results
.iter()
.any(|assertion| assertion.assertion == "poll")
{
Some(ErrorCode::PollConditionNotMet)
} else {
Some(ErrorCode::RequestTimedOut)
}
}
Some(FailureCategory::UnresolvedTemplate) => Some(ErrorCode::InterpolationFailed),
Some(FailureCategory::SkippedDueToFailedCapture)
| Some(FailureCategory::SkippedDueToFailFast) => Some(ErrorCode::SkippedDependency),
// `SkippedByCondition` is an intentional, non-failure skip.
// Steps in this state carry `passed: true` and return no
// error code — downstream consumers should treat them as
// observational, not as cascade fallout.
Some(FailureCategory::SkippedByCondition) => None,
Some(FailureCategory::ParseError) => {
if lower.contains("interpolation") {
Some(ErrorCode::InterpolationFailed)
} else if lower.contains("validation") {
Some(ErrorCode::ValidationFailed)
} else if lower.contains("config") {
Some(ErrorCode::ConfigurationError)
} else {
Some(ErrorCode::ParseError)
}
}
Some(FailureCategory::ConnectionError) => {
if lower.contains("tls verification failed") {
Some(ErrorCode::TlsVerificationFailed)
} else if lower.contains("too many redirects") {
Some(ErrorCode::RedirectLimitExceeded)
} else if lower.contains("connection refused") {
Some(ErrorCode::ConnectionRefused)
} else if lower.contains("failed to lookup")
|| lower.contains("dns")
|| lower.contains("no such host")
|| lower.contains("name or service not known")
{
Some(ErrorCode::DnsResolutionFailed)
} else {
Some(ErrorCode::NetworkError)
}
}
None => None,
}
}
fn primary_failure_message(&self) -> Option<&str> {
self.assertion_results
.iter()
.find(|assertion| !assertion.passed)
.map(|assertion| assertion.message.as_str())
}
}
/// HTTP request info for reporting.
#[derive(Debug, Clone)]
pub struct RequestInfo {
pub method: String,
pub url: String,
pub headers: HashMap<String, String>,
pub body: Option<serde_json::Value>,
pub multipart: Option<MultipartBody>,
}
/// HTTP response info for reporting.
#[derive(Debug, Clone)]
pub struct ResponseInfo {
pub status: u16,
pub headers: HashMap<String, String>,
pub body: Option<serde_json::Value>,
}
/// Result of a named test group.
#[derive(Debug, Clone)]
pub struct TestResult {
pub name: String,
pub description: Option<String>,
pub passed: bool,
pub duration_ms: u64,
pub step_results: Vec<StepResult>,
/// All captured values at the end of this test group
pub captures: HashMap<String, serde_json::Value>,
}
impl TestResult {
pub fn total_steps(&self) -> usize {
self.step_results.len()
}
pub fn passed_steps(&self) -> usize {
self.step_results.iter().filter(|s| s.passed).count()
}
pub fn failed_steps(&self) -> usize {
self.step_results.iter().filter(|s| !s.passed).count()
}
}
/// Result of running an entire test file.
#[derive(Debug, Clone)]
pub struct FileResult {
pub file: String,
pub name: String,
pub passed: bool,
pub duration_ms: u64,
pub redaction: RedactionConfig,
pub redacted_values: Vec<String>,
pub setup_results: Vec<StepResult>,
pub test_results: Vec<TestResult>,
pub teardown_results: Vec<StepResult>,
}
impl FileResult {
pub fn total_steps(&self) -> usize {
self.setup_results.len()
+ self
.test_results
.iter()
.map(|t| t.total_steps())
.sum::<usize>()
+ self.teardown_results.len()
}
pub fn passed_steps(&self) -> usize {
self.setup_results.iter().filter(|s| s.passed).count()
+ self
.test_results
.iter()
.map(|t| t.passed_steps())
.sum::<usize>()
+ self.teardown_results.iter().filter(|s| s.passed).count()
}
pub fn failed_steps(&self) -> usize {
self.total_steps() - self.passed_steps()
}
}
/// Top-level run result.
#[derive(Debug, Clone)]
pub struct RunResult {
pub file_results: Vec<FileResult>,
pub duration_ms: u64,
}
impl RunResult {
pub fn passed(&self) -> bool {
self.file_results.iter().all(|f| f.passed)
}
pub fn total_files(&self) -> usize {
self.file_results.len()
}
pub fn total_steps(&self) -> usize {
self.file_results.iter().map(|f| f.total_steps()).sum()
}
pub fn passed_steps(&self) -> usize {
self.file_results.iter().map(|f| f.passed_steps()).sum()
}
pub fn failed_steps(&self) -> usize {
self.file_results.iter().map(|f| f.failed_steps()).sum()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn assertion_result_pass() {
let r = AssertionResult::pass("status", "200", "200");
assert!(r.passed);
assert_eq!(r.assertion, "status");
assert_eq!(r.expected, "200");
assert_eq!(r.actual, "200");
assert_eq!(r.diff, None);
}
#[test]
fn assertion_result_fail() {
let r = AssertionResult::fail("status", "200", "404", "Expected 200, got 404");
assert!(!r.passed);
assert_eq!(r.message, "Expected 200, got 404");
assert_eq!(r.diff, None);
}
#[test]
fn assertion_result_fail_with_diff() {
let r = AssertionResult::fail_with_diff("body $", "a", "b", "mismatch", "--- expected");
assert!(!r.passed);
assert_eq!(r.diff.as_deref(), Some("--- expected"));
}
#[test]
fn step_result_counts() {
let sr = StepResult {
name: "test".into(),
description: None,
debug: false,
passed: false,
duration_ms: 100,
assertion_results: vec![
AssertionResult::pass("status", "200", "200"),
AssertionResult::fail("body $.name", "\"Alice\"", "\"Bob\"", "mismatch"),
AssertionResult::pass("body $.age", "30", "30"),
],
request_info: None,
response_info: None,
error_category: None,
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
};
assert_eq!(sr.total_assertions(), 3);
assert_eq!(sr.passed_assertions(), 2);
assert_eq!(sr.failed_assertions(), 1);
assert_eq!(sr.failures().len(), 1);
assert_eq!(sr.failures()[0].assertion, "body $.name");
}
#[test]
fn step_result_error_code_uses_timeout_subtypes() {
let poll_timeout = StepResult {
name: "poll".into(),
description: None,
debug: false,
passed: false,
duration_ms: 0,
assertion_results: vec![AssertionResult::fail(
"poll",
"condition met",
"not met",
"Polling timed out",
)],
request_info: None,
response_info: None,
error_category: Some(FailureCategory::Timeout),
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
};
assert_eq!(
poll_timeout.error_code(),
Some(ErrorCode::PollConditionNotMet)
);
let request_timeout = StepResult {
name: "http".into(),
description: None,
debug: false,
passed: false,
duration_ms: 0,
assertion_results: vec![AssertionResult::fail(
"runtime",
"ok",
"timeout",
"Request to https://example.com timed out",
)],
request_info: None,
response_info: None,
error_category: Some(FailureCategory::Timeout),
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
};
assert_eq!(
request_timeout.error_code(),
Some(ErrorCode::RequestTimedOut)
);
}
#[test]
fn step_result_error_code_uses_connection_subtypes() {
let refused = StepResult {
name: "refused".into(),
description: None,
debug: false,
passed: false,
duration_ms: 0,
assertion_results: vec![AssertionResult::fail(
"runtime",
"ok",
"error",
"Connection refused to http://127.0.0.1:1",
)],
request_info: None,
response_info: None,
error_category: Some(FailureCategory::ConnectionError),
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
};
assert_eq!(refused.error_code(), Some(ErrorCode::ConnectionRefused));
let tls = StepResult {
name: "tls".into(),
description: None,
debug: false,
passed: false,
duration_ms: 0,
assertion_results: vec![AssertionResult::fail(
"runtime",
"ok",
"error",
"TLS verification failed for https://example.com",
)],
request_info: None,
response_info: None,
error_category: Some(FailureCategory::ConnectionError),
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
};
assert_eq!(tls.error_code(), Some(ErrorCode::TlsVerificationFailed));
}
#[test]
fn step_result_error_code_unresolved_template() {
let sr = StepResult {
name: "unresolved".into(),
description: None,
debug: false,
passed: false,
duration_ms: 0,
assertion_results: vec![AssertionResult::fail(
"interpolation",
"all templates resolved",
"unresolved: capture.id",
"Unresolved template variables: capture.id",
)],
request_info: None,
response_info: None,
error_category: Some(FailureCategory::UnresolvedTemplate),
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
};
assert_eq!(sr.error_code(), Some(ErrorCode::InterpolationFailed));
}
#[test]
fn test_result_counts() {
let tr = TestResult {
name: "crud".into(),
description: Some("CRUD test".into()),
passed: false,
duration_ms: 500,
step_results: vec![
StepResult {
name: "create".into(),
description: None,
debug: false,
passed: true,
duration_ms: 200,
assertion_results: vec![AssertionResult::pass("status", "201", "201")],
request_info: None,
response_info: None,
error_category: None,
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
},
StepResult {
name: "verify".into(),
description: None,
debug: false,
passed: false,
duration_ms: 100,
assertion_results: vec![AssertionResult::fail(
"status",
"200",
"404",
"not found",
)],
request_info: None,
response_info: None,
error_category: None,
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
},
],
captures: HashMap::new(),
};
assert_eq!(tr.total_steps(), 2);
assert_eq!(tr.passed_steps(), 1);
assert_eq!(tr.failed_steps(), 1);
}
#[test]
fn file_result_counts() {
let fr = FileResult {
file: "test.tarn.yaml".into(),
name: "Test".into(),
passed: true,
duration_ms: 1000,
redaction: RedactionConfig::default(),
redacted_values: vec![],
setup_results: vec![StepResult {
name: "setup".into(),
description: None,
debug: false,
passed: true,
duration_ms: 50,
assertion_results: vec![],
request_info: None,
response_info: None,
error_category: None,
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
}],
test_results: vec![TestResult {
name: "t1".into(),
description: None,
passed: true,
duration_ms: 800,
step_results: vec![
StepResult {
name: "s1".into(),
description: None,
debug: false,
passed: true,
duration_ms: 400,
assertion_results: vec![],
request_info: None,
response_info: None,
error_category: None,
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
},
StepResult {
name: "s2".into(),
description: None,
debug: false,
passed: true,
duration_ms: 400,
assertion_results: vec![],
request_info: None,
response_info: None,
error_category: None,
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
},
],
captures: HashMap::new(),
}],
teardown_results: vec![],
};
assert_eq!(fr.total_steps(), 3);
assert_eq!(fr.passed_steps(), 3);
assert_eq!(fr.failed_steps(), 0);
}
#[test]
fn run_result_aggregation() {
let rr = RunResult {
file_results: vec![
FileResult {
file: "a.tarn.yaml".into(),
name: "A".into(),
passed: true,
duration_ms: 100,
redaction: RedactionConfig::default(),
redacted_values: vec![],
setup_results: vec![],
test_results: vec![TestResult {
name: "t".into(),
description: None,
passed: true,
duration_ms: 100,
step_results: vec![StepResult {
name: "s".into(),
description: None,
debug: false,
passed: true,
duration_ms: 100,
assertion_results: vec![],
request_info: None,
response_info: None,
error_category: None,
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
}],
captures: HashMap::new(),
}],
teardown_results: vec![],
},
FileResult {
file: "b.tarn.yaml".into(),
name: "B".into(),
passed: false,
duration_ms: 200,
redaction: RedactionConfig::default(),
redacted_values: vec![],
setup_results: vec![],
test_results: vec![TestResult {
name: "t".into(),
description: None,
passed: false,
duration_ms: 200,
step_results: vec![StepResult {
name: "s".into(),
description: None,
debug: false,
passed: false,
duration_ms: 200,
assertion_results: vec![],
request_info: None,
response_info: None,
error_category: None,
response_status: None,
response_summary: None,
captures_set: vec![],
location: None,
response_shape_mismatch: None,
}],
captures: HashMap::new(),
}],
teardown_results: vec![],
},
],
duration_ms: 300,
};
assert!(!rr.passed());
assert_eq!(rr.total_files(), 2);
assert_eq!(rr.total_steps(), 2);
assert_eq!(rr.passed_steps(), 1);
assert_eq!(rr.failed_steps(), 1);
}
}