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

plan: export MockTable and MockContext to be used in cascades package #8503

Merged
merged 3 commits into from
Nov 29, 2018

Conversation

eurekaka
Copy link
Contributor

@eurekaka eurekaka commented Nov 29, 2018

Split from #8449

What problem does this PR solve?

Unit test of cascades package need mocked table information declared in MockTable(), but this function is in _test.go file of core package, which would only be compiled when testing core package, so cascades package cannot reuse these codes currently.

What is changed and how it works?

Move MockTable() and MockContext() to a new file mock.go to make them usable for cascades package.

Check List

Tests

  • Unit test: no code logic change, I am just moving codes around, so current unit test should cover these changes.

Code changes

  • Has exported function/method change

Side effects

N/A

Related changes

N/A


This change is Reviewable

@eurekaka eurekaka added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner labels Nov 29, 2018
@eurekaka
Copy link
Contributor Author

/run-all-tests

@eurekaka
Copy link
Contributor Author

@zz-jason @winoros @lamxTyler PTAL

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 29, 2018
Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@winoros winoros added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 29, 2018
@zz-jason zz-jason merged commit d3d46e0 into pingcap:master Nov 29, 2018
@eurekaka eurekaka deleted the mock_table branch November 29, 2018 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants