Build: Use fake ideaHome for tests with intellij build number only

#KTI-82
This commit is contained in:
Vyacheslav Gerasimov
2021-12-02 03:31:00 +03:00
committed by teamcity
parent 516e54a434
commit 944c7990a1
10 changed files with 32 additions and 14 deletions
@@ -113,4 +113,11 @@ object IntellijRootUtils {
}
}
fun Project.intellijRootDir() = IntellijRootUtils.getIntellijRootDir(project)
fun Project.ideaHomePathForTests() = rootProject.buildDir.resolve("ideaHomeForTests")
fun Project.ideaBuildNumberFileForTests() = File(ideaHomePathForTests(), "build.txt")
fun Project.writeIdeaBuildNumberForTests() {
ideaHomePathForTests().mkdirs()
ideaBuildNumberFileForTests().writeText("IC-${rootProject.extra["versions.intellijSdk"]}")
}
+3 -1
View File
@@ -110,6 +110,8 @@ fun Project.projectTest(
evaluationDependsOn(":test-instrumenter")
}
return getOrCreateTask<Test>(taskName) {
dependsOn(":createIdeaHomeForTests")
doFirst {
if (jUnitMode == JUnitMode.JUnit5) return@doFirst
@@ -177,7 +179,7 @@ fun Project.projectTest(
maxHeapSize = "1600m"
systemProperty("idea.is.unit.test", "true")
systemProperty("idea.home.path", project.intellijRootDir().canonicalPath)
systemProperty("idea.home.path", project.ideaHomePathForTests().canonicalPath)
systemProperty("java.awt.headless", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
environment("PROJECT_CLASSES_DIRS", project.testSourceSet.output.classesDirs.asPath)