Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for Test Restructure #4813

Closed
85 tasks done
JmPotato opened this issue Apr 15, 2022 · 9 comments
Closed
85 tasks done

Tracking Issue for Test Restructure #4813

JmPotato opened this issue Apr 15, 2022 · 9 comments
Labels
component/testing CI testing. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/enhancement The issue or PR belongs to an enhancement. type/refactor The issue belongs to a refactor work.

Comments

@JmPotato
Copy link
Member

JmPotato commented Apr 15, 2022

This is the tracking issue for restructuring PD tests, focusing on unit tests and integration tests, especially on unifying test infrastructure in testify. See pingcap/tidb#26022 for more details on the TiDB side. Before you start, please read the code of conduct below carefully.

Code of Conduct

  • Make the PR as small as possible.
    • Modify only one or two packages at a time if possible.
    • Only focus on the test framework migration work, do not change the test logic. If you feel there is a strong need to refactor some tests, please file an issue to work on it later.
  • Carefully use the suite of testify because it runs its inside tests serially.
  • If a test needs to run a mock test cluster or something that is not lightweight, it's a good idea to put several tests inside a single suite to ensure maximum resource sharing.
  • If you need to call require.Xxx(t, a, b) multiple times, please create a re := require.New(t) first to avoid passing the t all around.
  • Use only require.Xxx or suite.Xxx whenever possible, do not mix the two.
  • For a function that will return error type, please use require.NoError/Error rather than require.Nil/NotNil.
  • For an equality comparison, please place the expected value as the first argument to fit the function signature, which will make the error message clear if the test fails.
    • re.Equal(expected, actual)
    • re.Equal(actual, expected)
  • Comment on this issue first to tell others which package you will work on.

Migration

Mics

@JmPotato JmPotato added type/enhancement The issue or PR belongs to an enhancement. component/testing CI testing. labels Apr 15, 2022
@rleungx rleungx pinned this issue May 30, 2022
ti-chi-bot pushed a commit that referenced this issue May 30, 2022
ref #4813

Testify the pkg/apiutil, pkg/audit, pkg/autoscaling, pkg/cache tests.

Signed-off-by: JmPotato <[email protected]>

Co-authored-by: ShuNing <[email protected]>
ti-chi-bot pushed a commit that referenced this issue May 30, 2022
ref #4813

Testify the pkg/codec, pkg/encryption, pkg/errs tests.

Signed-off-by: JmPotato <[email protected]>
@rleungx rleungx added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels May 30, 2022
ti-chi-bot pushed a commit that referenced this issue May 30, 2022
… the tests (#5067)

ref #4813

Testify the pkg/assertutil, pkg/etcdutil, pkg/grpcutil, pkg/keyutil, pkg/logutil, pkg/metricutil tests.

Signed-off-by: JmPotato <[email protected]>
ti-chi-bot pushed a commit that referenced this issue May 31, 2022
ref #4813

Use `require.New` to reduce code.

Signed-off-by: JmPotato <[email protected]>
ti-chi-bot pushed a commit that referenced this issue Jun 1, 2022
ref #4813

Testify the client tests.

Signed-off-by: JmPotato <[email protected]>
ti-chi-bot pushed a commit that referenced this issue Jun 1, 2022
)

ref #4813

Testify the pkg/mockhbstream, pkg/movingaverage, pkg/netutil, pkg/progress tests.

Signed-off-by: JmPotato <[email protected]>
ti-chi-bot added a commit that referenced this issue Jun 2, 2022
ref #4813

Testify all pkg tests.

Signed-off-by: JmPotato <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
ti-chi-bot pushed a commit that referenced this issue Jun 2, 2022
ref #4813

Fix the `testServiceSuite`.

Signed-off-by: JmPotato <[email protected]>
ti-chi-bot added a commit that referenced this issue Jun 7, 2022
ref #4813

Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
ti-chi-bot added a commit that referenced this issue Jun 7, 2022
ref #4813

Signed-off-by: LLThomas <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
ref tikv#4813

Testify the TSO tests.

Signed-off-by: JmPotato <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
ref tikv#4813

Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
ref tikv#4813

Testify some server tests.

Signed-off-by: JmPotato <[email protected]>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
ref tikv#4813, ref tikv#5193

Signed-off-by: lhy1024 <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
ref tikv#4813

Add a WithTestify func for CheckTransferLeader and CheckTransferLeaderWithTestify will be used in server/cluster/coordinator_test.go.

Signed-off-by: LLThomas <[email protected]>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
…ssert functions (tikv#5219)

ref tikv#4813

Update the check-test.sh to detect more inefficient assert functions.

Signed-off-by: JmPotato <[email protected]>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
ref tikv#4813, close tikv#5105

Clean up the surrounding code of check pkg.

Signed-off-by: JmPotato <[email protected]>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
ref tikv#4813

Testify the global_config tests.

Signed-off-by: JmPotato <[email protected]>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
@JmPotato JmPotato unpinned this issue Jul 14, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
ti-chi-bot added a commit that referenced this issue Jul 25, 2022
ref #4813

Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
ti-chi-bot bot pushed a commit that referenced this issue Dec 20, 2023
ref #4813

Fix some errors detected by `testifylint`.

Signed-off-by: JmPotato <[email protected]>
ti-chi-bot bot added a commit that referenced this issue Dec 21, 2023
ref #4813

Fix all errors detected by testifylint and enable it.

Signed-off-by: JmPotato <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot pushed a commit that referenced this issue Dec 21, 2023
ref #4813

Fix the TSO consistency test.

Signed-off-by: JmPotato <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/testing CI testing. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/enhancement The issue or PR belongs to an enhancement. type/refactor The issue belongs to a refactor work.
Projects
None yet
Development

No branches or pull requests

6 participants