Background
Unit test case completion refers to the completion and supplement of unit test cases in the main warehouse to improve Dubbo's unit test code coverage.
At present, priority is given to improving the code unit test coverage of the 3.0 branch.
Dubbo's unit test uses Junit5 + Mockito (Dubbo Spring Boot uses Junit4 to be compatible with Springboot 1.x) test framework.
For special scenarios that need to introduce other dependencies, you can refer to existing repositories or ask us questions.
Unit testing needs to achieve full coverage of core processes as much as possible, and test cases have good reentrancy.
Considering that the repo is large and there are many contributors, multiple people and multiple use cases can test a certain piece of code together in order to improve code coverage and boundary condition coverage.
The unit test report can be seen at https://app.codecov.io/gh/apache/dubbo/branch/3.0 , and please focusing on improving the code coverage of the main process.
How To
- Submit your PR which contains the test cases directly to apache/dubbo.
- Leave a comment under this Issue so that we can track this project. You can just simply comment like
@AlbumenJ have submit a PR #xxxx(replaced with the PR number) about NacosRegistry(replaced with the related module) to improve test coverage
.
For Newcomer
You can learn about Dubbo's basic description and instructions on the official website of Apache Dubbo ( https://dubbo.apache.org/en/ )
Fork Dubbo repo https://github.com/apache/dubbo , Dubbo Samples repo https://github.com/apache/dubbo-samples brakes on subsequent submissions and contributions to the repo
Read the contributor's guide (can solve most of the problems that may be encountered during the participation process)
https://github.com/apache/dubbo#contributing
Pull Dubbo repo to the local, try to modify and improve
If you encounter any problems during this process, you have the following contact methods
Ask the mail group for help: send to dev@dubbo.apache.org using personal email
Submit a question: Submit a question in the corresponding warehouse
Notice
- For those who need to start the Netty, complete Dubbo protocol, it is necessary to ensure that the environment is cleaned up after the test case is over
- For those that need to rely on
ApplicationModel
, they need to be reset each time they are used up - For those using the Spring environment, you must close or use
DirtiedContext
after each startup - For other environments, please consider the environmental pollution caused by unit testing, especially the pollution of static variables
5条答案
按热度按时间wydwbb8l1#
@AlbumenJ can i work on this issue.
rqenqsqc2#
It is recommended to use mock as much as possible for UT to reduce the behavior of introducing server-side core components and starting the service for testing.
Doing so will help increase the speed of unit test execution.
eufgjt7s3#
iqjalb3h4#
@AlbumenJ I have add an unit test last week. Can I work more on adding unit tests? Or are there any recommened files of this issues that need to deal with?
zrfyljdw5#
@hadley0828 It welcome to submit multi PRs. Also, please try patch them to 3.0 branch, which is more significant for us recently.
are there any recommened files of this issues that need to deal with?
We are using codecov to trach line coverage. You can mention at https://app.codecov.io/gh/apache/dubbo/branch/3.0 .
The easy way to find out which files are needed to deal with is find out commit in the latest 3.0 branch and follow the way in the below screen shot.