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

JenkinsRule mode to use realistic class loading

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      JenkinsRule-based tests generally load not only Jenkins core but also all plugins from ${java.class.path}, i.e., the Maven test-scoped classpath. This is convenient in some ways but also means that class loading is done in a very different way than in an actual production instance, or even mvn hpi:run, making it very hard to test changes like JENKINS-26192 without using the much clunkier, slower, and flakier acceptance-test-harness. It also means that we are forever fighting with Maven's weird transitive dependency management (JENKINS-41631, JENKINS-39301, etc.).

      There should be an option to run JenkinsRule in a mode whereby the test classpath is only used to load Jetty; Jenkins core and its WEB-INF/lib/*.jar (including modules!) is loaded in a derivative class loader; and then plugins are discovered from the test classpath, transitive dependencies computed and verified, and finally loaded in the real plugin class loader (probably using *.jpl files to allow us to still load from unpacked development trees). Finally, the test suite itself needs to be reloaded in a fresh loader parented to UberClassLoader, and executed from there.

      NbModuleSuite demonstrates the concept, though the details would be rather different for Jenkins.

      There are a lot of details to be checked, such as

      • @TestExtension handling
      • PluginWorkspaceMap support for coördinated snapshot development
      • moving InjectedTest from HudsonTestCase so that it can use the new mode

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue relates to JENKINS-41631 [ JENKINS-41631 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-39301 [ JENKINS-39301 ]
            jglick Jesse Glick made changes -
            Assignee Oliver Gondža [ olivergondza ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-30685 [ JENKINS-30685 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-31068 [ JENKINS-31068 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-26579 [ JENKINS-26579 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-46754 [ JENKINS-46754 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal OSS-1951 (Web Link)" [ 18497 ]
            jglick Jesse Glick made changes -
            Labels classloader testing classloader essentials testing
            gmshake Zhenlei Huang made changes -
            Link This issue is related to JENKINS-48357 [ JENKINS-48357 ]
            gmshake Zhenlei Huang made changes -
            Link This issue relates to JENKINS-48357 [ JENKINS-48357 ]
            gmshake Zhenlei Huang made changes -
            Link This issue is related to JENKINS-48357 [ JENKINS-48357 ]
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-50520 [ JENKINS-50520 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-51779 [ JENKINS-51779 ]
            batmat Baptiste Mathus made changes -
            Labels classloader essentials testing classloader essentials evergreen testing
            batmat Baptiste Mathus made changes -
            Labels classloader essentials evergreen testing classloader evergreen testing

              People

              • Assignee:
                Unassigned
                Reporter:
                jglick Jesse Glick
              • Votes:
                4 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated: