Add Gradle test event streaming protocol#1819
Open
wenytang-ms wants to merge 3 commits intodevelopfrom
Open
Conversation
Add an opt-in runBuild protocol flag for Gradle Tooling API test events and stream normalized test events from the Gradle server. Wire the extension client to request and receive the events without changing existing build behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Use a per-handler response lock instead of a global RunBuildHandler lock, include Gradle failure details in failed test events, and make descriptor path construction iterative. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in gRPC protocol and server/client plumbing to stream Gradle Tooling API test events during delegated Gradle builds, without changing default execution behavior.
Changes:
- Extended the gRPC API with
stream_test_eventsonRunBuildRequestand a newGradleTestEventvariant onRunBuildReply. - Updated the Gradle server to register
OperationType.TESTonly when requested and to convert Tooling API test events intoGradleTestEventreplies. - Added an optional
onTestEventcallback hook to the extensionTaskServerClient.runBuildand added server-side tests covering the opt-in behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| proto/gradle.proto | Adds the opt-in request flag and the GradleTestEvent message/stream reply variant. |
| gradle-server/src/main/java/com/github/badsyntax/gradle/handlers/RunBuildHandler.java | Routes test progress/output events into RunBuildReply.test_event and synchronizes response writes per request. |
| gradle-server/src/main/java/com/github/badsyntax/gradle/GradleBuildRunner.java | Conditionally registers OperationType.TEST based on the new opt-in flag. |
| gradle-server/src/test/java/com/github/badsyntax/gradle/GradleServerTest.java | Adds unit tests verifying OperationType.TEST registration and failure message propagation. |
| extension/src/client/TaskServerClient.ts | Adds optional onTestEvent callback and sets stream_test_events accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is PR 1 for #1817. It adds the protocol and server-side groundwork for a Gradle Tooling API test event stream without changing the current delegated test execution path.
stream_test_eventsflag toRunBuildRequest.GradleTestEventtoRunBuildReplyfor started/succeeded/failed/skipped/output events.OperationType.TESTonly when test event streaming is requested.TaskServerClient.runBuildcallback hook for future extension-side consumers.GradleServerTest.Validation
./gradlew.bat :extension:copyProtoJs :extension:copyProtoTs :gradle-server:test --quietnpm --prefix extension run compile:test -- --pretty falsenpm --prefix extension run lint:eslint -- --quiet./gradlew.bat :gradle-server:spotlessCheck --quietnpx prettier --check src/client/TaskServerClient.ts