Skip to content
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

Migrate the replay mode test #10879

Merged
merged 10 commits into from
Nov 3, 2022
Merged

Migrate the replay mode test #10879

merged 10 commits into from
Nov 3, 2022

Conversation

Zelldon
Copy link
Member

@Zelldon Zelldon commented Nov 1, 2022

Description

❌ blocked by #10876

Migrates the StreamProcessorReplayModeTest to JUNIT 5 and uses StreamPlatform extension. The new test is called StreamProcessorContinouslyReplayModeTest.java

Similar to #10876 the test execution has been improved. Some additional improvements have been made to verify whether the state is restored and contains the last processed position etc.

OLD NEW
old new

One test has been removed since it is already tested in another class and one has been removed since the test doesn't make sense like that.

Related issues

related #10455

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Please refer to our review guidelines.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2022

Test Results

   950 files   -     1     950 suites   - 1   1h 44m 59s ⏱️ + 1m 15s
7 586 tests  - 250  7 579 ✔️  - 250  7 💤 ±0  0 ±0 
7 784 runs   - 250  7 775 ✔️  - 250  9 💤 ±0  0 ±0 

Results for commit bf507a5. ± Comparison against base commit 858ee74.

♻️ This comment has been updated with latest results.

Rename NewStreamProcessorReplayModeTest to StreamProcessorContinouslyReplayModeTest to make more clear what the test contains and does.
Allow to reset the log context, useful for restart/restore tests.
Allow to set the processing mode.
Migrate new tests:

 * shouldReplayContinuously
 * shouldReplayIfNoEventsAfterSnapshot (mark as regression test)
This test is already part of StreamProcessorReplayTest
Migrates the StreamProcessorReplayModeTest to JUNIT 5 and the StreamPlatform extension. New test is called StreamProcessorContinouslyReplayModeTest.java
.

The test execution is reduced and the tests have been rewriten and improved
Add a new start method, instead of setting the process mode separately before starting the processor
@Zelldon Zelldon requested review from npepinpe and removed request for a team November 2, 2022 10:53
@Zelldon
Copy link
Member Author

Zelldon commented Nov 3, 2022

@npepinpe I have rebased this PR please have a look.

Copy link
Member

@npepinpe npepinpe left a comment

Choose a reason for hiding this comment

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

👍 👍

Comment on lines +42 to +43
@SuppressWarnings("unused") // injected by the extension
private StreamPlatform streamPlatform;
Copy link
Member

Choose a reason for hiding this comment

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

💭 If we ever wanted to get rid of this warning, there is another way of injecting fields which is using a constructor parameter resolver. It's a more flexible way (if more verbose) to inject stuff, since you can either scope it to the instance lifecycle (via constructors) or to single tests. Just a thought 🤷 This is what I usually favor, but I wouldn't say there's very strong arguments for it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah lets leave it for now like this. If we have a strong opinion for one or the other then lets change it everywhere so it is consistent.

@Zelldon
Copy link
Member Author

Zelldon commented Nov 3, 2022

bors r+

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 0990e91 into main Nov 3, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the zell-replay-mode-test branch November 3, 2022 13:26
zeebe-bors-camunda bot added a commit that referenced this pull request Nov 4, 2022
10894: Remove StreamProcessorReprocessingTest r=Zelldon a=Zelldon

## Description

:x: blocked by #10879
<!-- Please explain the changes you made here. -->

Deletes test and verifies for each test method, whether we already have an replacement.

## Related issues

<!-- Which issues are closed by this PR or are related -->

related to #10455 



Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants