Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1864

Excessive use of discover by the JUnitPlatformProvider

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-M5
    • None
    • JUnit 5.x support
    • None

    Description

      This issue is derived from https://github.com/spockframework/spock/issues/1240

      The current implementation of the JUnitPlatformProvider together with its helper classes, especially TestPlanScannerFilter first make a separate discover call for each class and then another discovery request by calling execute with another LauncherDiscoveryRequest instead of reusing the TestPlan returned by a previous discovery.

       

      The issue here, is that engines have to compute many things during the discovery that are then simply discarded and need to be recomputed again.

      To improve this, surefire should call org.junit.platform.launcher.core.DefaultLauncher#discover(org.junit.platform.launcher.LauncherDiscoveryRequest) first with all the classes and then use the returned TestPlan to execute it instead of recomputing in by calling  org.junit.platform.launcher.core.DefaultLauncher#execute(org.junit.platform.launcher.TestPlan, org.junit.platform.launcher.TestExecutionListener...)

      instead of org.junit.platform.launcher.core.DefaultLauncher#execute(org.junit.platform.launcher.LauncherDiscoveryRequest, org.junit.platform.launcher.TestExecutionListener...)

      Alternatively, it could forego a separate discovery and only call org.junit.platform.launcher.core.DefaultLauncher#execute(org.junit.platform.launcher.LauncherDiscoveryRequest, org.junit.platform.launcher.TestExecutionListener...)

      Attachments

        Activity

          People

            Unassigned Unassigned
            leonard84 Leonard Brünings
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: