* Unit testability for timers and reminders
Fixes: #575
This change adds abstractions for Actors timer and reminder
functionality, making them possible to unit test. Previously these
features were wired from the Actor class directly into the client
functionality, and there was no way for a user of actors to write their
own tests when they include this functionality in their code.
Making this work required a lot of munging of basic data types because
we need to *extract* a layer of functionality into a testable API.
I also added a helper method for tests to create an actor host with
mocks attached. We'll likely need to do more in the future to support
testability for actors. I started this process by adding some "unit
test" unit tests. The only way to test that you can test is by testing
:).
----
Additionally I added E2E tests for actors timers and reminders and
improved some of the existing test functionality.
The big investment here is to change the layering of tests to ensure
that we only need to start one instance of the test app at a time.
Previously we'd start and stop the test app as part of the only test we
have. Adding more tests means we want to avoid this overhead when
possible.
This is specifically a challenge for actors since the assocation of an
actor type to an app id is **global state**. We want to keep the app
process we're using for tests long-lived to avoid classic distributed
systems problems (like the host going away) inside our tests.
* Dedupe code for initializing defaults
This change introduces a better API for us to test the DaprClient or
other HttpClient based APIs.
This will resolve the flakiness problems that we're seeing with some of
the actors tests.
Fixes: #573Fixes: #588
Additionally fixed an issue where DaprHttpInteractor was misuing
HttpClientHandler. This would result in a new handler being created when
it isn't needed.
* Use protobuf packaging for the Any type
This pull request implements two converters which help with the type conversion between arbitrary types and the protobuf `Any` type. The C# protobuf library provides a mechanism to pack or unpack protobuf messages to `Any`. It provides the methods `Any.Pack` and `Any.Unpack` to serialize/deserialize messages based on `Google.Protobuf.IMessage`. For types that are not based on `Google.Protobuf.IMessage`, the existing JSON serialization/deserialization will be used.
I've also cleaned the existing codebase a little bit.
Fixes#268
* Fix suggested changes
* Include the appcallback.proto into the Dapr.Client package
To implement service invocation for a gRPC API, a user must implement the AppCallback service on the callee site. Currently this must be done by integrating the `appcallpack.proto` file as also the depending `common.proto` file into the gRPC service application. The `Dapr.Client` package contains already the same `common.proto` file to generate the client classes. This results in a CS0433 error, because the `Dapr.Client` package and the generated AppCallback service will contain a `Dapr.Client.Autogen.Grpc.v1` namespace with the exact same classes.
This pull requests integrates the `appcallpack.proto` into the client package. With this fix the user does not need to integrate the proto files by itself.
See: https://gitter.im/Dapr/community?at=5f14b7e98a9a0a08cbab5d53
* Remove specific names
* adding IDAprClient interface
* Adding DaprClientBuilder and adding methods for Publish
* updating the method name for publish
* Adding unit tests for publishevent api
* Removing individual clients for publish
* Renaming base class to DaprClient and implementation calss to DparClientGrpc
* Moving State api to grpc and adding helpers to unittest grpc calls.
* More DaprClient logic
* metadata, etag, options, etc are optional
* Revert "metadata, etag, options, etc are optional"
This reverts commit ea5dc12c5d.
* Default params, 2 new Try- methods, overload refactor for InvokeMethodAsync
* Move some classes/enums to different files. Documentation
* Code refactor and changing tests to use grpc
* Adding tests with state options
* Adding test for getting etag and state
* More refactoring and adding INvokeBinding test
* Fixing tests and tidying up things.
* Updating solutions for renamed project
* Updating projects for rename.
* Oneclient secret (#245)
* ADding Secret Apis
* Using Task for secret
* Format (#242)
* Updating samples.slm
* awaint the call to grpc in common method so that common error handling can be done there.
* Addressing review comments
* fixing test.sln
* updating prod.sln
* Addressing review comments from James.
* Add doc and example for method invocation on http app
* Updating arg validation.
* Updating example.
Co-authored-by: LM <lemai>
Co-authored-by: Carlos Mendible <cmendible@gmail.com>
* DRY up project settings
Moves repetative project settings into Directory.Build.props so they are
not duplicated so much. I'm adding 5-6 new projects when tests are
included, so it makes sense to try and commonize.
* Add .vscode/ to .gitignore
We really have the choice to either check in a standard set of vscode's
files (if that's something the team cares about) - or ignore them so
that it's not noisy for people that use the repo with VS Code.
The former requires more discussion and effort, so ignoring `.vscode/`
for now makes the most sense.
* Add project skeletons
Decoder-ring for projects:
Microsoft.Dapr.Client[.Test] - client and tests
Microsoft.Dapr.AspNetCore[.Test] ASP.NET Core integration and tests
Microsoft.Dapr.AspNetCore.IntegrationTest[.App] integration tests
RoutingSample - sample using route-to-code
ControllerSample - sample using controllers
* Add Microsoft.Dapr.Client
* Add Routing and Controller samples
* Add integration tests for MVC and routing
* Use ValueTask
* Different paradigm for services
* Fix client constructor
* Add readmes for samples
* Updating pipelin yaml to package aspnetcore packages