Skip to content

Add VMServiceTest with a simple test project. - #9052

Merged
helin24 merged 2 commits into
flutter:mainfrom
JavadAsadi:VMServiceTest
Jul 28, 2026
Merged

Add VMServiceTest with a simple test project.#9052
helin24 merged 2 commits into
flutter:mainfrom
JavadAsadi:VMServiceTest

Conversation

@JavadAsadi

Copy link
Copy Markdown
Contributor

Summary

Adds VmServiceTest, an integration test that launches a paused Flutter test process using machine output, extracts its VM Service URI, connects over WebSocket, and verifies three request/response exchanges:

  1. getVersion
  2. getVM
  3. streamListen(Isolate)

How to run

The test requires a Flutter SDK. Set FLUTTER_ROOT or FLUTTER_SDK to the SDK directory.

From the command line:

FLUTTER_ROOT=/path/to/flutter ./gradlew integration
--tests "io.flutter.integrationTest.vmService.VmServiceTest"

In the IDE, run the class as a JUnit test after adding FLUTTER_ROOT to the run configuration’s environment variables. The test is skipped when no Flutter SDK is configured.

@google-cla

google-cla Bot commented Jul 25, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request registers a new integration test task in Gradle and introduces VmServiceTest, which verifies that the IDE can establish a WebSocket connection and exchange messages with the Dart VM service during a paused flutter test run. The feedback suggests utilizing SystemInfo.isWindows from the IntelliJ Platform SDK for OS checks and refactoring the SDK home resolution in Kotlin to prefer immutable val over mutable var declarations.

Comment thread testSrc/integration/io/flutter/integrationTest/vmService/VmServiceTest.kt Outdated
Comment thread testSrc/integration/io/flutter/integrationTest/vmService/VmServiceTest.kt Outdated
Update findFlutterSdkHome to use val
Comment thread build.gradle.kts
maxHeapSize = "4g"

systemProperty("path.to.build.plugin", buildPlugin.get().archiveFile.get().asFile.absolutePath)
systemProperty("idea.home.path", providers.provider {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this break the tests? Do you know why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intellijPlatformTesting.testIde.register("integration") provides the value for "idea.home.path". So it's not needed.

@helin24
helin24 merged commit 3085afc into flutter:main Jul 28, 2026
13 checks passed
@helin24

helin24 commented Jul 28, 2026

Copy link
Copy Markdown
Member

CC @pq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants