sonar-swift icon indicating copy to clipboard operation
sonar-swift copied to clipboard

Failing test not displayed as error

Open rs-georg opened this issue 6 years ago • 2 comments

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>

rs-georg avatar Aug 17 '18 15:08 rs-georg

As of today, the plugin does not support failing tests. An (huge?) update would be required to support that.

gaelfoppolo avatar Aug 10 '19 12:08 gaelfoppolo

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)

davidy4ng avatar Aug 20 '19 12:08 davidy4ng