From d6ee37d3938cec8348cf711f307c7778eb252a23 Mon Sep 17 00:00:00 2001 From: Jaime Wren Date: Wed, 3 Sep 2025 16:10:55 -0700 Subject: [PATCH] Resolve some tasks in the integration test The dartPluginVersion is also updated --- build.gradle.kts | 4 ++++ gradle.properties | 3 ++- .../NewProjectUITest.kt | 10 +++++----- .../{integrationTest => integration}/Setup.kt | 18 +++++++++--------- .../utils/NewProject.kt | 2 +- 5 files changed, 21 insertions(+), 16 deletions(-) rename testSrc/integration/io/flutter/{integrationTest => integration}/NewProjectUITest.kt (97%) rename testSrc/integration/io/flutter/{integrationTest => integration}/Setup.kt (91%) rename testSrc/integration/io/flutter/{integrationTest => integration}/utils/NewProject.kt (99%) diff --git a/build.gradle.kts b/build.gradle.kts index c44945d0a..aa85d2858 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -324,6 +324,10 @@ tasks { // Disable IntelliJ test listener that conflicts with standard JUnit systemProperty("idea.test.cyclic.buffer.size", "0") + // Pass properties from gradle.properties to the JVM as system properties + project.findProperty("dartPluginVersion")?.let { systemProperty("dartPluginVersion", it) } + project.findProperty("uiPlatformBuildVersion")?.let { systemProperty("uiPlatformBuildVersion", it) } + // Add required JVM arguments jvmArgumentProviders += CommandLineArgumentProvider { mutableListOf( diff --git a/gradle.properties b/gradle.properties index 53ebd2ce0..6873b1b5e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,8 @@ # ideaVersion=2025.1.3.4 -dartPluginVersion= 251.27623.5 +dartPluginVersion=252.24322.5 +uiPlatformBuildVersion=252.23892.409 sinceBuild=243 untilBuild=253.* javaVersion=21 diff --git a/testSrc/integration/io/flutter/integrationTest/NewProjectUITest.kt b/testSrc/integration/io/flutter/integration/NewProjectUITest.kt similarity index 97% rename from testSrc/integration/io/flutter/integrationTest/NewProjectUITest.kt rename to testSrc/integration/io/flutter/integration/NewProjectUITest.kt index 719a42ce4..a8b91a457 100644 --- a/testSrc/integration/io/flutter/integrationTest/NewProjectUITest.kt +++ b/testSrc/integration/io/flutter/integration/NewProjectUITest.kt @@ -4,7 +4,7 @@ * found in the LICENSE file. */ -package io.flutter.integrationTest +package io.flutter.integration import com.intellij.driver.sdk.ui.components.UiComponent.Companion.waitFound import com.intellij.driver.sdk.ui.components.common.ideFrame @@ -13,7 +13,7 @@ import com.intellij.driver.sdk.waitForIndicators import com.intellij.ide.starter.driver.engine.BackgroundRun import com.intellij.ide.starter.driver.engine.runIdeWithDriver import com.intellij.ide.starter.junit5.config.UseLatestDownloadedIdeBuild -import io.flutter.integrationTest.utils.newProjectWelcomeScreen +import io.flutter.integration.utils.newProjectWelcomeScreen import org.junit.jupiter.api.AfterAll import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach @@ -83,7 +83,7 @@ class MyProjectUITest { } @Test - fun newProjectIC() { + fun testNewProjectIC() { println("Initializing IDE test context") println("Test project will be created as: $testProjectName") run = Setup.setupTestContextIC("MyProjectUITest").runIdeWithDriver() @@ -94,7 +94,7 @@ class MyProjectUITest { @Test @Disabled("Need license configuration to test") - fun newProjectUE() { + fun testNewProjectUE() { println("Initializing IDE test context") println("Test project will be created as: $testProjectName") run = Setup.setupTestContextUE("MyProjectUITest").runIdeWithDriver() @@ -111,7 +111,7 @@ class MyProjectUITest { @Test @Disabled("Need license configuration to test") - fun newProjectWS() { + fun testNewProjectWS() { println("Initializing IDE test context") println("Test project will be created as: $testProjectName") run = Setup.setupTestContextWS("MyProjectUITest").runIdeWithDriver() diff --git a/testSrc/integration/io/flutter/integrationTest/Setup.kt b/testSrc/integration/io/flutter/integration/Setup.kt similarity index 91% rename from testSrc/integration/io/flutter/integrationTest/Setup.kt rename to testSrc/integration/io/flutter/integration/Setup.kt index 3af05d4b6..30da2d097 100644 --- a/testSrc/integration/io/flutter/integrationTest/Setup.kt +++ b/testSrc/integration/io/flutter/integration/Setup.kt @@ -4,7 +4,7 @@ * found in the LICENSE file. */ -package io.flutter.integrationTest +package io.flutter.integration import com.intellij.ide.starter.buildTool.GradleBuildTool import com.intellij.ide.starter.community.model.BuildType @@ -45,7 +45,6 @@ class Setup { companion object { - init { // Configure dependency injection to use our custom paths di = DI.Companion { @@ -55,30 +54,30 @@ class Setup { } fun setupTestContextIC(hyphenateWithClass: String, projectInfoSpec: ProjectInfoSpec = NoProject): IDETestContext { + val uiPlatformBuildVersion = System.getProperty("uiPlatformBuildVersion") return setupTestContext( "", IdeProductProvider.IC.copy( - // TODO(team) should the version be fetched from some setting, i.e. System.getProperty("uiPlatformBuildVersion") - buildNumber = "252.23892.409", + buildNumber = uiPlatformBuildVersion, buildType = BuildType.RELEASE.type ), projectInfoSpec ) } fun setupTestContextUE(hyphenateWithClass: String, projectInfoSpec: ProjectInfoSpec = NoProject): IDETestContext { + val uiPlatformBuildVersion = System.getProperty("uiPlatformBuildVersion") return setupTestContext( "", IdeProductProvider.IU.copy( - // TODO(team) should the version be fetched from some setting, i.e. System.getProperty("uiPlatformBuildVersion") - buildNumber = "252.23892.409", + buildNumber = uiPlatformBuildVersion, buildType = BuildType.RELEASE.type ), projectInfoSpec ) } fun setupTestContextWS(hyphenateWithClass: String, projectInfoSpec: ProjectInfoSpec = NoProject): IDETestContext { + val uiPlatformBuildVersion = System.getProperty("uiPlatformBuildVersion") return setupTestContext( "", IdeProductProvider.WS.copy( - // TODO(team) should the version be fetched from some setting, i.e. System.getProperty("uiPlatformBuildVersion") - buildNumber = "252.23892.411", + buildNumber = uiPlatformBuildVersion, buildType = BuildType.RELEASE.type ), projectInfoSpec ) @@ -105,9 +104,10 @@ class Setup { return Starter.newContext(testName = hyphenateWithClass, testCase = testCase).apply { // Install the plugin that was built by the buildPlugin task val pluginPath = System.getProperty("path.to.build.plugin") + val dartPluginVersion = System.getProperty("dartPluginVersion") PluginConfigurator(this) .installPluginFromPath(Paths.get(pluginPath)) - .installPluginFromPluginManager("Dart", "252.24322.5") + .installPluginFromPluginManager("Dart", dartPluginVersion) withBuildTool() }.applyVMOptionsPatch { diff --git a/testSrc/integration/io/flutter/integrationTest/utils/NewProject.kt b/testSrc/integration/io/flutter/integration/utils/NewProject.kt similarity index 99% rename from testSrc/integration/io/flutter/integrationTest/utils/NewProject.kt rename to testSrc/integration/io/flutter/integration/utils/NewProject.kt index 1a857adf4..7e849966f 100644 --- a/testSrc/integration/io/flutter/integrationTest/utils/NewProject.kt +++ b/testSrc/integration/io/flutter/integration/utils/NewProject.kt @@ -4,7 +4,7 @@ * found in the LICENSE file. */ -package io.flutter.integrationTest.utils +package io.flutter.integration.utils import com.intellij.driver.sdk.ui.Finder import com.intellij.driver.sdk.ui.components.ComponentData