Skip to content

Commit d70badb

Browse files
feedback
Created using spr 1.3.6
1 parent 53cd728 commit d70badb

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

.ci/generate_test_report_lib_test.py

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,100 @@ def test_no_failures_build_failed_ninja_log(self):
341341
),
342342
)
343343

344+
def test_no_failures_multiple_build_failed_ninja_log(self):
345+
test = generate_test_report_lib.generate_report(
346+
"Foo",
347+
1,
348+
[
349+
junit_from_xml(
350+
dedent(
351+
"""\
352+
<?xml version="1.0" encoding="UTF-8"?>
353+
<testsuites time="0.00">
354+
<testsuite name="Passed" tests="1" failures="0" skipped="0" time="0.00">
355+
<testcase classname="Bar/test_1" name="test_1" time="0.00"/>
356+
</testsuite>
357+
</testsuites>"""
358+
)
359+
)
360+
],
361+
[
362+
[
363+
"[1/5] test/1.stamp",
364+
"[2/5] test/2.stamp",
365+
"FAILED: touch test/2.stamp",
366+
"Wow! Be Kind!",
367+
"[3/5] test/3.stamp",
368+
"[4/5] test/4.stamp",
369+
"FAILED: touch test/4.stamp",
370+
"Wow! I Dare You!",
371+
"[5/5] test/5.stamp",
372+
]
373+
],
374+
)
375+
print(test)
376+
self.assertEqual(
377+
generate_test_report_lib.generate_report(
378+
"Foo",
379+
1,
380+
[
381+
junit_from_xml(
382+
dedent(
383+
"""\
384+
<?xml version="1.0" encoding="UTF-8"?>
385+
<testsuites time="0.00">
386+
<testsuite name="Passed" tests="1" failures="0" skipped="0" time="0.00">
387+
<testcase classname="Bar/test_1" name="test_1" time="0.00"/>
388+
</testsuite>
389+
</testsuites>"""
390+
)
391+
)
392+
],
393+
[
394+
[
395+
"[1/5] test/1.stamp",
396+
"[2/5] test/2.stamp",
397+
"FAILED: touch test/2.stamp",
398+
"Wow! Be Kind!",
399+
"[3/5] test/3.stamp",
400+
"[4/5] test/4.stamp",
401+
"FAILED: touch test/4.stamp",
402+
"Wow! I Dare You!",
403+
"[5/5] test/5.stamp",
404+
]
405+
],
406+
),
407+
(
408+
dedent(
409+
"""\
410+
# Foo
411+
412+
* 1 test passed
413+
414+
All tests passed but another part of the build **failed**. Click on a failure below to see the details.
415+
416+
<details>
417+
<summary>test/2.stamp</summary>
418+
419+
```
420+
FAILED: touch test/2.stamp
421+
Wow! Be Kind!
422+
```
423+
</details>
424+
<details>
425+
<summary>test/4.stamp</summary>
426+
427+
```
428+
FAILED: touch test/4.stamp
429+
Wow! I Dare You!
430+
```
431+
</details>
432+
433+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
434+
)
435+
),
436+
)
437+
344438
def test_report_single_file_single_testsuite(self):
345439
self.assertEqual(
346440
generate_test_report_lib.generate_report(

0 commit comments

Comments
 (0)