Describe the bug
Profiling a test run configuration in IntelliJ does not seem to work. All test cases are being executed after starting a test run configuration with "Profile with async-profiler", but no profile.jfr is created and thus no results are shown.
"Profile with JFR" is not available for test run configurations.
To Reproduce
Steps to reproduce the behavior:
Rightclick a JUnit5 test class
Choose "Profile with async-profiler ..."
Test case is executed
No profile.jfr is created nor results are shown
Expected behavior
Executing a test run configuration (without main method) creates a profile.jfr and shows results.
Workaround
I found a workaround by creating a test launcher class with a main method.
Running "Profile with async-profiler" on the TestLauncher creates a profile.jfr and shows results as expected.
// Junit5 test launcher
public class TestLauncher {
public static void main(final String... args) {
LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
.selectors(selectPackage("<app>"))
.filters(includeClassNamePatterns(".*Test"))
.build();
Launcher launcher = LauncherFactory.create();
launcher.execute(request);
}
}
Describe the bug Profiling a test run configuration in IntelliJ does not seem to work. All test cases are being executed after starting a test run configuration with "Profile with async-profiler", but no profile.jfr is created and thus no results are shown.
"Profile with JFR" is not available for test run configurations.
To Reproduce Steps to reproduce the behavior:
Expected behavior Executing a test run configuration (without main method) creates a profile.jfr and shows results.
Workaround I found a workaround by creating a test launcher class with a main method. Running "Profile with async-profiler" on the TestLauncher creates a profile.jfr and shows results as expected.