apache/dubbo

Unit test cases Improvement Project

Open

#7.830 geöffnet am 22. Mai 2021

Auf GitHub ansehen
 (5 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)Java (26.453 Forks)batch import
help wanted

Repository-Metriken

Stars
 (41.524 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 7T 14h) (20 gemergte PRs in 30 T)

Beschreibung

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.

image

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

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

Contributor Guide