-
Notifications
You must be signed in to change notification settings - Fork 21
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
Use dapr sidekick with an integration test #51
Comments
Hi can you please upload a test solution demonstrating the issue? |
I've uploaded a sample here https://github.com/BartNetJS/dapr-sidekick-sample |
The main reason why your integration test is not working is due to the fact that WebApplicationFactory (TestServer) is not creating a real network socket. The HttpClient that WebApplicationFactory provides does not do actual networking. I have been able to work around this by starting a proxy server (e.g. AspNetCore.Proxy) in the startup phase of the integration test. This proxy is listening to a real network port and routes all http calls to the HttpClient associated with the WebApplicationFactory.
|
Hallo. Thank you for the information about this! |
I try to use the dapr sidekick with an integration test (Using Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory).
I can see in the output log:
[18:13:31 INF] Host application is initializing, waiting to start Dapr process...
[18:13:31 INF] Host application ready, starting Dapr process
[18:13:32 INF] AppId not specified, assigning default value: core-api
[18:13:32 INF] Dapr expected process name set to daprd
[18:13:32 INF] Dapr initial directory: C:\Users[myname].dapr
[18:13:32 INF] Dapr runtime directory: C:\Users[myname].dapr
[18:13:32 INF] Dapr process binary: C:\Users[myname].dapr\bin\daprd.exe
[18:13:32 INF] Dapr Process Status Change: Initializing -> Starting
[18:13:32 INF] Environment variable DAPR_GRPC_PORT set to 50002
[18:13:32 INF] Environment variable DAPR_HTTP_PORT set to 3501
[18:13:32 INF] Starting Process C:\Users[myname].dapr\bin\daprd.exe with arguments '--app-id core-api --app-port 5088 --dapr-grpc-port 50002 --dapr-http-port 3501 --log-as-json --log-level debug --metrics-port 9090 --placement-host-address 127.0.0.1:6050 --config C:\Users[myname].dapr\config.yaml --components-path C:\Users[myname].dapr\components'
[18:13:32 INF] Process daprd PID:48396 started successfully
[18:13:33 INF] starting Dapr Runtime -- version 1.10.2 -- commit d02fb79c051f8d7d45097d5eb06b3153ce4a3a24
[18:13:33 INF] log level set to: debug
[18:13:33 INF] metrics server started on :9090/
[18:13:33 INF] Resiliency configuration loaded.
[18:13:33 INF] standalone mode configured
The text was updated successfully, but these errors were encountered: