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

Implement unit tests for pipeline element 'BooleanFilterProcessor' #1891

Closed
Tracked by #1884
bossenti opened this issue Sep 9, 2023 · 5 comments · Fixed by #2022
Closed
Tracked by #1884

Implement unit tests for pipeline element 'BooleanFilterProcessor' #1891

bossenti opened this issue Sep 9, 2023 · 5 comments · Fixed by #2022
Assignees
Labels
good first issue Good for newcomers hacktoberfest Indicates an issue for hacktoberfest event 2023. testing Relates to any kind of test (unit test, integration, or E2E test).

Comments

@bossenti
Copy link
Contributor

bossenti commented Sep 9, 2023

This issue is about implementing unit tests for our pipeline element BooleanFilterProcessor.
An example of how to write unit tests for pipeline elements can be found here.

Mentoring

As this issue is marked as a good first issue and for the hacktoberfest event: one of @dominikriemer, @tenthe, @RobertIndie, or @bossenti are happy to provide help for getting started, just tag (one of) them if you want to start working on this issue and need some help.

@bossenti bossenti changed the title BooleanFilterProcessor Implement unit tests for pipeline element 'BooleanFilterProcessor' Sep 9, 2023
@bossenti bossenti added good first issue Good for newcomers testing Relates to any kind of test (unit test, integration, or E2E test). hacktoberfest Indicates an issue for hacktoberfest event 2023. labels Sep 9, 2023
@muyangye
Copy link
Member

muyangye commented Oct 2, 2023

Can someone please assign this issue to me? I know I am not a first time contributor but I have never worked on unit test before. I believe this will give me a more well-rounded understanding of the project. Thanks!

@bossenti
Copy link
Contributor Author

bossenti commented Oct 3, 2023

Awesome, @muyangye!
good first issues are not intended to be exclusive for first-time contributors but are especially appropriate 🙂
So feel always free to catch them

@muyangye
Copy link
Member

Hi I have pushed a PR that unit tests BooleanFilterProcessor. 2 quick concerns I have:

  • Does the directory structure seem good? Since no one has written any unit tests for module streampipes-processors-filters-jvm yet, I followed the directory structure convention of module streampipes-processors-transformation-jvm and created some new packages. I am not sure so please let me know the correct directory structure.
  • In order to test all filter processors, one needs to be able to tell the number of events being filtered. However, because SpOutputCollector is just an interface, one must define a class that implements the interface so that he can get the number of events. I followed the class in this test and I think other developers implementing unit tests for filter processors will probably do the same. Do you think it's a good idea to extract this class to make it commonly usable?

@bossenti
Copy link
Contributor Author

Thanks for your contribution @muyangye

I am not sure so please let me know the correct directory structure.

The structure you have created is totally fine and exactly what I would have expected

Do you think it's a good idea to extract this class to make it commonly usable?

Yes, this would be great! How about putting it into streampipes-test-utils creating a package called org.apache.streampipes.test.extensions.api? (cc @dominikriemer)

@muyangye
Copy link
Member

Thanks for the suggestion @bossenti! I just pushed an update that:

  • Created the new package
  • Refactored TestChangedValueDetectionProcessor

bossenti pushed a commit that referenced this issue Oct 13, 2023
* implement new round processor

* add English locale, icon, and documentation

* fix checkstyle

* support different rounding modes

* add rounding mode in documentation

* fix time display

* let NaryMapping selection account for property scope

* implement boolean filter unit tests

* add common StoreEventCollector class and refactor TestChangedValueDetectionProcessor

* add new class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest Indicates an issue for hacktoberfest event 2023. testing Relates to any kind of test (unit test, integration, or E2E test).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants