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

Test URLs need to be escaped in "All Tests" view

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: Macintosh, OS: All

      When viewing "All Tests" and package root, I get URLs that are invalid due to the names of my tests.

      (I'm using Hudson to run Ruby tests, the test names are the Ruby name for the test controller -
      "Fnarg::FnooTester"

      The URL I see this issue at is: http://hudson.example.com/job/superapp/215/testReport/(root)/

      Any test with :: in the name shows up as links like:

      <a
      href="SuperApp::JiraVerifierTest/test_verify_email">SuperApp::JiraVerifierTest.test_verify_email</a>

      The browser misinterprets the SuperApp:: as a protocol in the URL; and sends me to the "page"
      "superApp::JiraVerifierTest/test_matching_email" (that's the complete URL). This doesn't work
      (obviously). It should have sent me to something like:

      http://hudson.example.com/job/superapp/215/testReport/(root)/SuperApp::JiraVerifierTest/test_matc
      hing_email/

      It is important to note that this only happens on some pages (listed above); other pages seem to
      construct the URL differently (perhaps with a path component first); and thus works for those pages.

          [JENKINS-1768] Test URLs need to be escaped in "All Tests" view

          Alan Harder added a comment -

          Working on this.

          Alan Harder added a comment - Working on this.

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/java/hudson/tasks/junit/CaseResult.java
          trunk/hudson/main/core/src/main/java/hudson/tasks/junit/PackageResult.java
          trunk/hudson/main/core/src/main/java/hudson/tasks/junit/TabulatedResult.java
          trunk/hudson/main/core/src/main/java/hudson/tasks/junit/TestObject.java
          trunk/hudson/main/core/src/main/java/hudson/tasks/junit/TestResult.java
          trunk/hudson/main/core/src/main/resources/hudson/tasks/junit/MetaTabulatedResult/body.jelly
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=14260
          Log:
          [FIXED JENKINS-1768] Handle unsafe URL characters for package/class names too.
          [FIXED JENKINS-2788] Add backslash as URL unsafe charcter (IE auto-replaces \ as /).
          Details:
          Add getSafeName (just does safe(getName())) in TabulatedResult.
          Use safe names as keys in maps for PackageResults/ClassResults, and use safe name
          when constructing links in jelly and in CaseResult.getRelativePathFrom().
          Add \ as character to replace in TestObject.safe().

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/tasks/junit/CaseResult.java trunk/hudson/main/core/src/main/java/hudson/tasks/junit/PackageResult.java trunk/hudson/main/core/src/main/java/hudson/tasks/junit/TabulatedResult.java trunk/hudson/main/core/src/main/java/hudson/tasks/junit/TestObject.java trunk/hudson/main/core/src/main/java/hudson/tasks/junit/TestResult.java trunk/hudson/main/core/src/main/resources/hudson/tasks/junit/MetaTabulatedResult/body.jelly trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=14260 Log: [FIXED JENKINS-1768] Handle unsafe URL characters for package/class names too. [FIXED JENKINS-2788] Add backslash as URL unsafe charcter (IE auto-replaces \ as /). Details: Add getSafeName (just does safe(getName())) in TabulatedResult. Use safe names as keys in maps for PackageResults/ClassResults, and use safe name when constructing links in jelly and in CaseResult.getRelativePathFrom(). Add \ as character to replace in TestObject.safe().

          Alan Harder added a comment -

          .

          Alan Harder added a comment - .

            mindless Alan Harder
            bwalding Ben Walding
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: