[llvm] [ci] Handle the case where all reported tests pass but the build is still a failure (PR #120264)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 11:54:23 PST 2025


================
@@ -70,10 +72,51 @@ def test_no_failures(self):
             ),
         )
 
+    def test_no_failures_build_failed(self):
+        self.assertEqual(
+            _generate_report(
+                "Foo",
+                1,
+                [
+                    junit_from_xml(
+                        dedent(
+                            """\
+          <?xml version="1.0" encoding="UTF-8"?>
+          <testsuites time="0.00">
+          <testsuite name="Passed" tests="1" failures="0" skipped="0" time="0.00">
+          <testcase classname="Bar/test_1" name="test_1" time="0.00"/>
+          </testsuite>
+          </testsuites>"""
----------------
boomanaiden154 wrote:

> You could also be wondering what happens if the build fails so badly that this script is run on files which are mangled, like if lit crashed half way through writing a file. This I had not thought of until now, and I will do another PR to handle that.

I'm not sure this is worth the effort/complexity to handle. I don't think I've ever seen lit crash in such a way. If it pops up occasionally, handling it might be justified, but for now I would think it's fine to leave it as is. 

https://github.com/llvm/llvm-project/pull/120264


More information about the llvm-commits mailing list