JetBrains / intellij-platform-gradle-plugin

Gradle plugin for building plugins for IntelliJ-based IDEs
https://plugins.jetbrains.com/docs/intellij/gradle-prerequisites.html
Apache License 2.0
1.42k stars 271 forks source link

2024.2 eap: Performance tests fail with "No implementations of com.intellij.testFramework.PerformanceTestInfo found" #1653

Closed jansorg closed 3 months ago

jansorg commented 3 months ago

What happened?

Executing performance tests fail with 2024.2. I don't know if this is a general problem of 2024.2 eap or of the intellij-platform-gradle plugin.

Relevant log output or stack trace

No implementations of com.intellij.testFramework.PerformanceTestInfo found. Make sure to include intellij.tools.ide.metrics.benchmark module containing the implementation in the classpath.
java.util.ServiceConfigurationError: No implementations of com.intellij.testFramework.PerformanceTestInfo found. Make sure to include intellij.tools.ide.metrics.benchmark module containing the implementation in the classpath.
    at com.intellij.testFramework.PerformanceTestInfoLoader$Companion.getInstance(PerformanceTestInfoLoader.kt:18)
    at com.intellij.testFramework.PlatformTestUtil.newPerformanceTestWithVariableInputSize(PlatformTestUtil.java:674)
    at com.intellij.testFramework.PlatformTestUtil.newPerformanceTest(PlatformTestUtil.java:654)
    at org.jetbrains.plugins.template.SamplePerformanceTest.sample(SamplePerformanceTest.kt:10)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at com.intellij.testFramework.UsefulTestCase.lambda$wrapTestRunnable$14(UsefulTestCase.java:512)
    at com.intellij.testFramework.UsefulTestCase.runTestRunnable(UsefulTestCase.java:411)
    at com.intellij.testFramework.fixtures.BasePlatformTestCase.runTestRunnable(BasePlatformTestCase.java:109)
    at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:427)
    at com.intellij.testFramework.UsefulTestCase.lambda$runBare$12(UsefulTestCase.java:494)
    at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$3(EdtTestUtil.java:80)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
    at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$4(EdtTestUtil.java:79)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:322)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Steps to reproduce

Checkout https://github.com/jansorg/intellij-platform-plugin-template/tree/2.0.0-broken-performance-test (branch 2.0.0-broken-performance-test) and and run the tests. The latest commit contains the changes. Apparently this only happens with 2024.2 eap.

Gradle IntelliJ Plugin version

2.0.0.beta6

Gradle version

8.8

Operating System

Linux

Link to build, i.e. failing GitHub Action job

No response

hsz commented 3 months ago

Fixed with: https://github.com/JetBrains/intellij-platform-gradle-plugin/commit/1e28e07498a6b9ed8fad0be56097bf7da1278047

Metrics and benchmarking tools were extracted from the Test Framework. To include them back in the tests classpath, you'll need to use testFramework(TestFrameworkType.Metrics) helper:

dependencies {
    ...

    intellijPlatform {
        intellijIdeaCommunity(...)
        testFramework(TestFrameworkType.Platform)
        testFramework(TestFrameworkType.Metrics)
    }
}