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
Added GROUP BY support, tests to dolt query_diff #768
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good!
My one main comment is that you shouldn't need to duplicate test setup from the enginetest package. Just use it directly (unless there is some very compelling reason not to that I'm missing).
query string | ||
} | ||
|
||
var engineTestSelectQueries = []engineTestQuery{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to just get these directly from the enginetest package. They're exported. Just use the queries and ignore the expected values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if you're concerned that not every test query is supported (those involving typestable e.g.), just use doltHarness.SkipQueryTest to filter them.
{query: `SELECT SUM(i) FROM mytable`}, | ||
} | ||
|
||
// runs a subset of SELECT queries from enginetest/queries.go as a sanity check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to run all of them? If you're just checking that they run and produce no diff, then that should be fine, right?
Another interesting test would be to create the table, commit it, then insert the rows and verify that the "to" diff contains exactly the rows expected by the normal query in the engine test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a great idea
@@ -262,3 +362,506 @@ func testQueryDiffer(t *testing.T, test queryDifferTest) { | |||
assert.Nil(t, to) | |||
assert.Equal(t, io.EOF, err) | |||
} | |||
|
|||
// subset of test data from go-mysql-server/enginetest/testdata.go:CreateSubsetTestData() | |||
var engineTestSetup = []testCommand{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should just create these with a doltHarness. Not sure what value you get by duplicating them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That method even lets you create a subset of the tables you are interested in (but creating all of them should work)
032df45
to
a381e98
Compare
a381e98
to
3aaa5cc
Compare
No description provided.