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

Add extension point to rewrite test names

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • junit-plugin
    • None

    Description

      It's easy to write JUnit tests in scala, however scala allows more flexibility in naming than java does. In particular, if you enclose an identifier with back ticks, you can include symbols, spaces, and other characters that are not valid names in java. The scala compiler encodes them, eg `hello world` becomes "hello$u0020world".

      It can be helpful to write test method names between back ticks so that you can give an easy to read statement of what is the test expects. The problem is that these names are displayed in Jenkins as the encoded version, which is hard to read.

      This task is to create an extension point to allow a plugin to rewrite the package/class/method names so that they are displayed in the JUnit results pages in a readable format.

      I've used scala as an example, but this would apply to any JVM language that allows invalid java identifiers in its own identifiers by encoding them.

      Attachments

        Issue Links

          Activity

            dnadolny Donny Nadolny created issue -

            Code changed in jenkins
            User: dnadolny
            Path:
            core/src/main/java/hudson/tasks/junit/CaseResult.java
            core/src/main/java/hudson/tasks/junit/ClassResult.java
            core/src/main/java/hudson/tasks/junit/PackageResult.java
            core/src/main/java/hudson/tasks/junit/TestNameTransformer.java
            core/src/main/resources/hudson/tasks/junit/CaseResult/index.jelly
            core/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly
            core/src/main/resources/hudson/tasks/test/AbstractTestResultAction/summary.jelly
            core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body.jelly
            core/src/test/java/hudson/tasks/junit/SuiteResultTest.java
            test/src/test/java/hudson/tasks/junit/TestNameTransformerTest.java
            test/src/test/java/hudson/tasks/junit/TestResultPublishingTest.java
            http://jenkins-ci.org/commit/jenkins/4e37084360a3c400b301b5db154a63afb4b3e7d2
            Log:
            Merge pull request #769 from dnadolny/master

            [FIXED JENKINS-17478] Add extension point to rewrite JUnit test names

            Compare: https://github.com/jenkinsci/jenkins/compare/53d1e20f6252...4e37084360a3

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: dnadolny Path: core/src/main/java/hudson/tasks/junit/CaseResult.java core/src/main/java/hudson/tasks/junit/ClassResult.java core/src/main/java/hudson/tasks/junit/PackageResult.java core/src/main/java/hudson/tasks/junit/TestNameTransformer.java core/src/main/resources/hudson/tasks/junit/CaseResult/index.jelly core/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly core/src/main/resources/hudson/tasks/test/AbstractTestResultAction/summary.jelly core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body.jelly core/src/test/java/hudson/tasks/junit/SuiteResultTest.java test/src/test/java/hudson/tasks/junit/TestNameTransformerTest.java test/src/test/java/hudson/tasks/junit/TestResultPublishingTest.java http://jenkins-ci.org/commit/jenkins/4e37084360a3c400b301b5db154a63afb4b3e7d2 Log: Merge pull request #769 from dnadolny/master [FIXED JENKINS-17478] Add extension point to rewrite JUnit test names Compare: https://github.com/jenkinsci/jenkins/compare/53d1e20f6252...4e37084360a3
            scm_issue_link SCM/JIRA link daemon made changes -
            Field Original Value New Value
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            core/src/main/java/hudson/tasks/junit/CaseResult.java
            core/src/main/java/hudson/tasks/junit/ClassResult.java
            test/src/test/java/hudson/tasks/junit/TestNameTransformerTest.java
            http://jenkins-ci.org/commit/jenkins/6ea4532da3348453c8ebadee5bb3a2fa2d9897e6
            Log:
            Merge pull request #774 from dnadolny/master

            JENKINS-17478 Various improvements from code reviews

            Compare: https://github.com/jenkinsci/jenkins/compare/b5d96e27dd8c...6ea4532da334

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/tasks/junit/CaseResult.java core/src/main/java/hudson/tasks/junit/ClassResult.java test/src/test/java/hudson/tasks/junit/TestNameTransformerTest.java http://jenkins-ci.org/commit/jenkins/6ea4532da3348453c8ebadee5bb3a2fa2d9897e6 Log: Merge pull request #774 from dnadolny/master JENKINS-17478 Various improvements from code reviews Compare: https://github.com/jenkinsci/jenkins/compare/b5d96e27dd8c...6ea4532da334
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 148654 ] JNJira + In-Review [ 192816 ]
            jglick Jesse Glick made changes -
            Link This issue causes JENKINS-61787 [ JENKINS-61787 ]

            People

              dnadolny Donny Nadolny
              dnadolny Donny Nadolny
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: