-
Notifications
You must be signed in to change notification settings - Fork 15
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
Implement test engine #76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Several comments and change requests.
src/main/java/io/camunda/zeebe/bpmnassert/testengine/EngineFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/io/camunda/zeebe/bpmnassert/testengine/EngineFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/io/camunda/zeebe/bpmnassert/testengine/EngineFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/io/camunda/zeebe/bpmnassert/testengine/EngineFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/io/camunda/zeebe/bpmnassert/testengine/ZeebeEngineImpl.java
Outdated
Show resolved
Hide resolved
src/test/java/io/camunda/zeebe/bpmnassert/testengine/EngineClientTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/camunda/zeebe/bpmnassert/testengine/EngineClientTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/camunda/zeebe/bpmnassert/testengine/EngineClientTest.java
Show resolved
Hide resolved
src/test/java/io/camunda/zeebe/bpmnassert/testengine/PrintRecordStreamExtension.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pihme The changes look good!
I've added some comments. Please take a look at them once you have time.
src/main/java/io/camunda/zeebe/bpmnassert/testengine/IdleStateMonitor.java
Outdated
Show resolved
Hide resolved
src/main/java/io/camunda/zeebe/bpmnassert/testengine/ZeebeEngineImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/camunda/zeebe/bpmnassert/testengine/ZeebeEngineImpl.java
Outdated
Show resolved
Hide resolved
...a/io/camunda/zeebe/bpmnassert/testengine/db/InMemoryZeebeDbColumnFamilyIterationContext.java
Outdated
Show resolved
Hide resolved
src/test/java/io/camunda/zeebe/bpmnassert/testengine/db/InMemoryZeebeDbTransactionTest.java
Outdated
Show resolved
Hide resolved
src/main/java/io/camunda/zeebe/bpmnassert/testengine/db/InMemoryZeebeDbTransactionContext.java
Outdated
Show resolved
Hide resolved
src/test/java/io/camunda/zeebe/bpmnassert/testengine/db/InMemoryZeebeDbTransactionTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/camunda/zeebe/bpmnassert/testengine/db/InMemoryZeebeDbTransactionTest.java
Show resolved
Hide resolved
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
final class IdleStateMonitor implements LogStorage.CommitListener, StreamProcessorListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ We should write some unit tests for this logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the IdleStateMonitor
is not stable as it is now. I tried writing unit tests to verify the waiting for idle state works correctly, but they kept failing.
I propose we merge this PR first and have another look at this separate from this PR.
@remcowesterhoud Looked over all your comments. Feel free to change things. I will focus on medic duty this week and don't want to stall progress. |
@pihme I've processed all of the review comments. I've split them up by commit so it's easier to review them. If you find the time please have another look 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks a lot!
I have a couple of remaining changes.
Happy to look at it again, if you want. But you can also just merge it.
src/test/java/io/camunda/zeebe/bpmnassert/testengine/EngineClientTest.java
Outdated
Show resolved
Hide resolved
src/main/java/io/camunda/zeebe/bpmnassert/testengine/RecordStreamSourceImpl.java
Outdated
Show resolved
Hide resolved
if (lastPosition < 0) { | ||
logStreamReader.seekToFirstEvent(); | ||
} else { | ||
logStreamReader.seekToNextEvent(lastPosition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Does this work as expected when there is no event after last position?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't throw any errors or that sort of thing. It returns false
if there are no events after this position. This means logStreamReader.hasNext()
resolves to false
as well and the list of records doesn't get updated as there are no new records.
src/main/java/io/camunda/zeebe/bpmnassert/testengine/ZeebeEngineImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/camunda/zeebe/bpmnassert/testengine/PartitionCommandSenderImpl.java
Show resolved
Hide resolved
src/test/java/io/camunda/zeebe/bpmnassert/testengine/db/InMemoryZeebeDbTransactionTest.java
Show resolved
Hide resolved
1d5391f
to
bb32ec1
Compare
Description
EZE has been copied and translated into Java.
Still to do to entirely get rid of the EZE dependency:
ZeebeAssertionsExtension
so that it will take over the functionality of the@EmbeddedZeebeEngine
Related issues
closes #24
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
Testing:
Documentation: