Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Extend TCK with event-sourced model test #419

Merged
merged 2 commits into from
Sep 15, 2020
Merged

Conversation

pvlugter
Copy link
Member

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 #375 (comment) 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.

//
message RequestAction {
oneof action {
Emit emit = 1;
Copy link
Contributor

@marcellanz marcellanz Aug 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I've chosen separate service methods for synthetic (model) CRDT tests for which RequestActions are used here. As it increases the TCK model implementation for certain user languages and also you've chosen a this approach here, I'll change that to a "process" service method per CRDT type too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I thought this would be the easiest to implement, and especially since there are tests that want to have multiple actions. And hopefully also easier to change the tests without needing to change the implementation.

@pvlugter pvlugter merged commit ce6ea7a into cloudstateio:master Sep 15, 2020
@pvlugter pvlugter deleted the tck branch September 15, 2020 21:21
@pvlugter pvlugter mentioned this pull request Nov 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants