You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/07/14 10:29:31 UTC

[GitHub] [dolphinscheduler] ruanwenjun opened a new issue, #10976: [Improvement][UT] Upgrade junit to 5.+

ruanwenjun opened a new issue, #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
   
   
   ### Description
   
   Right now, we still use junit 4.+ in our repo, I hope we can upgrade to [Junit 5.+](https://junit.org/junit5/docs/current/user-guide/#writing-tests), then we can easy to write the UT, JUnit 5 provide some useful feature, e.g. `assertThrow`, `assertTimeout `...
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] ruanwenjun commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1207582753

   > 
   
   Can we use Mokito to replace powermock?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] ruanwenjun commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1193098916

   > What about using `TestNG`?
   
   This may need to refactor all test code, if we want to use `TestNG` to replace Junit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] caishunfeng commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
caishunfeng commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1194877735

   Great! It seems use Junit5+ can achieve the same with less change.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1193234105

   > > > > What about using `TestNG`?
   > > > 
   > > > 
   > > > This may need to refactor all test code, if we want to use `TestNG` to replace Junit
   > > 
   > > 
   > > @ruanwenjun Yes. At this moment, I think we have about 4 people, me and my colleagues who will work on the UT refactoring. It is possible for us to refactor all test code and fix all related style / formatting issues. The question lying between choosing `TestNG` and `jUnit` is whether it is necessary to replace one with another. So far, I've found some advantages of `TestNG` over `jUnit`:
   > > 
   > > * `TestNG` supports running UT in parallelism.
   > > * `TestNG` supports `testing group`.
   > > * `TestNG` supports an easier way to pass data into testing method using `Data Provider`.
   > > * `TestNG` supports `Dependency Test`.
   > > * `TestNG` supports `Parameterization` through `xml` configuration.
   > > 
   > > Some related materials:
   > > 
   > > * https://www.youtube.com/watch?v=OWXWQE4pL_0
   > > * https://www.guru99.com/junit-vs-testng.html
   > > 
   > > Although `TestNG` is more powerful, it seems that it is not a `must` to switch `jUnit` to `TestNG` šŸ¤£
   > > WDYT?
   > 
   > AFAIK, Junit5+ can support these features.
   
   @ruanwenjun Sounds good to me. I will take this issue.
   
   I found a post about differences between `jUnit4` and `jUnit5`, as well as how to migrate: https://blogs.oracle.com/javamagazine/post/migrating-from-junit-4-to-junit-5-important-differences-and-benefits


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1207427898

   In DolphinScheduler, we sometimes use `Powermock` for UTs. However, it seems `Powermock` does not and will not support jUnit 5. https://github.com/powermock/powermock/issues/929


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1193126861

   > > What about using `TestNG`?
   > 
   > This may need to refactor all test code, if we want to use `TestNG` to replace Junit
   
   @ruanwenjun  Yes. At this moment, I think we have about 4 people, me and my colleagues who will work on the UT refactoring. It is possible for us to refactor all test code and fix all related style / formatting issues. The question lying between choosing `TestNG` and `jUnit` is whether it is necessary to replace one with another. So far, I've found some advantages of `TestNG` over `jUnit`:
   
   * `TestNG` supports running UT in parallelism.
   * `TestNG` supports `testing group`.
   * `TestNG` supports an easier way to pass data into testing method using `Data Provider`.
   * `TestNG` supports `Dependency Test`.
   * `TestNG` supports `Parameterization` through `xml` configuration.
   
   Some related materials:
   * https://www.youtube.com/watch?v=OWXWQE4pL_0
   * https://www.guru99.com/junit-vs-testng.html
   
   Although `TestNG` is more powerful, it seems that it is not a `must` to switch `jUnit` to `TestNG` šŸ¤£ 
   
   WDYT?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] ruanwenjun commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1184276121

   cc #10573


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] ruanwenjun commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1193232697

   > > > What about using `TestNG`?
   > > 
   > > 
   > > This may need to refactor all test code, if we want to use `TestNG` to replace Junit
   > 
   > @ruanwenjun Yes. At this moment, I think we have about 4 people, me and my colleagues who will work on the UT refactoring. It is possible for us to refactor all test code and fix all related style / formatting issues. The question lying between choosing `TestNG` and `jUnit` is whether it is necessary to replace one with another. So far, I've found some advantages of `TestNG` over `jUnit`:
   > 
   > * `TestNG` supports running UT in parallelism.
   > * `TestNG` supports `testing group`.
   > * `TestNG` supports an easier way to pass data into testing method using `Data Provider`.
   > * `TestNG` supports `Dependency Test`.
   > * `TestNG` supports `Parameterization` through `xml` configuration.
   > 
   > Some related materials:
   > 
   > * https://www.youtube.com/watch?v=OWXWQE4pL_0
   > * https://www.guru99.com/junit-vs-testng.html
   > 
   > Although `TestNG` is more powerful, it seems that it is not a `must` to switch `jUnit` to `TestNG` šŸ¤£
   > 
   > WDYT?
   
   AFAIK, Junit5+ can support these features.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1207780514

   > > In DolphinScheduler, we sometimes use `Powermock` for UTs. However, it seems `Powermock` does not and will not support jUnit 5. [powermock/powermock#929](https://github.com/powermock/powermock/issues/929)
   > 
   > Can we use Mokito to replace powermock?
   
   Seems `powermock` helps mock the `static`, `private` and `final` methods more easily. Anyway I will look into it and see whether there is a way to use `mockito` to replace `powermock`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1184291193

   Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
   * In order for us to understand your request as soon as possible, please provide detailed information态version or pictures.
   * If you haven't received a reply for a long time, you can [join our slack](https://s.apache.org/dolphinscheduler-slack) and send your question to channel `#troubleshooting`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1193127239

   > > > What about using `TestNG`?
   > > 
   > > 
   > > This may need to refactor all test code, if we want to use `TestNG` to replace Junit
   > 
   > @ruanwenjun Yes. At this moment, I think we have about 4 people, me and my colleagues who will work on the UT refactoring. It is possible for us to refactor all test code and fix all related style / formatting issues. The question lying between choosing `TestNG` and `jUnit` is whether it is necessary to replace one with another. So far, I've found some advantages of `TestNG` over `jUnit`:
   > 
   > * `TestNG` supports running UT in parallelism.
   > * `TestNG` supports `testing group`.
   > * `TestNG` supports an easier way to pass data into testing method using `Data Provider`.
   > * `TestNG` supports `Dependency Test`.
   > * `TestNG` supports `Parameterization` through `xml` configuration.
   > 
   > Some related materials:
   > 
   > * https://www.youtube.com/watch?v=OWXWQE4pL_0
   > * https://www.guru99.com/junit-vs-testng.html
   > 
   > Although `TestNG` is more powerful, it seems that it is not a `must` to switch `jUnit` to `TestNG` šŸ¤£
   > 
   > WDYT?
   
   If we choose not to switch `jUnit` to `TestNG`, I support to upgrade `jUnit` to `5.+`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1193051888

   What about using `TestNG`?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1207139828

   I'm working on this, will submit a PR tomorrow or next week.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 closed issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
EricGao888 closed issue #10976: [Improvement][UT] Upgrade junit to 5.+
URL: https://github.com/apache/dolphinscheduler/issues/10976


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] zhongjiajie commented on issue #10976: [Improvement][UT] Upgrade junit to 5.+

Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on issue #10976:
URL: https://github.com/apache/dolphinscheduler/issues/10976#issuecomment-1214689815

   > > > In DolphinScheduler, we sometimes use `Powermock` for UTs. However, it seems `Powermock` does not and will not support jUnit 5. [powermock/powermock#929](https://github.com/powermock/powermock/issues/929)
   > > 
   > > 
   > > Can we use Mokito to replace powermock?
   > 
   > Seems `powermock` helps mock the `static`, `private` and `final` methods more easily. Anyway I will look into it and see whether there is a way to use `mockito` to replace `powermock`.
   
   If we can find the alternative or the method to do it, we can get rid of it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org