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/06/23 06:27:13 UTC

[GitHub] [dolphinscheduler] EricGao888 opened a new issue, #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   ### 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
   
    Unit Tests of high quality could not only improve the stability of Dolphin Scheduler, but also increase the readability of Dolphin Scheduler Code.
   
   * Currently we only have around 40% UT coverage. Although DS already has E2E tests and the community are working on the API tests, it never means we do not need high quality unit tests. 
   * As a DS developer, every time after submitting PR, we will see the current UT coverage of the whole project. If the coverage is too low, developers may have concert about the stability of the application.
   * Reading unit tests is one of best approaches for new developers to understand the code. UT cases also help reviewers to review PR. As it is hardly possible to provide docs of every detailed feature of DS, the best way is to keep UT updated.
   
   ### Use case
   
   * We could have different standards for UT for different parts of DS. For example, we have higher bar on UT for core features but lower bar for plugins.
   * We could offer a list of UT cases which need to be updated, added or refactored and label them with `good first issue`. For new developers to this community, writing UT is a good way to understand the code logic and it is more intriguing than refactoring docs.
   
   ### Related issues
   
   * related: #3700
   
   ### Are you willing to submit a PR?
   
   - [X] 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] zhongjiajie commented on issue #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   > I got blocked by some unit test when developing a new feature and mocking some unusual stuff for nearly a day. I would like to update the UT docs with some examples which may help new developers bypass or overcome some pitfalls in UTs. May I ask whether it is possible to migrate this docs into main repo? @zhongjiajie https://dolphinscheduler.apache.org/en-us/community/development/unit-test.html
   > 
   > Thanks
   
   Of cause, we can, do you interesting in this migration?


