You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Leonard Brünings (Jira)" <ji...@apache.org> on 2020/11/30 17:51:00 UTC

[jira] [Created] (SUREFIRE-1864) Excessive use of discover by the JUnitPlatformProvider

Leonard Brünings created SUREFIRE-1864:
------------------------------------------

             Summary: Excessive use of discover by the JUnitPlatformProvider
                 Key: SUREFIRE-1864
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1864
             Project: Maven Surefire
          Issue Type: Improvement
          Components: JUnit 5.x support
    Affects Versions: 3.0.0-M5
            Reporter: Leonard Brünings


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...)}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)