Failures in my JUnit test results are not recognized by Bitbucket Pipelines. The results file is created via fastlane (swiftlint) and looks like this:
<?xml version="1.0" encoding="utf-8"?>
<testsuites><testsuite>
<testcase classname='Formatting Test' name='SomeSwiftFile.swift'>
<failure message='Lines should not have trailing whitespace.'>warning: Line:15 </failure>
</testcase>
</testsuite></testsuites>
I also tried an different example file which looks like this:
<testsuite tests="3">
<testcase classname="foo1" name="ASuccessfulTest"/>
<testcase classname="foo2" name="AnotherSuccessfulTest"/>
<testcase classname="foo3" name="AFailingTest">
<failure type="NotEnoughFoo"> details about failure </failure>
</testcase>
</testsuite>
It looks like that both files are recognized as junit result files but the failures are not recognized. Take a look at the Bitbucket Pipelines result:
Any ideas whats wrong here?
I think I figured it out, the problem is, that the xml needs the following properties:
<testsuite tests="3" skipped="0" failures="1" errors="0">
<testsuite tests="3" skipped="0" failures="1" errors="0">
<testcase classname="foo1" name="ASuccessfulTest"/>
<testcase classname="foo2" name="AnotherSuccessfulTest"/>
<testcase classname="foo3" name="AFailingTest">
<failure type="NotEnoughFoo"> details about failure </failure>
</testcase>
</testsuite>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.