How to test actual workflow execution #194
-
Hello, We have a CI/CD pipeline to manage workflow definitions (.bpmn). The micro-services which are part of a workflow process have their own CI/CD pipelines. Question - what are the options for testing the workflows end-to-end? Eg- deploy the workflow to Zeebe, start process instance so it interacts with actual micro-services and ensure the execution succeeds. Doing all this in a CI/CD pipeline. Another question is what is the use case for zeebe-test-container ? when would we want to use it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi ankit,
In the meantime, there are some community projects which provide lightweight alternatives for unit testing your workflows. See https://github.com/camunda-community-hub/eze. That said, you can test your processes with Verification would be ensuring your workers are called with the expected input, that a message triggers the right event, etc. But as mentioned, you won't have very fine grained control. The use case of the library is then more about integration testing and/or end-to-end testing. While you should always unit test your worker code, and in the future unit test the process definition itself, you will still need integration tests that check the workers are orchestrated together properly. You won't have fine grained control to test all possible failure paths of course, but it should still give you increased confidence by testing the general cases. The library is also often used by exporter authors, or by those building application based on the exported stream (e.g. Operate, Tasklist, Zeeqs, etc.), again for the integration tests. You don't test every single thing at that level, but you do want some basic tests to make sure it works against a real Zeebe, which is what the library provides. |
Beta Was this translation helpful? Give feedback.
-
A short update, you can now use this project in combination with zeebe-process-test. See the README for more on how to do this. That said, in most cases you should just use
|
Beta Was this translation helpful? Give feedback.
Hi ankit,
zeebe-test-container
is a library mostly for integration testing. Ideally, you would unit test the logic of your processes with something likecamunda-bpm-assert
. I understand there's nothing right now like that in the Zeebe ecosystem, but we are working on an upcoming library for this targeting Q2 next year: see https://github.com/camunda-cloud/camunda-cloud-testing/.In the meantime, there are some community projects which provide lightweight alternatives for unit testing your workflows. See https://github.com/camunda-community-hub/eze.
That said, you can test your processes with
zeebe-test-container
, but as with most integration tests, you won't have fine grained control. If …