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

No history for test cases where name of suite is part of test case name

    Details

    • Similar Issues:

      Description

      If the name of test suite (e.g. "aaaa") is part of the test case name (e.g. "tc_aaaa"), Jenkins is unable to display history of this test case and throws an exeption:

      Oct 2, 2012 5:06:15 PM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: it.getResultInBuild(b). Reason: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(Unknown Source)
      at java.lang.String.substring(Unknown Source)
      at hudson.tasks.junit.ClassResult.findCorrespondingResult(ClassResult.java:86)
      at hudson.tasks.junit.PackageResult.findCorrespondingResult(PackageResult.java:102)
      at hudson.tasks.junit.TestResult.findCorrespondingResult(TestResult.java:295)
      at hudson.tasks.test.AbstractTestResultAction.findCorrespondingResult(AbstractTestResultAction.java:183)
      at hudson.tasks.test.TestResult.getResultInBuild(TestResult.java:162)

      (full log can be found in attachment log.txt)

      I´ve attached the test results file (junit.xml) with which this behavior can be reproduced.

        Attachments

        1. junit.xml
          0.3 kB
        2. junit2.xml
          0.3 kB
        3. junit3.xml
          0.3 kB
        4. log.txt
          11 kB
        5. tc_aaaa.jpg
          tc_aaaa.jpg
          16 kB
        6. tc_bbbb.jpg
          tc_bbbb.jpg
          29 kB
        7. tc_xaaaax.jpg
          tc_xaaaax.jpg
          18 kB

          Issue Links

            Activity

            Hide
            thesam Samuel Moritz added a comment -
            Show
            thesam Samuel Moritz added a comment - Pull request at: https://github.com/jenkinsci/jenkins/pull/645
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Samuel Moritz
            Path:
            core/src/main/java/hudson/tasks/junit/ClassResult.java
            core/src/test/java/hudson/tasks/junit/ClassResultTest.java
            http://jenkins-ci.org/commit/jenkins/e598bfb04d58090c3165839156f839c6ead42927
            Log:
            JENKINS-15380. Add some length checking before trying to substring.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Samuel Moritz Path: core/src/main/java/hudson/tasks/junit/ClassResult.java core/src/test/java/hudson/tasks/junit/ClassResultTest.java http://jenkins-ci.org/commit/jenkins/e598bfb04d58090c3165839156f839c6ead42927 Log: JENKINS-15380 . Add some length checking before trying to substring.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christoph Kutzinski
            Path:
            core/src/main/java/hudson/tasks/junit/ClassResult.java
            core/src/test/java/hudson/tasks/junit/ClassResultTest.java
            http://jenkins-ci.org/commit/jenkins/029701ce3d109dc1a81991b09d23ba774a30fc2a
            Log:
            Merge pull request #645 from thesam/issue15380

            [FIXED JENKINS-15380]. Add some length checking before trying to substring names in ClassResult.

            Compare: https://github.com/jenkinsci/jenkins/compare/3431a7cba4a8...029701ce3d10

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: core/src/main/java/hudson/tasks/junit/ClassResult.java core/src/test/java/hudson/tasks/junit/ClassResultTest.java http://jenkins-ci.org/commit/jenkins/029701ce3d109dc1a81991b09d23ba774a30fc2a Log: Merge pull request #645 from thesam/issue15380 [FIXED JENKINS-15380] . Add some length checking before trying to substring names in ClassResult. Compare: https://github.com/jenkinsci/jenkins/compare/3431a7cba4a8...029701ce3d10
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html http://jenkins-ci.org/commit/jenkins/8678acebed7bdd9282aef41260b3f87720287ea8 Log: JENKINS-15380 noting. Ref. https://github.com/jenkinsci/jenkins/commit/029701ce3d109dc1a81991b09d23ba774a30fc2a
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2618
            JENKINS-15380. Add some length checking before trying to substring. (Revision e598bfb04d58090c3165839156f839c6ead42927)
            JENKINS-15380 noting. Ref. https://github.com/jenkinsci/jenkins/commit/029701ce3d109dc1a81991b09d23ba774a30fc2a (Revision 8678acebed7bdd9282aef41260b3f87720287ea8)

            Result = SUCCESS
            samuel.moritz : e598bfb04d58090c3165839156f839c6ead42927
            Files :

            • core/src/main/java/hudson/tasks/junit/ClassResult.java
            • core/src/test/java/hudson/tasks/junit/ClassResultTest.java

            Christoph Kutzinski : 8678acebed7bdd9282aef41260b3f87720287ea8
            Files :

            • changelog.html
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2618 JENKINS-15380 . Add some length checking before trying to substring. (Revision e598bfb04d58090c3165839156f839c6ead42927) JENKINS-15380 noting. Ref. https://github.com/jenkinsci/jenkins/commit/029701ce3d109dc1a81991b09d23ba774a30fc2a (Revision 8678acebed7bdd9282aef41260b3f87720287ea8) Result = SUCCESS samuel.moritz : e598bfb04d58090c3165839156f839c6ead42927 Files : core/src/main/java/hudson/tasks/junit/ClassResult.java core/src/test/java/hudson/tasks/junit/ClassResultTest.java Christoph Kutzinski : 8678acebed7bdd9282aef41260b3f87720287ea8 Files : changelog.html
            Hide
            jglick Jesse Glick added a comment -

            Seems similar to JENKINS-17721.

            Show
            jglick Jesse Glick added a comment - Seems similar to JENKINS-17721 .
            Hide
            jglick Jesse Glick added a comment -

            Should this be an lts-candidate?

            Show
            jglick Jesse Glick added a comment - Should this be an lts-candidate ?
            Hide
            jglick Jesse Glick added a comment -

            @hjhafner: please do not reopen issues without any explanation. Generally issues should only be reopened if you can demonstrate that the bug is still reproducible in a build which claims to contain the fix; and that the original fix attempt actually failed to work as intended (otherwise it is a separate bug with superficially similar symptoms, which should be filed in a new ticket and linked).

            Show
            jglick Jesse Glick added a comment - @hjhafner: please do not reopen issues without any explanation. Generally issues should only be reopened if you can demonstrate that the bug is still reproducible in a build which claims to contain the fix; and that the original fix attempt actually failed to work as intended (otherwise it is a separate bug with superficially similar symptoms, which should be filed in a new ticket and linked).
            Hide
            hjhafner Hans-Juergen Hafner added a comment - - edited

            Jenkins 1.531: Issue is fixed only partly.

            The case with suite name aaaa and test name tc_aaaa is working now, but if there is text after and before the suite name in test name, for example tc_aaaa_x, history is still not shown.

            There are no more WARNINGS in Jenkins log.
            See junit3.xml.

            Summary:

            suite.testcase history
            aaaa.aaaa working
            aaaa.aaaa_x working
            aaaa.tc_aaaa working
            aaaa.tc_aaaa_x not working
            Show
            hjhafner Hans-Juergen Hafner added a comment - - edited Jenkins 1.531: Issue is fixed only partly. The case with suite name aaaa and test name tc_aaaa is working now, but if there is text after and before the suite name in test name, for example tc_aaaa_x , history is still not shown. There are no more WARNINGS in Jenkins log. See junit3.xml . Summary: suite.testcase history aaaa.aaaa working aaaa.aaaa_x working aaaa.tc_aaaa working aaaa.tc_aaaa_x not working
            Hide
            hjhafner Hans-Juergen Hafner added a comment - - edited

            Attached junit3.xml

            Show
            hjhafner Hans-Juergen Hafner added a comment - - edited Attached junit3.xml
            Hide
            hjhafner Hans-Juergen Hafner added a comment - - edited

            I made some more tests. It seems history is not shown if there is an '_' (underscore) followed by a character after and at least one character before suite name.

            suite.testcase history
            aaaa.YaaaaY working
            aaaa.Y_aaaa_ working
            aaaa.Yaaaa_Y not working
            aaaa.Y_aaaaY working
            aaaa.Y_aaaa_Y not working
            aaaa.aaaa_Y working
            aaaa._aaaa_ working
            Show
            hjhafner Hans-Juergen Hafner added a comment - - edited I made some more tests. It seems history is not shown if there is an '_' (underscore) followed by a character after and at least one character before suite name. suite.testcase history aaaa.YaaaaY working aaaa.Y_aaaa_ working aaaa.Yaaaa_Y not working aaaa.Y_aaaaY working aaaa.Y_aaaa_Y not working aaaa.aaaa_Y working aaaa._aaaa_ working

              People

              • Assignee:
                thesam Samuel Moritz
                Reporter:
                hjhafner Hans-Juergen Hafner
              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated: