sonar-swift
sonar-swift copied to clipboard
Failing test not displayed as error
Hi,
I have a (deliberately) failing test in my project. However, in Sonar the test is not marked as failing. The junit file looks like this:
<?xml version='1.0' encoding='UTF-8'?>
<testsuites name='fooUITests.xctest' tests='2' failures='1'>
<testsuite name='fooTests.FooTests' tests='1' failures='1'>
<testcase classname='fooTests.FooTests' name='testExample' time='0'>
<failure message='XCTAssertTrue failed - '>fooTests/FooTests.swift:17</failure>
</testcase>
</testsuite>
<testsuite name='fooUITests.Screenshots' tests='1' failures='0'>
<testcase classname='fooUITests.Screenshots' name='testMainScreenshot' time='7.864'/>
</testsuite>
</testsuites>
As of today, the plugin does not support failing tests. An (huge?) update would be required to support that.
One of the reason is also that failing tests results in an xcodebuild error, which makes the run-sonar-swift.sh script ends on error.
2 things to do:
- make failing xcodebuild test command not blocking
- update the junit parser and send the failing tests (if there are)