apache/dubbo

Unit test cases Improvement Project

Open

#7.830 aberto em 22 de mai. de 2021

Ver no GitHub
 (5 comments) (3 reactions) (0 assignees)Java (26.453 forks)batch import
help wanted

Métricas do repositório

Stars
 (41.524 stars)
Métricas de merge de PR
 (Mesclagem média 7d 14h) (20 fundiu PRs em 30d)

Description

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

Guia do colaborador