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

Dedicated example #399

Merged
merged 10 commits into from
Jun 16, 2022
Merged

Dedicated example #399

merged 10 commits into from
Jun 16, 2022

Conversation

pihme
Copy link
Contributor

@pihme pihme commented Jun 14, 2022

Background

Initially we wanted to use our own tests also as examples to avoid duplicating code. However, our own tests are not ideal as examples:

  • They are implemented once and then run against different test engine implementations in different versions, which is hard to understand, and also not necessary to understand by users
  • They include logic that is based on interpreting the log records returned by the engine. This is common in our tests, but not how we recommend users to write their tests
  • They are exhaustive, but often only include a single assertion

We also have a more complex tests, which uses different assertions in combination. But this test was hard to find among all the other files and also suffered from aforementioned problems.

Change

This PR

  • introduces a new module examples and advertises it in the readme
  • Moved the complex test into that new module so that it stands out more
  • Inlined code so that the test is only a single file
  • Added comments to explain details in the test which are less obvious
  • Rewrote those parts of the code that used exported records to only use Zeebe Client API commands

Related issues

closes #367

Definition of Done

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix

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

Documentation:

  • Javadoc has been written
  • The documentation is updated

@github-actions
Copy link

github-actions bot commented Jun 14, 2022

Unit Test Results

  47 files    47 suites   1m 37s ⏱️
107 tests 107 ✔️ 0 💤 0
340 runs  340 ✔️ 0 💤 0

Results for commit 4583307.

♻️ This comment has been updated with latest results.

@pihme pihme force-pushed the 367-module-for-examples branch from 2b178fb to c5c6581 Compare June 14, 2022 13:13
@pihme pihme force-pushed the 367-module-for-examples branch from 25ed766 to 2b6ee1b Compare June 14, 2022 15:23
pihme added 2 commits June 15, 2022 14:27
The logic to activate a service task was rewritten to use only the Zeebe client API. This makes more sense to a user then interpreting exported records.
The logic to activate a user task was rewritten to use only the Zeebe client API. This makes more sense to a user than interpreting exported records.
@pihme pihme changed the title 367 module for examples Dedicated example Jun 15, 2022
@pihme pihme force-pushed the 367-module-for-examples branch from 7bb56a0 to 4583307 Compare June 15, 2022 13:02
@pihme pihme marked this pull request as ready for review June 15, 2022 13:07
@pihme pihme requested a review from saig0 June 15, 2022 13:08
Copy link
Member

@saig0 saig0 left a comment

Choose a reason for hiding this comment

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

@pihme I like it 👍 Good job 🎉

@pihme pihme merged commit 623e553 into main Jun 16, 2022
@pihme pihme deleted the 367-module-for-examples branch June 16, 2022 09:26
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.

Examples are hard to understand
2 participants