-
Notifications
You must be signed in to change notification settings - Fork 175
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
feat(#2374): Add suggestion to test processing elements #2375
feat(#2374): Add suggestion to test processing elements #2375
Conversation
Hello there 👋 |
Hello there 👋 |
…processing-elements
@tenthe do you have examples of tests or processors that use selector prefix or event schema? Are there any that use multiple prefixes? Trying to understand which processors require something extra for testing |
Hi @IsaakKrut, my suggestion would be that you try to write a test for another processor with this "new" API. I think the biggest challenge will be to handle all the different types of static properties that a user can enter to configure the processor. I think one or two more sample tests would help to get a better understanding of what the best solution should look like. Cheers, |
…ly-unit-test-processing-elements' into 2374-provide-a-framework-to-easily-unit-test-processing-elements # Conflicts: # streampipes-extensions/streampipes-processors-filters-jvm/src/test/java/org/apache/streampipes/processors/filters/jvm/processor/booleanfilter/TestBooleanFilterProcessor.java # streampipes-extensions/streampipes-processors-filters-jvm/src/test/java/org/apache/streampipes/processors/filters/jvm/processor/compose/TestComposeProcessor.java # streampipes-extensions/streampipes-processors-filters-jvm/src/test/java/org/apache/streampipes/processors/filters/jvm/processor/merge/TestMergeByTimeProcessor.java # streampipes-extensions/streampipes-processors-filters-jvm/src/test/java/org/apache/streampipes/processors/filters/jvm/processor/numericalfilter/NumericalFilterProcessorTest.java # streampipes-extensions/streampipes-processors-filters-jvm/src/test/java/org/apache/streampipes/processors/filters/jvm/processor/sdt/TestSwingingDoorTrendingFilterProcessor.java # streampipes-extensions/streampipes-processors-filters-jvm/src/test/java/org/apache/streampipes/processors/filters/jvm/processor/textfilter/TestTextFilterProcessor.java # streampipes-test-utils-executors/src/test/java/org/apache/streampipes/test/executors/ProcessingElementTestExecutor.java
Hi @tenthe @IsaakKrut, I would love to contribute to this effort. I have already migrated the classes stated in #2538 to JUnit 5, I am quite unclear on what needs to be done for my work to integrate into this effort. Thanks, |
Hi @pambrocio, Cheers, |
Hi @IsaakKrut, Is it possible for you to extract the @pambrocio, I suggest that we clean up this branch and then merge it into dev. Cheers, |
) { | ||
|
||
// initialize the extractor with the provided configuration of the user input | ||
var e = getProcessingElementParameterExtractor(processor, userConfiguration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var e = getProcessingElementParameterExtractor(processor, userConfiguration); | |
var extractor = getProcessingElementParameterExtractor(processor, userConfiguration); |
.getRaw() | ||
)); | ||
|
||
// vlaidate that the processor is stopped correctly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// vlaidate that the processor is stopped correctly | |
// validate that the processor is stopped correctly |
Purpose
The current pull request introduces a prototype for unit testing processing elements in the
streampipes-processors-filter-jvm
module, specifically for theNumericalFilterProcessor
.Proposal
Map<String, Object>
for user input andList<Map<String, Object>>
for events.ProcessingElementTestExecutor
, is suggested to execute the actual tests.Important
This PR is not final; its purpose is to showcase the testing functionality and initiate a discussion on testing options.
If you have any suggestions or opinions on the proposed approach, feel free to share them here.
Remarks
PR introduces (a) breaking change(s): no
PR introduces (a) deprecation(s): no