pingcap / pingcap/tiup

Unit tests should only test single actions

Open
#111 1 comment 1 reaction 1 assignee View on GitHub

@nrc is already working on this.

Since Apr 15, 2020.

difficulty/medium good first issue type/enhancement
Dominant language
Go
Stars
466
Forks
338
Avg merge
3d 7h
Merged PRs (30d)
8

Description

Some of our unit tests are more like integration tests at the moment in that they test more than one stage in the TiUp pipeline. It is better practice to test this sort of thing in integration tests and for unit tests to test small, modular actions. In particular, unit tests should almost never do IO. Doing this will require some mocking of interfaces and extracting interfaces where there are currently only concrete types

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.