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

Add QA tests that verify CreateProcessInstanceWithResult responses #11993

Merged
merged 3 commits into from
Mar 20, 2023

Conversation

korthout
Copy link
Member

@korthout korthout commented Mar 10, 2023

Description

These two cases failed recently due to a bug introduced with batch processing [1].

As this affected behavior visible to users, it makes sense to introduce QA integration tests that showcase that the CreateProcessInstanceWithResult can actually respond when the process instance is completed by another user command.

Related issues

relates to #11848

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.

Other teams:
If the change impacts another team an issue has been created for this team, explaining what they need to do to support this change.

Please refer to our review guidelines.

These two cases failed recently due to a bug introduced with batch
processing [1].

The situation happened because multiple commands were being processed
and responded in the same batch, while the batch processing assumed only
a single response would be writen.

As this affected behavior visible to users, it makes sense to introduce
qa integration tests that show case that the
CreateProcessInstanceWithResult can actually respond when the process
instance is completed by another user command:
- complete job
- publish mesage

See:
 [1] #11848
@korthout korthout marked this pull request as ready for review March 10, 2023 15:42
@korthout
Copy link
Member Author

korthout commented Mar 10, 2023

Hi @berkaycanbc. There is no issue tracking this pull request, as the related issue is already closed when the bug was fixed. But, I still think it makes sense to add these test cases. Can you take a look when you have time?

Let me know if you have any questions, or if you want to have a look at them together.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2023

Test Results

1 015 files  +  1  1 015 suites  +1   1h 52m 15s ⏱️ - 4m 14s
8 049 tests  - 86  8 039 ✔️  - 86  10 💤 ±0  0 ±0 
8 255 runs   - 86  8 245 ✔️  - 86  10 💤 ±0  0 ±0 

Results for commit 892135a. ± Comparison against base commit 6c36841.

This pull request removes 699 and adds 613 tests. Note that renamed tests count towards both.
DmnEvaluationTest If successfully evaluated, the output ‑ Should return a message pack output[6] value={z=[1, 2, 3], y=true, x=1}
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[56] collection=[Left[[B@1d3e5c4f]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[57] collection=[Right[[B@1d3e5c4f], Left[[B@1d3e5c4f]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[58] collection=[Left[[B@1d3e5c4f], Right[[B@1d3e5c4f]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[59] collection=[Left[[B@1d3e5c4f], Left[[B@1d3e5c4f]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[60] collection=[Right[[B@1d3e5c4f], Right[[B@1d3e5c4f], Left[[B@1d3e5c4f]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[61] collection=[Right[[B@1d3e5c4f], Left[[B@1d3e5c4f], Right[[B@1d3e5c4f]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[62] collection=[Right[[B@1d3e5c4f], Left[[B@1d3e5c4f], Left[[B@1d3e5c4f]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[63] collection=[Left[[B@1d3e5c4f], Right[[B@1d3e5c4f], Right[[B@1d3e5c4f]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[64] collection=[Left[[B@1d3e5c4f], Right[[B@1d3e5c4f], Left[[B@1d3e5c4f]]
…
DmnEvaluationTest If successfully evaluated, the output ‑ Should return a message pack output[6] value={y=true, z=[1, 2, 3], x=1}
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[56] collection=[Left[[B@5632b1e2]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[57] collection=[Right[[B@5632b1e2], Left[[B@5632b1e2]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[58] collection=[Left[[B@5632b1e2], Right[[B@5632b1e2]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[59] collection=[Left[[B@5632b1e2], Left[[B@5632b1e2]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[60] collection=[Right[[B@5632b1e2], Right[[B@5632b1e2], Left[[B@5632b1e2]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[61] collection=[Right[[B@5632b1e2], Left[[B@5632b1e2], Right[[B@5632b1e2]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[62] collection=[Right[[B@5632b1e2], Left[[B@5632b1e2], Left[[B@5632b1e2]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[63] collection=[Left[[B@5632b1e2], Right[[B@5632b1e2], Right[[B@5632b1e2]]
EitherTest Streams of Eithers can be collected using .collector() ‑ Only Streams with Lefts are collected into a Left[64] collection=[Left[[B@5632b1e2], Right[[B@5632b1e2], Left[[B@5632b1e2]]
…

♻️ This comment has been updated with latest results.

Copy link
Contributor

@berkaycanbc berkaycanbc left a comment

Choose a reason for hiding this comment

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

@korthout

I also observed that previous related PR has tests that only cover general use case. Really nice that you added tests for actual cases that are observed by users. 🚀

❓ One additional question: do we have other cases where we can complete create process instance command? If so, it might be good to add test cases for them as well.

Approving it as I expect these are all the cases available.

I had not seen this before, but the BrokerClassRuleHelper is used in our
QA tests which provides some nice helper methods, like
`.getBpmnProcessId()` which provides a unique process id for each test
case. This helps isolate the tests a bit more.
This adds test cases for each of the ways that a user can complete the
process instance that the user is awaiting a result for, except for
those added previously (complete job and publish message).

Note that the CreateProcessInstanceWithResult RPC explicitly only
responds when the process instance **completes**. So we do not have to
add test cases where the process instance **terminates**.
@korthout
Copy link
Member Author

do we have other cases where we can complete create process instance command?

👍 To be honest, I hadn't given much thought to this until I read this review comment. As a result, I added 892135a. Thanks for this great review hint! 🚀

@berkaycanbc Can you have another look?

Copy link
Contributor

@berkaycanbc berkaycanbc left a comment

Choose a reason for hiding this comment

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

@korthout Really nice that we covered all cases to complete a process! 🚀

Also, these test cases were clear references for me to see possible ways to complete a process. Thanks!

@korthout
Copy link
Member Author

bors merge

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@backport-action
Copy link
Collaborator

Successfully created backport PR for stable/8.0:

@backport-action
Copy link
Collaborator

Successfully created backport PR for stable/8.1:

zeebe-bors-camunda bot added a commit that referenced this pull request Mar 20, 2023
12072: [Backport stable/8.0] Add QA tests that verify CreateProcessInstanceWithResult responses r=korthout a=backport-action

# Description
Backport of #11993 to `stable/8.0`.

relates to #11848

Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
zeebe-bors-camunda bot added a commit that referenced this pull request Mar 20, 2023
12073: [Backport stable/8.1] Add QA tests that verify CreateProcessInstanceWithResult responses r=korthout a=backport-action

# Description
Backport of #11993 to `stable/8.1`.

relates to #11848

Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
zeebe-bors-camunda bot added a commit that referenced this pull request Mar 21, 2023
12073: [Backport stable/8.1] Add QA tests that verify CreateProcessInstanceWithResult responses r=korthout a=backport-action

# Description
Backport of #11993 to `stable/8.1`.

relates to #11848

Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
zeebe-bors-camunda bot added a commit that referenced this pull request Mar 21, 2023
12072: [Backport stable/8.0] Add QA tests that verify CreateProcessInstanceWithResult responses r=korthout a=backport-action

# Description
Backport of #11993 to `stable/8.0`.

relates to #11848

Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
@npepinpe npepinpe added version:8.1.10 Marks an issue as being completely or in parts released in 8.1.10 release/8.0.13 labels Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version:8.1.10 Marks an issue as being completely or in parts released in 8.1.10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants