From 0818919bdd6bae9fa594f4b8e7822ebe83155e6e Mon Sep 17 00:00:00 2001 From: Kate Botsman Date: Wed, 5 Nov 2025 13:49:39 +0100 Subject: [PATCH] [tests] IJPL-211571 Allow skipping embedded client in tests JetBrainsClientDownloaderTest.testCleanDownloadStaging checks the correctness of downloaded data from staging. Checking local (embedded) installation is incorrect in this test. Moreover, the test fails because of that. GitOrigin-RevId: 78e6018677c7af2e7e260e4c63770330f5f63f4a --- .../downloader/CodeWithMeClientDownloader.kt | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/platform/remoteDev-util/src/com/intellij/remoteDev/downloader/CodeWithMeClientDownloader.kt b/platform/remoteDev-util/src/com/intellij/remoteDev/downloader/CodeWithMeClientDownloader.kt index 9a46761eb3c3..fbf7beb2325f 100644 --- a/platform/remoteDev-util/src/com/intellij/remoteDev/downloader/CodeWithMeClientDownloader.kt +++ b/platform/remoteDev-util/src/com/intellij/remoteDev/downloader/CodeWithMeClientDownloader.kt @@ -53,6 +53,7 @@ import com.sun.jna.platform.win32.WinBase import com.sun.jna.platform.win32.WinNT import com.sun.jna.ptr.IntByReference import org.jetbrains.annotations.ApiStatus +import org.jetbrains.annotations.TestOnly import java.io.ByteArrayInputStream import java.io.File import java.io.IOException @@ -378,11 +379,26 @@ object CodeWithMeClientDownloader { fun downloadFrontendAndJdk(sessionInfoResponse: JetBrainsClientDownloadInfo, progressIndicator: ProgressIndicator): FrontendInstallation { + return downloadFrontendAndJdkImpl(sessionInfoResponse, progressIndicator, useEmbeddedClientIfAvailable = true) + } + + @TestOnly + fun downloadFrontendAndJdk(sessionInfoResponse: JetBrainsClientDownloadInfo, + progressIndicator: ProgressIndicator, + useEmbeddedClientIfAvailable: Boolean): FrontendInstallation { + return downloadFrontendAndJdkImpl(sessionInfoResponse, progressIndicator, useEmbeddedClientIfAvailable) + } + + private fun downloadFrontendAndJdkImpl(sessionInfoResponse: JetBrainsClientDownloadInfo, + progressIndicator: ProgressIndicator, + useEmbeddedClientIfAvailable: Boolean): FrontendInstallation { ApplicationManager.getApplication().assertIsNonDispatchThread() - val embeddedClientLauncher = createEmbeddedClientLauncherIfAvailable(sessionInfoResponse.clientBuildNumber) - if (embeddedClientLauncher != null) { - return EmbeddedFrontendInstallation(embeddedClientLauncher) + if (useEmbeddedClientIfAvailable) { + val embeddedClientLauncher = createEmbeddedClientLauncherIfAvailable(sessionInfoResponse.clientBuildNumber) + if (embeddedClientLauncher != null) { + return EmbeddedFrontendInstallation(embeddedClientLauncher) + } } val tempDir = FileUtil.createTempDirectory("jb-cwm-dl", null).toPath()