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

hudson.tasks.test isn't generic enough for extension

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None

      In trying to write an custom parser and test implementation using hudson.tasks.test it is apparant that some of the hudson.tasks.test classes assume the junit implementation.

      e.g.
      hudson.tasks.test.AbstractTestResultAction
      contains the method
      public List<CaseResult> getFailedTests
      which hard codes it to the junit implemtnations.

      MetaTabultatedResult body.jelly assumes that the "? extends TestResult" has a fullName when rendering the failed test (which is not declared on this object but defined on CaseResult).

          [JENKINS-19898] hudson.tasks.test isn't generic enough for extension

          Alex Earl added a comment -

          I agree, perhaps TestResult should be extended to add a getFullName and then AbstractTestResultAction should use TestResult instead of CaseResult.

          Alex Earl added a comment - I agree, perhaps TestResult should be extended to add a getFullName and then AbstractTestResultAction should use TestResult instead of CaseResult.

          James Nord added a comment -

          I already have the changes, just waiting co approval before submitting

          James Nord added a comment - I already have the changes, just waiting co approval before submitting

          Alex Earl added a comment -

          Do you have a pull request already?

          Alex Earl added a comment - Do you have a pull request already?

          James Nord added a comment -

          Code is ready to push but our legal team is looking at the ccla.

          As soon as the legal team give me the go ahead it will be sent.

          James Nord added a comment - Code is ready to push but our legal team is looking at the ccla. As soon as the legal team give me the go ahead it will be sent.

          Code changed in jenkins
          User: James Nord
          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/test/AbstractTestResultAction.java
          core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java
          core/src/main/java/hudson/tasks/test/TestObject.java
          http://jenkins-ci.org/commit/jenkins/0e122dfcacebbf791223ca416ad845e12a4ca38e
          Log:
          [FIXED JENKINS-19898] test base classes should not be linked to the junit implementation.

          Changed the return type to be generic and not the junit specific CaseResult.

          TestObject.fullName was used in the baseClasses jelly but this was only defined in the CaseResult so add an implementation to the base class such that people can continue to use the generic jelly in their cusomt test implementations.

          Change-Id: I39fbff6621d7f20f9cebb210eea4f54a90f77375

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord 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/test/AbstractTestResultAction.java core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java core/src/main/java/hudson/tasks/test/TestObject.java http://jenkins-ci.org/commit/jenkins/0e122dfcacebbf791223ca416ad845e12a4ca38e Log: [FIXED JENKINS-19898] test base classes should not be linked to the junit implementation. Changed the return type to be generic and not the junit specific CaseResult. TestObject.fullName was used in the baseClasses jelly but this was only defined in the CaseResult so add an implementation to the base class such that people can continue to use the generic jelly in their cusomt test implementations. Change-Id: I39fbff6621d7f20f9cebb210eea4f54a90f77375

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          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/test/AbstractTestResultAction.java
          core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java
          core/src/main/java/hudson/tasks/test/TestObject.java
          http://jenkins-ci.org/commit/jenkins/b03ad296088d13060eb46c484f82de1ed31a903d
          Log:
          Merge pull request #998 from jenkinsci/jenkins-19898

          [FIXED JENKINS-19898] test base classes should not be linked to the junit implementation.

          Compare: https://github.com/jenkinsci/jenkins/compare/59ad27cc4726...b03ad296088d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi 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/test/AbstractTestResultAction.java core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java core/src/main/java/hudson/tasks/test/TestObject.java http://jenkins-ci.org/commit/jenkins/b03ad296088d13060eb46c484f82de1ed31a903d Log: Merge pull request #998 from jenkinsci/jenkins-19898 [FIXED JENKINS-19898] test base classes should not be linked to the junit implementation. Compare: https://github.com/jenkinsci/jenkins/compare/59ad27cc4726...b03ad296088d

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3192
          [FIXED JENKINS-19898] test base classes should not be linked to the junit implementation. (Revision 0e122dfcacebbf791223ca416ad845e12a4ca38e)

          Result = SUCCESS
          James Nord : 0e122dfcacebbf791223ca416ad845e12a4ca38e
          Files :

          • core/src/main/java/hudson/tasks/junit/CaseResult.java
          • core/src/main/java/hudson/tasks/test/TestObject.java
          • core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java
          • core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java
          • core/src/main/java/hudson/tasks/junit/ClassResult.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3192 [FIXED JENKINS-19898] test base classes should not be linked to the junit implementation. (Revision 0e122dfcacebbf791223ca416ad845e12a4ca38e) Result = SUCCESS James Nord : 0e122dfcacebbf791223ca416ad845e12a4ca38e Files : core/src/main/java/hudson/tasks/junit/CaseResult.java core/src/main/java/hudson/tasks/test/TestObject.java core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java core/src/main/java/hudson/tasks/junit/ClassResult.java

            Unassigned Unassigned
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: