Always configure "idea.home.path" system variable
When TestLoggerFactory is initialized in tests it checks that variable
and it it's not present uses classpath to search for logger configuration.
If this search is unsuccessful a lot of exceptions are written to log:
java.lang.RuntimeException: Could not find installation home path. Please make sure bin/idea.properties is present in the installation directory.
at com.intellij.openapi.application.PathManager.getHomePath(PathManager.java:96)
at com.intellij.testFramework.TestLoggerFactory.reconfigure(TestLoggerFactory.java:67)
This commit is contained in:
@@ -70,6 +70,7 @@ fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}):
|
|||||||
jvmArgs("-ea", "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1100m", "-XX:+UseCodeCacheFlushing", "-XX:ReservedCodeCacheSize=128m", "-Djna.nosys=true")
|
jvmArgs("-ea", "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1100m", "-XX:+UseCodeCacheFlushing", "-XX:ReservedCodeCacheSize=128m", "-Djna.nosys=true")
|
||||||
maxHeapSize = "1100m"
|
maxHeapSize = "1100m"
|
||||||
systemProperty("idea.is.unit.test", "true")
|
systemProperty("idea.is.unit.test", "true")
|
||||||
|
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
||||||
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
|
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
|
||||||
environment("PROJECT_CLASSES_DIRS", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.asPath)
|
environment("PROJECT_CLASSES_DIRS", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.asPath)
|
||||||
environment("PROJECT_BUILD_DIR", buildDir)
|
environment("PROJECT_BUILD_DIR", buildDir)
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ sourceSets {
|
|||||||
|
|
||||||
projectTest {
|
projectTest {
|
||||||
doFirst {
|
doFirst {
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
environment("kotlin.tests.android.timeout", "45")
|
environment("kotlin.tests.android.timeout", "45")
|
||||||
}
|
}
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ projectTest {
|
|||||||
doFirst {
|
doFirst {
|
||||||
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
||||||
systemProperty("kotlin.ant.launcher.class", "org.apache.tools.ant.Main")
|
systemProperty("kotlin.ant.launcher.class", "org.apache.tools.ant.Main")
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,9 +34,6 @@ sourceSets {
|
|||||||
|
|
||||||
projectTest {
|
projectTest {
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
doFirst {
|
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testsJar()
|
testsJar()
|
||||||
|
|||||||
@@ -121,9 +121,6 @@ sourceSets {
|
|||||||
projectTest {
|
projectTest {
|
||||||
dependsOn(":dist")
|
dependsOn(":dist")
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
doFirst {
|
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testsJar {}
|
testsJar {}
|
||||||
|
|||||||
@@ -71,9 +71,6 @@ sourceSets {
|
|||||||
projectTest {
|
projectTest {
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
useAndroidSdk()
|
useAndroidSdk()
|
||||||
doFirst {
|
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testsJar {}
|
testsJar {}
|
||||||
|
|||||||
@@ -77,9 +77,6 @@ testsJar()
|
|||||||
projectTest {
|
projectTest {
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
useAndroidSdk()
|
useAndroidSdk()
|
||||||
doFirst {
|
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configureInstrumentation()
|
configureInstrumentation()
|
||||||
|
|||||||
@@ -58,7 +58,4 @@ testsJar()
|
|||||||
|
|
||||||
projectTest {
|
projectTest {
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
doFirst {
|
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,6 @@ sourceSets {
|
|||||||
projectTest {
|
projectTest {
|
||||||
dependsOn(":dist")
|
dependsOn(":dist")
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
doFirst {
|
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testsJar()
|
testsJar()
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ projectTest {
|
|||||||
doFirst {
|
doFirst {
|
||||||
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
||||||
systemProperty("kotlin.ant.launcher.class", "org.apache.tools.ant.Main")
|
systemProperty("kotlin.ant.launcher.class", "org.apache.tools.ant.Main")
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,9 +67,6 @@ projectTest {
|
|||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
useAndroidSdk()
|
useAndroidSdk()
|
||||||
useAndroidJar()
|
useAndroidJar()
|
||||||
doFirst {
|
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
runtimeJar()
|
runtimeJar()
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ sourceSets {
|
|||||||
projectTest {
|
projectTest {
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
useAndroidSdk()
|
useAndroidSdk()
|
||||||
doFirst {
|
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testsJar {}
|
testsJar {}
|
||||||
@@ -44,7 +44,4 @@ ideaPlugin {
|
|||||||
projectTest {
|
projectTest {
|
||||||
dependsOn(":kotlin-stdlib:jvm-minimal-for-test:dist")
|
dependsOn(":kotlin-stdlib:jvm-minimal-for-test:dist")
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
doFirst {
|
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,4 @@ testsJar {}
|
|||||||
|
|
||||||
projectTest {
|
projectTest {
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
doFirst {
|
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user