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

Use require.Equal to replace reflect.DeepEqual #5104

Closed
Tracked by #4813
JmPotato opened this issue Jun 6, 2022 · 0 comments · Fixed by #5109 or #5110
Closed
Tracked by #4813

Use require.Equal to replace reflect.DeepEqual #5104

JmPotato opened this issue Jun 6, 2022 · 0 comments · Fixed by #5109 or #5110
Labels
component/testing CI testing. type/enhancement The issue or PR belongs to an enhancement.

Comments

@JmPotato
Copy link
Member

JmPotato commented Jun 6, 2022

Enhancement Task

The implementation of ObjectsAreEqual inside require.Equal is effectively just a call to reflect.DeepEqual, which means we don't need require.True(reflect.DeepEqual(expected, actual)). So it's a good idea to replace all reflect.DeepEqual in tests to require.Equal.

@JmPotato JmPotato added type/enhancement The issue or PR belongs to an enhancement. component/testing CI testing. labels Jun 6, 2022
ti-chi-bot pushed a commit that referenced this issue Jun 6, 2022
close #5104

Use require.Equal to replace reflect.DeepEqual.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
ti-chi-bot added a commit that referenced this issue Jun 7, 2022
close #5104

Add the inefficient assert function usage check.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
close tikv#5104

Use require.Equal to replace reflect.DeepEqual.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this issue Jul 14, 2022
close tikv#5104

Add the inefficient assert function usage check.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/testing CI testing. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
1 participant