tikv / tikv/pd

Unit test with Table-driven style

Open
#2,590 1 comment 3 reactions 0 assignees View on GitHub
good first issue help wanted type/enhancement
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Feature Request

In current unit test coverage situation, I found that, in most cases, the error handling hasn't been covered due to we only prepared the success cases in current unit test.

Here is one example:

![image](https://user-images.githubusercontent.com/13427348/86008744-c8a82e00-ba4b-11ea-92d3-d30fb06b8afa.png)

To cover the error handling in the function, I'd like to introduce the [`Table-driven`](https://github.com/golang/go/wiki/TableDrivenTests#parallel-testing) ut style.

Here is one example to show how we use table-driver style to cover the error handling cases.

https://github.com/pingcap/pd/pull/2589

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.