You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by Florian Micklich <mi...@apache.org> on 2022/12/22 10:36:05 UTC

unit tests in processor elements?

Hi all,

just want to update myself about unit test in the processors elemets.
Do we write them, in a specific way / structure and are the test implemented in the ci build later on?

So a quick overview / best practise / workflow would be good.
I can summarise it in the wiki later on.

Thanks
Florian

AW: unit tests in processor elements?

Posted by Philipp Zehnder <ph...@bytefabrik.ai>.
Hi Florian,

thank you very much for this comment. So far there is no structured method for unit tests of processors.
A few weeks ago we discussed a similar topic where we talked about integration tests.
There Zike provided a good description [1] for the different types of tests. It would be great to document this on the wiki as well.

For processors, I would suggest using unit tests, since most of them have no external dependencies on other services.
Currently, we only have e2e tests for them (see [2]). They are great to see if the processor works as expected when used in the pipeline editor, but they are not good for testing all configuration options.

Since we don't have a good testing strategy for processors yet, I would suggest that we implement a first example for a rather simple processor (e.g. numeric filter [3]) and discuss it. In particular, the 'onEvent' method should be tested to see if the processor works. If you are interested, you can provide a first example and we can discuss it.

Once we know how to best test processors, we can describe this on the wiki as well.
All unit tests should run during the build step, to ensure everything still works as expected.

Cheers,
Philipp

[1] https://lists.apache.org/thread/z5123ctrkv70jgy75sk1ly7tmjc37cdc
[2] https://github.com/apache/streampipes/tree/dev/ui/cypress/fixtures/pipelineElement/filters-jvm/numericalFilter1
[3] https://github.com/apache/streampipes/tree/dev/streampipes-extensions/streampipes-processors-filters-jvm/src/main/java/org/apache/streampipes/processors/filters/jvm/processor/numericalfilter

Von: Florian Micklich <mi...@apache.org>
Datum: Donnerstag, 22. Dezember 2022 um 11:36
An: StreanPipes Dev <de...@streampipes.apache.org>
Betreff: unit tests in processor elements?
Hi all,

just want to update myself about unit test in the processors elemets.
Do we write them, in a specific way / structure and are the test implemented in the ci build later on?

So a quick overview / best practise / workflow would be good.
I can summarise it in the wiki later on.

Thanks
Florian