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

TestResult annotate function handling of URL's behaves differently than Jenkins core UrlConsoleAnnotator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • junit-plugin
    • None
    • O/S: Windows 10 64-bit
      JRE: 1.8.0_191
      Jenkins: 2.164.3
      JUnit Plugin: 1.28
      Browser: Chrome 75.0.3770.80 64-bit
      Running Jenkins directly as Windows service
      Slaves are also running as Windows services
      No proxies

      This is arguably a feature request, but I opted to make it a bug due to divergence in behavior with Jenkins core.

      The Jenkins UrlConsoleAnnotator ignores the closing bracket when translating URL's to hyperlinks from the raw text output of stdout:

      https://github.com/jenkinsci/jenkins/blob/22aa2e6e766074d11249893e3f35e0b99e20d3d0/core/src/main/java/hudson/console/UrlAnnotator.java#L28

      The JUnit plugin does not ignore this closing bracket:

      https://github.com/jenkinsci/junit-plugin/blob/25f5a5cbfff16c0e6e2b30a8c5e8728a3b2b99d6/src/main/java/hudson/tasks/test/TestResult.java#L276

      This only seems to cause problems when the link ending in a closing bracket is a filename. My use case is that we run Selenium test automation via Jenkins, and our framework outputs screenshots that are stored in the Jenkins workspace to stdout as URL's. We are wrapping the URL's in brackets (e.g. [http://google.com]).  This makes it easy to reference the screenshots from the console when troubleshooting. It is easier to look at the output via the testReport view provided by this plugin, but the link is then broken.

            Unassigned Unassigned
            aray10 Aaron Ray
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: