feat: add Dapr.IntegrationTest.DaprClient integration tests for HTTP and gRPC proxy invocation#1814
Draft
feat: add Dapr.IntegrationTest.DaprClient integration tests for HTTP and gRPC proxy invocation#1814
Conversation
…and gRPC proxy invocation Agent-Logs-Url: https://github.com/dapr/dotnet-sdk/sessions/d477244b-9f9b-439e-9c0a-791e2add786e Co-authored-by: WhitWaldo <2238529+WhitWaldo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dapr/dotnet-sdk/sessions/d477244b-9f9b-439e-9c0a-791e2add786e Co-authored-by: WhitWaldo <2238529+WhitWaldo@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
WhitWaldo
May 9, 2026 08:52
View session
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1814 +/- ##
==========================================
- Coverage 65.42% 65.34% -0.08%
==========================================
Files 296 297 +1
Lines 8694 8709 +15
Branches 1009 1010 +1
==========================================
+ Hits 5688 5691 +3
- Misses 2761 2774 +13
+ Partials 245 244 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Creates
Dapr.IntegrationTest.DaprClient— a new integration test project that covers the legacyDapr.Clientservice-invocation surface area against a real Dapr sidecar. This closes the gap identified in the previous analysis where HTTP service invocation and gRPC proxy tests existed only in the olderDapr.E2E.Testsuite (which runs against a locally-installeddaprCLI) and not yet in the modern container-basedDapr.IntegrationTest.*suite.Changes
src/Dapr.Testcontainers— library extensionsCommon/Options/DaprRuntimeOptions.csAppProtocolproperty (default"http") and validatedWithAppProtocol()fluent setterContainers/Dapr/DaprdContainer.csoptions.AppProtocolas-app-protocolon the daprd command lineHarnesses/BaseHarness.cspublic string AppIdso tests can discover the auto-generated app-id for routingHarnesses/ServiceInvocationHarness.cs(new)Common/DaprHarnessBuilder.csBuildServiceInvocation()factory methodtest/Dapr.IntegrationTest.DaprClient— new test projectAuto-discovered by CI via the
Dapr.IntegrationTest.*.csprojglob. Builds on net8.0 / net9.0 / net10.0.Dapr.IntegrationTest.DaprClient.csprojProtos/echo.protoEchoService(unary, bidirectional streaming, slow-echo)GrpcServices/EchoServiceImpl.csServiceInvocation/HttpServiceInvocationTests.csCreateInvokeHttpClient,CreateInvokableHttpClient, and threeInvokeMethodAsyncoverloadsServiceInvocation/GrpcProxyInvocationTests.csTest coverage added
HTTP service invocation (
HttpServiceInvocationTests)CreateInvokeHttpClient— POST with typed payload; GET requestCreateInvokableHttpClient(instance method) — relative URI routed through sidecarInvokeMethodAsync<TRequest, TResponse>— typed request + typed responseInvokeMethodAsync<TResponse>— no request body, typed responseInvokeMethodAsync<TRequest>— typed request, void (204) responsegRPC proxy invocation (
GrpcProxyInvocationTests)RpcExceptionwithStatusCode.DeadlineExceededHow it works
Each test spins up its own
ServiceInvocationHarnessviaDaprHarnessBuilder. For HTTP tests the harness uses the default--app-protocol http; for gRPC proxy testsWithOptions(new DaprRuntimeOptions().WithAppProtocol("grpc"))is passed so daprd uses gRPC to talk to the in-process Kestrel server (configured for HTTP/2 cleartext). No external infrastructure (Redis, RabbitMQ, etc.) is needed.Notes
[Obsolete]attribute on test methods is the standard pattern in this repo for suppressing CS0618 when testing deprecated APIs (matchesDaprClientTest.InvokeMethodAsync.csetc.)Dapr.E2E.Testservice-invocation tests are left untouched for now; they can be retired once this suite is stable in CI