cloudstateio / cloudstate

Distributed State Management for Serverless
https://cloudstate.io
Apache License 2.0
763 stars 97 forks source link

Extend TCK with event-sourced model test #419

Closed pvlugter closed 4 years ago

pvlugter commented 4 years ago

First step in evolving the TCK, #316.

Moves the testing infrastructure for the TCK to the common testkit, and updates it to use a send/expect style (and closer to the generic testkit that we've discussed).

Adds a model test for event-sourced entities. This model test requires implementing simple event-sourced entities, where the tests send actions to take (emitting events, forwarding, side effects, failing). The TCK determines which tests to run based on which entities/services have been implemented — marking unimplemented tests as pending.

The event-sourced model test has only been implemented for Java support so far. This uncovered one small bug, where side effects were not actually being recorded. I want to look at fixing https://github.com/cloudstateio/cloudstate/issues/375#issuecomment-672336020 and updating the TCK tests to reflect these changes — currently have FIXMEs where the updated state should be returned — before implementing the new tests for other language supports. And then add a state model test for CRDT entities as well.

Event-sourced tests also cover verifying passivation on the language support side (#359) by testing the event-sourced entity protocol directly.