-
Notifications
You must be signed in to change notification settings - Fork 225
Add gRPC support to Dapr testcontainer #1586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Hi @wlfgang thanks for this pull request, you need to sign-off your commit. |
Signed-off-by: wlfgang <[email protected]>
2c7e916 to
e782e6b
Compare
Thanks @mcruzdev -- I've added the DCO to the commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done! Thanks a lot for your contribution @wlfgang!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1586 +/- ##
============================================
+ Coverage 76.91% 78.53% +1.62%
- Complexity 1592 1936 +344
============================================
Files 145 216 +71
Lines 4843 5871 +1028
Branches 562 659 +97
============================================
+ Hits 3725 4611 +886
- Misses 821 923 +102
- Partials 297 337 +40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@dapr/maintainers-java-sdk and @dapr/approvers-java-sdk let me know if you have any concerns merging this PR. |
| try (DaprContainer daprContainer = new DaprContainer(DAPR_RUNTIME_IMAGE_TAG) | ||
| .withAppName("dapr-app")) { | ||
| daprContainer.configure(); | ||
| assertNull(daprContainer.getAppPort()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wlfgang I think for backward compatibility and to make it easier for the user configuring the DaprContainer, HTTP should be still the default, hence if nothing is set you still get HTTP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@salaboy I agree completely, and this is still true; HTTP will be used by default if the user doesn't call the method. For withAppProtocol I mirrored the existing implementation of withAppPort - if you don't call these methods, their fields won't be assigned, and the --app-port and --app-protocol arguments won't be specified to dapr.
If you like, I can change it to initialize appProtocol rather than relying on a null, which may be considered better practice, and the behavior would remain the same.
Description
Added a simple
withAppProtocolmethod to the DaprContainer test container which allows the user to specify--app-protocoleitherHTTPorGRPC, allowing projects to exercise gRPC services from integration tests.Issue reference
This will close #1578
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:
Let me know if there's documentation that should be updated, I can add that.