-- 
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 #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   I've generated test coverage reports for every module of DS using `Intellij`, sorted by `method coverage`. Here are some results:
   ![image](https://user-images.githubusercontent.com/34905992/180733898-63264c54-8c35-47c2-9930-819e6c1cae5e.png)
   ![image](https://user-images.githubusercontent.com/34905992/180734123-5edb7a5a-2f3b-4538-8031-9e2c64c6f7e3.png)
   ![image](https://user-images.githubusercontent.com/34905992/180734169-c4cdab3a-57ee-47c2-8c8c-9188ad8a44b4.png)
   ![image](https://user-images.githubusercontent.com/34905992/180734311-d75bd775-4e20-422e-8af9-2e83d58c0942.png)
   


-- 
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 #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   > > I got blocked by some unit test when developing a new feature and mocking some unusual stuff for nearly a day. I would like to update the UT docs with some examples which may help new developers bypass or overcome some pitfalls in UTs. May I ask whether it is possible to migrate this docs into main repo? @zhongjiajie https://dolphinscheduler.apache.org/en-us/community/development/unit-test.html
   > > Thanks
   > 
   > Of cause, we can, do you interesting in this migration?
   
   Yes, I'd love to give a shot.


-- 
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 #10573: [DSIP-10][Unit Tests] Improve DolphinScheduler unit tests

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

   > I can get involved in the junit upgrade~ @EricGao888
   
   @stalary Currently we are working on removing `powermock` because it does not support jUnit 5 and blocks the upgrade. Would u like to participate in #11405 ? Thanks~


-- 
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] stalary commented on issue #10573: [DSIP-10][Unit Tests] Improve DolphinScheduler unit tests

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

   > > > Currently we are working on removing `powermock` because it does not support jUnit 5 and blocks the upgrade. Would u like to participate in
   > > 
   > > 
   > > Okay, I can be a part of that.
   > 
   > @stalary Great! We have #12150 open to contributors. Would u like to pick it up? Thanks
   
   Please assign to me, thanks~


-- 
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] SbloodyS commented on issue #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   That's great!


-- 
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 #10573: [DSIP-10][Unit Tests] Improve DolphinScheduler unit tests

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

   > ### 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
   > Unit Tests of high quality could not only improve the stability of Dolphin Scheduler, but also increase the readability of Dolphin Scheduler Code.
   > 
   > * Currently we only have around 40% UT coverage. Although DS already has E2E tests and the community are working on the API tests, it never means we do not need high quality unit tests.
   > * As a DS developer, every time after submitting a PR, we will see the current UT coverage of the whole project. If the coverage is too low, developers may have concerns about the stability of the application.
   > * Reading unit tests is one of the best approaches for new developers to understand the code. UT cases also help reviewers to review PR more easily. Furthermore, as it is hardly possible to provide docs of every detailed feature of DS, the best way is to keep UT updated.
   > 
   > ### Use case
   > * We could have different standards for UT for different parts of DS. For example, we have higher bar on UT for core features but lower bar for plugins.
   > * We could offer a list of UT cases which need to be updated, added or refactored and label them with `good first issue`. For new developers to this community, writing UT is a good way to understand the code logic and it is more intriguing than refactoring docs.
   > 
   > ### Related issues
   > * related: [[Improvement] unit test suggestion #3700](https://github.com/apache/dolphinscheduler/issues/3700)
   > * related: [[Feature][style] Replace checkstyle plugin with spotless to automatically fix formatting errors #10963](https://github.com/apache/dolphinscheduler/issues/10963)
   > 
   > ### Action Items
   > * [ ]  Add `Spotless` plugin into DolphinScheduler to enable developers to fix style / formatting errors incrementally: [[Feature][style] Replace checkstyle plugin with spotless to automatically fix formatting errors #10963](https://github.com/apache/dolphinscheduler/issues/10963)
   > * [ ]  Upgrade `jUnit` from `4.x` to `5.x`: [[Improvement][UT] Upgrade junit to 5.+ #10976](https://github.com/apache/dolphinscheduler/issues/10976)
   > * [ ]  Refactor several typical UTs in each module as examples.
   > * [ ]  Add docs of instructions about how to write UT in DolphinScheduler project.
   > * [ ]  Create some easy UT refactoring tasks and label them with `good first issue`.
   > * [ ]  Refactor all UTs in each module complying to `method coverage criteria` and fix the style & formatting errors of related `test code` and `tested code`. This one will be divided into sub-tasks later.
   > 
   > ### Are you willing to submit a PR?
   > * [x]  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

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


[GitHub] [dolphinscheduler] EricGao888 commented on issue #10573: [DSIP-10][Unit Tests] Improve DolphinScheduler unit tests

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

   I will update this issue with a more detailed refactoring plan as well as priorities later this 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] davidzollo commented on issue #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   great


-- 
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] SbloodyS commented on issue #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   > IMHO, we need some priorities, we could apply high priority to those modules where UT might play a more significant role regarding to code quality and application stability.
   
   We can make a list and mark it with priority.


-- 
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 #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   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 #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   I got blocked by some unit test when developing a new feature and mocking some unusual stuff for nearly a day. I would like to update the UT docs with some examples which may help new developers bypass or overcome some pitfalls in UTs. May I ask whether it is possible to migrate this docs into main repo? @zhongjiajie https://dolphinscheduler.apache.org/en-us/community/development/unit-test.html
   
   Thanks


-- 
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 #10573: [DSIP-10][Unit Tests] Improve DolphinScheduler unit tests

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

   > Usage of `Powermock` has been fully removed from the whole project : 
   
   Great new


-- 
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 #10573: [DSIP-10][Unit Tests] Improve DolphinScheduler unit tests

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

   Usage of `Powermock` has been fully removed from the whole project : )


-- 
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 #10573: [DSIP-10][Unit Tests] Improve DolphinScheduler unit tests

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

   > > Currently we are working on removing `powermock` because it does not support jUnit 5 and blocks the upgrade. Would u like to participate in
   > 
   > Okay, I can be a part of that.
   
   @stalary Great! We have #12150 open to contributors. Would u like to pick it up? Thanks


-- 
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] stalary commented on issue #10573: [DSIP-10][Unit Tests] Improve DolphinScheduler unit tests

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

   > Currently we are working on removing `powermock` because it does not support jUnit 5 and blocks the upgrade. Would u like to participate in
   
   Okay, I can be a part of that.


-- 
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 #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   BTW, we could fix the formatting and style errors incrementally, together with unit tests. See: #10963 
   One convenient way is when refactoring some UTs, we fix the formatting and style errors of both the testing and tested part. 


-- 
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 #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   IMHO, we need some priorities, we could apply high priority to those modules where UT might play a more significant role regarding to code quality and application stability.


-- 
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 #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   @SbloodyS Could you please help add a `discussion` label to this issue? Much appreciated~


-- 
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 #10573: [Improvement][Unit Tests] Improve DolphinScheduler unit tests

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

   > That's great!
   
   @SbloodyS Thx. Hope this will help and attract more new developers to submit PRs for DS and offer them an approach to get familiar with the code smoothly.


-- 
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] stalary commented on issue #10573: [DSIP-10][Unit Tests] Improve DolphinScheduler unit tests

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

   I can get involved in the junit upgrade~ @EricGao888 


-- 
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