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

store/tikv: remove dependency on testkit #22520

Merged
merged 5 commits into from
Jan 27, 2021
Merged

store/tikv: remove dependency on testkit #22520

merged 5 commits into from
Jan 27, 2021

Conversation

disksing
Copy link
Contributor

@disksing disksing commented Jan 25, 2021

What problem does this PR solve?

Remove store/tikv's dependency on util/testkit.
Part of #22513

What is changed and how it works?

What's Changed:
Move test files out of the package.

Check List

Tests

  • Unit test

Release note

  • No release note

@@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tikv_test
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a little strange to put the coprocessor test file in the /store directly, however, I do not know where would be better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree. I think we can consider it later.

)

// NewTestStore creates a kv.Storage for testing purpose.
func NewTestStore(c *C) kv.Storage {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use tikv.NewTestStore directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's in _test.go file, we cannot import it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we move it to tikv/test_util.go so we can use it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll give it a try.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AndreMouche Looks we cannot do it. The reason is that NewTestStore relies on the testing flags with-tikv and pd-addrs. If they are included in non-testing packages, the flags will appear in the flag list of tidb-server.

Copy link
Contributor

Choose a reason for hiding this comment

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

sad

andylokandy
andylokandy previously approved these changes Jan 26, 2021
Copy link
Contributor

@andylokandy andylokandy left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 27, 2021
@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jan 27, 2021
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Jan 27, 2021
@disksing
Copy link
Contributor Author

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 27, 2021
@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 22543
  • 22544
  • 22544
  • 22511
  • 22528

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@disksing merge failed.

@disksing
Copy link
Contributor Author

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit d92e62c into pingcap:master Jan 27, 2021
@disksing disksing deleted the testkit branch January 27, 2021 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/store status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants