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

404 when clicking on test result links for "strange" names

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • junit-plugin
    • None
    • Platform: All, OS: All

      We use PHPs new namespaces, thus our class names contain backslashes. This profoundly confuses the
      generation of the test result overview page. For a test that is shown with a name like
      F3\FLOW3\SomeTest.testNameHere
      the URL generated is
      http://.../testReport/(root)/F3/FLOW3/SomeTest/testNameHere
      That results in a 404, correct would be
      http://.../testReport/(root)/F3%5CFLOW3%5CSomeTest/testNameHere
      which works fine if entered manually. Thus \ needs to be escaped to %5C rather than replaced by /.

      If you need more info or some help with testing things, let me know.

      This has some similarity to what has been described in #1768, it seems test result URLs could be more
      robust.

          [JENKINS-2788] 404 when clicking on test result links for "strange" names

          Alan Harder added a comment -

          What are your env details (platform, container..)?
          I haven't been able to reproduce this problem so far.. I do see the problem in
          issue #1768 with colons, but backslashes stay as backslashes in my URLs (Solaris
          10, builtin winstone container).

          Can you look at the XML for your test results and post a sample <testcase> line
          here? I've tested with manually constructed lines like:
          <testcase classname="my\test\here" name="test\one" time="0.01" />
          I get a URL like:
          ..../testReport/(root)/my\test\here/test_one/
          which has unchanges backslashes in the classname part, but changed to _ in the
          name part.. but the URL seems to work OK.

          Alan Harder added a comment - What are your env details (platform, container..)? I haven't been able to reproduce this problem so far.. I do see the problem in issue #1768 with colons, but backslashes stay as backslashes in my URLs (Solaris 10, builtin winstone container). Can you look at the XML for your test results and post a sample <testcase> line here? I've tested with manually constructed lines like: <testcase classname="my\test\here" name="test\one" time="0.01" /> I get a URL like: ..../testReport/(root)/my\test\here/test_one/ which has unchanges backslashes in the classname part, but changed to _ in the name part.. but the URL seems to work OK.

          kdambekalns added a comment -

          We see this on Linux with Hudson 1.243 and on Mac OS X with Hudson 1.270. In both cases using the
          builtin Winstone servlet container. The XML is generated by PHPUnit and supposed to be identical to
          output by JUnit. Here is an example:

          <testcase name="regularExpressionValidatorMatchesABasicExpressionCorrectly"
          class="F3\FLOW3\Validation\Validator\RegularExpressionTest"
          file="/Users/five/Documents/Hudson/jobs/FLOW3/workspace/trunk/Packages/FLOW3/Tests/Validatio
          n/Validator/F3_FLOW3_Validation_Validator_RegularExpressionTest.php" line="45" assertions="3"
          time="0.001603"/>

          To see the effect "in action" have a look at http://forge.typo3.org:8080/job/package-
          flow3/label=Mac/lastBuild/testReport/(root)/

          kdambekalns added a comment - We see this on Linux with Hudson 1.243 and on Mac OS X with Hudson 1.270. In both cases using the builtin Winstone servlet container. The XML is generated by PHPUnit and supposed to be identical to output by JUnit. Here is an example: <testcase name="regularExpressionValidatorMatchesABasicExpressionCorrectly" class="F3\FLOW3\Validation\Validator\RegularExpressionTest" file="/Users/five/Documents/Hudson/jobs/FLOW3/workspace/trunk/Packages/FLOW3/Tests/Validatio n/Validator/F3_FLOW3_Validation_Validator_RegularExpressionTest.php" line="45" assertions="3" time="0.001603"/> To see the effect "in action" have a look at http://forge.typo3.org:8080/job/package- flow3/label=Mac/lastBuild/testReport/(root)/

          Alan Harder added a comment -

          Thanks for the details... your site works fine for me, so apparently it is the
          browser in question. Tried it with IE7 and I see the problem.. IE thinks it is
          helping you by "fixing" the windows path separators in those links. OK, guess
          we should avoid \ in those URLs..

          Alan Harder added a comment - Thanks for the details... your site works fine for me, so apparently it is the browser in question. Tried it with IE7 and I see the problem.. IE thinks it is helping you by "fixing" the windows path separators in those links. OK, guess we should avoid \ in those URLs..

          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 - .

          kdambekalns added a comment -

          Thanks for checking and fixing. Indeed it works in Firefox, but not in Safari (and IE as you found out).

          kdambekalns added a comment - Thanks for checking and fixing. Indeed it works in Firefox, but not in Safari (and IE as you found out).

            mindless Alan Harder
            kdambekalns kdambekalns
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: