AT-3038: do not run xvfb for headless tests

GitOrigin-RevId: 1c41d378e178272e2a42f45b361f84bea57a5a37
This commit is contained in:
Anastasia Katsman
2025-11-28 23:54:15 +00:00
committed by intellij-monorepo-bot
parent 2c62d815a1
commit 4c5545ec77
2 changed files with 4 additions and 4 deletions
@@ -28,9 +28,9 @@ class LinuxIdeDistribution : IdeDistribution() {
XVFB_TOOL_NAME
}
fun linuxCommandLine(xvfbRunLog: Path, commandEnv: Map<String, String> = emptyMap()): List<String> {
fun linuxCommandLine(xvfbRunLog: Path, vmOptions: VMOptions): List<String> {
return when {
System.getenv("DISPLAY") != null || commandEnv["DISPLAY"] != null -> listOf()
System.getenv("DISPLAY") != null || vmOptions.environmentVariables["DISPLAY"] != null || vmOptions.hasHeadlessMode() -> listOf()
else ->
//hint https://gist.github.com/tullmann/2d8d38444c5e81a41b6d
listOf(
@@ -80,7 +80,7 @@ class LinuxIdeDistribution : IdeDistribution() {
return object : InstalledBackedIDEStartConfig(patchedVMOptionsFile, vmOptions) {
override val errorDiagnosticFiles = listOf(xvfbRunLog)
override val workDir = appHome
override val commandLine: List<String> = linuxCommandLine(xvfbRunLog, vmOptions.environmentVariables) + executablePath.toAbsolutePath().toString()
override val commandLine: List<String> = linuxCommandLine(xvfbRunLog, vmOptions) + executablePath.toAbsolutePath().toString()
}
}
@@ -135,7 +135,7 @@ class IdeFromCodeInstaller(private val useInstallationCache: Boolean = true) : I
val xvfbRunLog = LinuxIdeDistribution.Companion.createXvfbRunLog(logsDir)
override val commandLine: List<String> = when {
SystemInfoRt.isLinux -> LinuxIdeDistribution.Companion.linuxCommandLine(xvfbRunLog, commandEnv = finalVMOptions.environmentVariables) + commandArgs
SystemInfoRt.isLinux -> LinuxIdeDistribution.Companion.linuxCommandLine(xvfbRunLog, vmOptions = finalVMOptions) + commandArgs
else -> commandArgs
}