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

Bad parsing of "#" char in testResult link

    Details

    • Similar Issues:

      Description

      If you use the "#" char (which should have %23 as HTML escape) in your test descriptions, on the

      <jenkins_root>/job/<test_job>/lastCompletedBuild/testReport/

      view the link for that test (on column labelled "Package") does not parse that "#" char as %23.

      Since in HTML URLs the "#" char has a meaning for inside-page anchor, the link for the test detail does not work.

        Attachments

          Issue Links

            Activity

            Hide
            olivergondza Oliver Gondža added a comment -

            I presume it is not. Closing.

            Show
            olivergondza Oliver Gondža added a comment - I presume it is not. Closing.
            Hide
            olivergondza Oliver Gondža added a comment -

            Is the issue still present with junit 1.7 or newer?

            Show
            olivergondza Oliver Gondža added a comment - Is the issue still present with junit 1.7 or newer?
            Hide
            nalin_makar nalin_makar added a comment -

            After re-reading the original description and additional comment, it's clear that this is an issue with the in-built JUnit plugin and not with the TestNG plugin.

            Junit reports are available at /testReport and testng reports are available at /testngreports. Also, the XML snippet is from Junit and not from the testng xml file.

            Updated the component accordingly.

            Andrea, it'll help if you attach an example xml report here so that who ever wants to fix this bug can easily reproduce it.

            Show
            nalin_makar nalin_makar added a comment - After re-reading the original description and additional comment, it's clear that this is an issue with the in-built JUnit plugin and not with the TestNG plugin. Junit reports are available at /testReport and testng reports are available at /testngreports. Also, the XML snippet is from Junit and not from the testng xml file. Updated the component accordingly. Andrea, it'll help if you attach an example xml report here so that who ever wants to fix this bug can easily reproduce it.
            Hide
            knightq Andrea Salicetti added a comment - - edited

            You're right, let me be clearer.

            Since I use a BDD approach on my dev process, supported by cucumber as test tool, my test are somethink similar to this:

            Feature: [#1234] Authentication
            In order to access to the system
            as system user
            I want to be able to authenticate myself

            Scenario: Successful Login
            Given I am a registered user
            And the system is up
            When I point to http://myapp.com/login
            Then I must see "Login form" on header
            And I must see "Username" field
            And I must see "Passwrod" field
            And I must see "Submit" button
            ...

            As you can see, I use the [#number] notation on Feature's description to link the feature with the relative issue on my issue tracking system (whatever it is, in my case not jira, but it is worthless).

            I also have a job on Jenkins to perform a test validation on the whole project, let's call it testJob.

            Of course, due to its purposes, this job:

            • Compiles all the test classes (we are working on a Java project)
            • Performs a `cucumber -f junit --out $WORKSPACE --jars lib --require target/test-classes features`
            • Publish the tests' results (on testJob's config page, I've checked the "Publish JUnit test result report" checkbox)

            The problem is that when I run this job, it execute with success, but on the test report page of the build (the link I found on "http://<my_jenkins_uri>/job/testJob/" named as "Latest Test Result", that points to "http://<my_jenkins_uri>/job/testJob/lastCompletedBuild/testReport/"), the table that shows all the test executed has all the link that contains the "#" char malformed.

            To summarize:

            • All my test are BDD
            • I use the [#number] notation on feature description
            • Cucumber formatter translates all those features'names into something like this:

            <?xml version="1.0" encoding="UTF-8"?>
            <testsuite errors="0" failures="0" name="[#1234] Authentication" skipped="0" tests="1" time="0.095000">
            ...
            </testsuite>

            during the formatting phase (`-f junit`, when I ran cucumber).

            Given that, since the testsuite name is shown as "Package" value on that table and all the link on those name are REST and uses the name itself as resource id, I get all link on that table with href value written like this:

            `<a href="[#1234] Authentication/">
            <span style="">[#1234] Authentication</span>
            </a>`

            instead of like this:

            as it should be.

            `<a href="[%231234] Authentication/">
            <span style="">[#1234] Authentication</span>
            </a>`

            Otherwise I get an HTTP 404 error when I click on the bad link...

            Am I clear enough?

            Show
            knightq Andrea Salicetti added a comment - - edited You're right, let me be clearer. Since I use a BDD approach on my dev process, supported by cucumber as test tool, my test are somethink similar to this: Feature: [#1234] Authentication In order to access to the system as system user I want to be able to authenticate myself Scenario: Successful Login Given I am a registered user And the system is up When I point to http://myapp.com/login Then I must see "Login form" on header And I must see "Username" field And I must see "Passwrod" field And I must see "Submit" button ... As you can see, I use the [# number ] notation on Feature's description to link the feature with the relative issue on my issue tracking system (whatever it is, in my case not jira, but it is worthless). I also have a job on Jenkins to perform a test validation on the whole project, let's call it testJob. Of course, due to its purposes, this job: Compiles all the test classes (we are working on a Java project) Performs a `cucumber -f junit --out $WORKSPACE --jars lib --require target/test-classes features` Publish the tests' results (on testJob's config page, I've checked the "Publish JUnit test result report" checkbox) The problem is that when I run this job, it execute with success, but on the test report page of the build (the link I found on "http://<my_jenkins_uri>/job/testJob/" named as "Latest Test Result", that points to "http://<my_jenkins_uri>/job/testJob/lastCompletedBuild/testReport/"), the table that shows all the test executed has all the link that contains the "#" char malformed. To summarize: All my test are BDD I use the [#number] notation on feature description Cucumber formatter translates all those features'names into something like this: <?xml version="1.0" encoding="UTF-8"?> <testsuite errors="0" failures="0" name="[#1234] Authentication" skipped="0" tests="1" time="0.095000"> ... </testsuite> during the formatting phase (`-f junit`, when I ran cucumber). Given that, since the testsuite name is shown as "Package" value on that table and all the link on those name are REST and uses the name itself as resource id, I get all link on that table with href value written like this: `<a href="[#1234] Authentication/"> <span style="">[#1234] Authentication</span> </a>` instead of like this: as it should be. `<a href="[%231234] Authentication/"> <span style="">[#1234] Authentication</span> </a>` Otherwise I get an HTTP 404 error when I click on the bad link... Am I clear enough?
            Hide
            nalin_makar nalin_makar added a comment -

            Andrea,

            I get it's an url encoding issue, but I am having a hard time figuring out where you are facing this issue.

            Can you describe the issue again with more specific example? what do you mean by test descriptions? which link for the test? column "package" on which table?

            Thanks!

            Show
            nalin_makar nalin_makar added a comment - Andrea, I get it's an url encoding issue, but I am having a hard time figuring out where you are facing this issue. Can you describe the issue again with more specific example? what do you mean by test descriptions? which link for the test? column "package" on which table? Thanks!

              People

              • Assignee:
                Unassigned
                Reporter:
                knightq Andrea Salicetti
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: