Add DurableStateStore TCK to persistence-tck module#2833
Draft
pjfanning wants to merge 2 commits intoapache:mainfrom
Draft
Add DurableStateStore TCK to persistence-tck module#2833pjfanning wants to merge 2 commits intoapache:mainfrom
pjfanning wants to merge 2 commits intoapache:mainfrom
Conversation
Agent-Logs-Url: https://github.com/pjfanning/incubator-pekko/sessions/77803e79-3631-4111-98a8-4a1cf6f7beca Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
See #2831
Adds a standardised Technology Compatibility Kit (TCK) for
DurableStateStoreimplementations to thepersistence-tckmodule. This allows plugin authors (such as those working onpekko-persistence-jdbc,pekko-persistence-r2dbc, andpekko-persistence-cassandra) to include a consistent test suite in their projects.Changes
persistence-tck/src/main/scala/org/apache/pekko/persistence/CapabilityFlags.scalaDurableStateStoreCapabilityFlagstrait with asupportsDeleteWithRevisionCheckcapability flag, following the same pattern asJournalCapabilityFlagsandSnapshotStoreCapabilityFlags.persistence-tck/src/main/scala/org/apache/pekko/persistence/state/DurableStateStoreSpec.scala(new)Scala TCK spec that plugin authors extend. Tests:
getObjecton a non-existing persistence ID returnsNoneupsertObjectfollowed bygetObjectreturns the stored value and correct revisiondeleteObject(persistenceId, revision)makes the state unavailablesupportsDeleteWithRevisionCheck): deleting with a mismatched revision fails and leaves the original state intactpersistence-tck/src/main/scala/org/apache/pekko/persistence/japi/state/JavaDurableStateStoreSpec.scala(new)Java/JUnit-consumable wrapper around
DurableStateStoreSpec, following the same pattern asJavaJournalSpecandJavaSnapshotStoreSpec.persistence-testkit/src/test/scala/…/PersistenceTestKitDurableStateStoreTCKSpec.scala(new)Reference test implementation that exercises the new TCK using the existing in-memory
PersistenceTestKitDurableStateStore, verifying the TCK itself works correctly.Usage by plugin authors
Agent-Logs-Url: https://github.com/pjfanning/incubator-pekko/sessions/77803e79-3631-4111-98a8-4a1cf6f7beca