diff --git a/idea/build.gradle.kts.173 b/idea/build.gradle.kts.173 index 0016e48fa1d..bb167f20022 100644 --- a/idea/build.gradle.kts.173 +++ b/idea/build.gradle.kts.173 @@ -115,6 +115,26 @@ sourceSets { "idea-live-templates/tests" ) } + +} + +val performanceTestCompile by configurations.creating { + extendsFrom(configurations["testCompile"]) +} + +val performanceTestRuntime by configurations.creating { + extendsFrom(configurations["testRuntime"]) +} + +val performanceTest by run { + val sourceSets = javaPluginConvention().sourceSets + sourceSets.creating { + compileClasspath += sourceSets["test"].output + compileClasspath += sourceSets["main"].output + runtimeClasspath += sourceSets["test"].output + runtimeClasspath += sourceSets["main"].output + java.srcDirs("performanceTests") + } } projectTest { @@ -122,6 +142,37 @@ projectTest { workingDir = rootDir } + +projectTest(taskName = "performanceTest") { + dependsOn(":dist") + dependsOn(performanceTest.output) + testClassesDirs = performanceTest.output.classesDirs + classpath = performanceTest.runtimeClasspath + workingDir = rootDir + + jvmArgs?.removeAll { it.startsWith("-Xmx") } + + maxHeapSize = "3g" + jvmArgs("-XX:SoftRefLRUPolicyMSPerMB=50") + jvmArgs( + "-XX:ReservedCodeCacheSize=240m", + "-XX:+UseCompressedOops", + "-XX:+UseConcMarkSweepGC" + ) + jvmArgs("-XX:+UnlockCommercialFeatures", "-XX:+FlightRecorder") + + if (hasProperty("perf.flight.recorder.override")) { + jvmArgs(property("perf.flight.recorder.override")) + } else { + val settings = if (hasProperty("perf.flight.recorder.settings")) ",settings=${property("perf.flight.recorder.settings")}" else "" + jvmArgs("-XX:StartFlightRecording=delay=15m,duration=5h,filename=perf.jfr$settings") + } + + doFirst { + systemProperty("idea.home.path", intellijRootDir().canonicalPath) + } +} + testsJar {} classesDirsArtifact() diff --git a/idea/build.gradle.kts.as31 b/idea/build.gradle.kts.as31 index fd6d4e392f5..f8f768a0984 100644 --- a/idea/build.gradle.kts.as31 +++ b/idea/build.gradle.kts.as31 @@ -116,6 +116,26 @@ sourceSets { "idea-live-templates/tests" ) } + +} + +val performanceTestCompile by configurations.creating { + extendsFrom(configurations["testCompile"]) +} + +val performanceTestRuntime by configurations.creating { + extendsFrom(configurations["testRuntime"]) +} + +val performanceTest by run { + val sourceSets = javaPluginConvention().sourceSets + sourceSets.creating { + compileClasspath += sourceSets["test"].output + compileClasspath += sourceSets["main"].output + runtimeClasspath += sourceSets["test"].output + runtimeClasspath += sourceSets["main"].output + java.srcDirs("performanceTests") + } } projectTest { @@ -123,6 +143,37 @@ projectTest { workingDir = rootDir } + +projectTest(taskName = "performanceTest") { + dependsOn(":dist") + dependsOn(performanceTest.output) + testClassesDirs = performanceTest.output.classesDirs + classpath = performanceTest.runtimeClasspath + workingDir = rootDir + + jvmArgs?.removeAll { it.startsWith("-Xmx") } + + maxHeapSize = "3g" + jvmArgs("-XX:SoftRefLRUPolicyMSPerMB=50") + jvmArgs( + "-XX:ReservedCodeCacheSize=240m", + "-XX:+UseCompressedOops", + "-XX:+UseConcMarkSweepGC" + ) + jvmArgs("-XX:+UnlockCommercialFeatures", "-XX:+FlightRecorder") + + if (hasProperty("perf.flight.recorder.override")) { + jvmArgs(property("perf.flight.recorder.override")) + } else { + val settings = if (hasProperty("perf.flight.recorder.settings")) ",settings=${property("perf.flight.recorder.settings")}" else "" + jvmArgs("-XX:StartFlightRecording=delay=15m,duration=5h,filename=perf.jfr$settings") + } + + doFirst { + systemProperty("idea.home.path", intellijRootDir().canonicalPath) + } +} + testsJar {} classesDirsArtifact() diff --git a/idea/build.gradle.kts.as32 b/idea/build.gradle.kts.as32 index fd6d4e392f5..f8f768a0984 100644 --- a/idea/build.gradle.kts.as32 +++ b/idea/build.gradle.kts.as32 @@ -116,6 +116,26 @@ sourceSets { "idea-live-templates/tests" ) } + +} + +val performanceTestCompile by configurations.creating { + extendsFrom(configurations["testCompile"]) +} + +val performanceTestRuntime by configurations.creating { + extendsFrom(configurations["testRuntime"]) +} + +val performanceTest by run { + val sourceSets = javaPluginConvention().sourceSets + sourceSets.creating { + compileClasspath += sourceSets["test"].output + compileClasspath += sourceSets["main"].output + runtimeClasspath += sourceSets["test"].output + runtimeClasspath += sourceSets["main"].output + java.srcDirs("performanceTests") + } } projectTest { @@ -123,6 +143,37 @@ projectTest { workingDir = rootDir } + +projectTest(taskName = "performanceTest") { + dependsOn(":dist") + dependsOn(performanceTest.output) + testClassesDirs = performanceTest.output.classesDirs + classpath = performanceTest.runtimeClasspath + workingDir = rootDir + + jvmArgs?.removeAll { it.startsWith("-Xmx") } + + maxHeapSize = "3g" + jvmArgs("-XX:SoftRefLRUPolicyMSPerMB=50") + jvmArgs( + "-XX:ReservedCodeCacheSize=240m", + "-XX:+UseCompressedOops", + "-XX:+UseConcMarkSweepGC" + ) + jvmArgs("-XX:+UnlockCommercialFeatures", "-XX:+FlightRecorder") + + if (hasProperty("perf.flight.recorder.override")) { + jvmArgs(property("perf.flight.recorder.override")) + } else { + val settings = if (hasProperty("perf.flight.recorder.settings")) ",settings=${property("perf.flight.recorder.settings")}" else "" + jvmArgs("-XX:StartFlightRecording=delay=15m,duration=5h,filename=perf.jfr$settings") + } + + doFirst { + systemProperty("idea.home.path", intellijRootDir().canonicalPath) + } +} + testsJar {} classesDirsArtifact()