mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[test framework] IJI-1588 Fix filter out non-performance classes in performance-only runs
GitOrigin-RevId: 807a28b0586034a14fce44d819cfcd7118215dc8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d8d9789887
commit
6ac4c11b22
@@ -771,7 +771,7 @@ internal class TestingTasksImpl(private val context: CompilationContext, private
|
||||
fun runOneClass(testClassName: String) {
|
||||
val exitCode = blockAndSpan("running test class '$testClassName'") {
|
||||
runJUnit5Engine(
|
||||
systemProperties = systemProperties + ("idea.performance.tests.discovery.filter" to "true"),
|
||||
systemProperties = systemProperties,
|
||||
jvmArgs = jvmArgs,
|
||||
envVariables = envVariables,
|
||||
bootstrapClasspath = bootstrapClasspath,
|
||||
@@ -806,7 +806,7 @@ internal class TestingTasksImpl(private val context: CompilationContext, private
|
||||
|
||||
val exitCode = blockAndSpan("running tests in package '$packageName'") {
|
||||
runJUnit5Engine(
|
||||
systemProperties = systemProperties + ("idea.performance.tests.discovery.filter" to "true"),
|
||||
systemProperties = systemProperties,
|
||||
jvmArgs = jvmArgs,
|
||||
envVariables = envVariables,
|
||||
bootstrapClasspath = bootstrapClasspath,
|
||||
|
||||
+12
-2
@@ -62,8 +62,13 @@ public final class JUnit5TeamCityRunnerForTestAllSuite {
|
||||
else {
|
||||
selectors = Collections.singletonList(DiscoverySelectors.selectMethod(args[0], args[1]));
|
||||
}
|
||||
if (Boolean.getBoolean("idea.performance.tests.discovery.filter")) {
|
||||
// Add filter
|
||||
// isIncludingPerformanceTestsRun() || isPerformanceTestsRun() && isPerformanceTest(test) -> add test
|
||||
// otherwise -> skip test
|
||||
if (Boolean.getBoolean("idea.include.performance.tests")) {
|
||||
// no filter
|
||||
}
|
||||
else if (Boolean.getBoolean("idea.performance.tests")) {
|
||||
// Add filter for 'isPerformanceTest'
|
||||
filters.add(createPerformancePostDiscoveryFilter(classLoader));
|
||||
}
|
||||
LauncherDiscoveryRequest discoveryRequest = LauncherDiscoveryRequestBuilder.request()
|
||||
@@ -93,6 +98,11 @@ public final class JUnit5TeamCityRunnerForTestAllSuite {
|
||||
.findStatic(Class.forName("com.intellij.testFramework.TestFrameworkUtil", true, classLoader),
|
||||
"isPerformanceTest", MethodType.methodType(boolean.class, String.class, String.class));
|
||||
return new PostDiscoveryFilter() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PerformanceOnlyTestsPostDiscoveryFilter";
|
||||
}
|
||||
|
||||
private FilterResult isIncluded(String className, String methodName) {
|
||||
try {
|
||||
if ((boolean)method.invokeExact(methodName, className)) {
|
||||
|
||||
Reference in New Issue
Block a user