Skip to content
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

Enhancement: Include example/s on how one should component test a container utilising DAPR. #4089

Open
dgannon991 opened this issue Mar 24, 2024 · 2 comments
Labels
content/missing-information More information requested or needed

Comments

@dgannon991
Copy link

What content needs to be created or modified?
An example guide for how we can mock the DAPR sidecar/method calls in order to be able to component test a single container without having to spin up all downstream dependencies (in our case, a pub/sub queue, a database and a keyvault.) as this leans heavily towards integration testing at that point, and is something we were hoping DAPR would help us solve as an issue.

Describe the solution you'd like
A new section is added to the "Developing applications" tree which covers component testing, from the early stages of testing your first DAPR component, to examples of testing several inter-related DAPR components.

Additional context
Thanks for the chat at kubecon and the suggestion to raise this issue in response :)

@dgannon991 dgannon991 added the content/missing-information More information requested or needed label Mar 24, 2024
@hhunter-ms
Copy link
Collaborator

@dgannon991 I posted this issue in the components-contrib channel on Discord to see if I could get any help - Could you add some information on the goals of this docs issue? We do have developer documentation (readmes) that capture how to test everything, and often we'd just point users to the regular Dapr docs. How would the example guide capture what isn't already captured between the readmes and Dapr docs?

@dgannon991
Copy link
Author

Hi @hhunter-ms, I'd looked through the site at https://docs.dapr.io/ and the only hit I could find for testing was specific to the PHP SDK (https://docs.dapr.io/developing-applications/sdks/php/php-app/php-unit-testing/)

Basically we use a few DAPR methods in one of our code to talk to a database and an azure keyvault. When it comes to testing these things, the only way we've managed it so far is full scale integration testing (which is expensive and time consuming!) We'd hoped there was a better way that we were missing, such that we were only testing our code/logic, and not the fact that DARP is doing what it should. Does that make sense? (I worry it's gone a bit rambly, happy to clarify with some more concrete examples if that's helpful?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content/missing-information More information requested or needed
Projects
None yet
Development

No branches or pull requests

2 participants