Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17921

JiraTestResultReporter plugin does not handle carriage returns in test output

XMLWordPrintable

      Using the google C++ test framework, I inserted a failure case into the supplied test cases to trigger a JIRA issue to be created.

      [----------] 2 tests from SkipPrefixTest
      [ RUN ] SkipPrefixTest.SkipsWhenPrefixMatches
      [ OK ] SkipPrefixTest.SkipsWhenPrefixMatches (0 ms)
      [ RUN ] SkipPrefixTest.DoesNotSkipWhenPrefixDoesNotMatch
      ..\test\gtest_unittest.cc(7337): error: Value of: 1
      Expected: 0
      [ FAILED ] SkipPrefixTest.DoesNotSkipWhenPrefixDoesNotMatch (0 ms)
      [----------] 2 tests from SkipPrefixTest (0 ms total)

      Because there are carriage returns in the output, when the json payload is created, these control characters are not escaped, so JIRA does not accept the input.

      Also, I was having serialization issues when I first installed the plugin and these were resolved by removing the use of the workspace. I can't reproduce the errors now, so I didn't create a separate issue for it.

      The attached file is what I'm using to strip out the control characters.

            Unassigned Unassigned
            rfuchs Richard Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: