Skip to content

Add Gradle test event streaming protocol#1819

Open
wenytang-ms wants to merge 3 commits intodevelopfrom
wenyt/gta-test-events-protocol
Open

Add Gradle test event streaming protocol#1819
wenytang-ms wants to merge 3 commits intodevelopfrom
wenyt/gta-test-events-protocol

Conversation

@wenytang-ms
Copy link
Copy Markdown
Contributor

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.

  • Add an opt-in stream_test_events flag to RunBuildRequest.
  • Add GradleTestEvent to RunBuildReply for started/succeeded/failed/skipped/output events.
  • Register Gradle Tooling API OperationType.TEST only when test event streaming is requested.
  • Convert Gradle test progress/output events into normalized gRPC test events.
  • Add a TaskServerClient.runBuild callback hook for future extension-side consumers.
  • Cover opt-in test event streaming in GradleServerTest.

Validation

  • ./gradlew.bat :extension:copyProtoJs :extension:copyProtoTs :gradle-server:test --quiet
  • npm --prefix extension run compile:test -- --pretty false
  • npm --prefix extension run lint:eslint -- --quiet
  • ./gradlew.bat :gradle-server:spotlessCheck --quiet
  • npx prettier --check src/client/TaskServerClient.ts

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
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines
Copy link
Copy Markdown

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
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_events on RunBuildRequest and a new GradleTestEvent variant on RunBuildReply.
  • Updated the Gradle server to register OperationType.TEST only when requested and to convert Tooling API test events into GradleTestEvent replies.
  • Added an optional onTestEvent callback hook to the extension TaskServerClient.runBuild and 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.

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