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

Add end-to-end tests for timestamp insertion, and patch the conversion issue #1201

Merged
merged 4 commits into from
Aug 18, 2022

Conversation

ryanpbrewster
Copy link
Contributor

Summary

This PR introduces an e2etests/ directory with "end to end" tests:

  • set up a memory engine
  • start the server
  • connect using the normal Go mysql driver
  • execute queries

This can catch issues that a unit test against the engine itself cannot.

There is only a single test thus far, and it is fairly verbose. I know that there is at least one more issue with timestamps, and I will open a follow-up PR to address that issue as soon as I track down its source. For now I'm opting for clarity rather than code reusability.

Lastly, this PR introduces a little patch to the timestamp conversion logic, which was accidentally broken in #1061 because it only handles string but the server layer now passes it []byte. This patch is very dumb and simple: just convert []byte to string before parsing.

Motivation

#1139

@ryanpbrewster
Copy link
Contributor Author

@fulghum can you recommend a reviewer for this PR?

@fulghum fulghum self-requested a review August 18, 2022 21:26
Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

Looks great @ryanpbrewster. Thank you for taking the time to contribute this fix!

You're right that we don't have a good end-to-end testing framework, and it's not too uncommon to see issues that only manifest when sending the request/response over the wire, so your new e2e test looks very reasonable to me.

I just had two really trivial suggestions. I think I can go ahead apply those for you and then merge this fix in, otherwise if you can accept those suggestions, I'll get 'em merged in.

e2etests/timestamp_test.go Show resolved Hide resolved
e2etests/timestamp_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

Code looks good and CI tests are all passing now.

Thank you for taking the time to contribute this fix to our repo! 💙

@fulghum fulghum merged commit b10473a into dolthub:main Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants