-
Notifications
You must be signed in to change notification settings - Fork 183
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
feat: run shared tests #390
Conversation
892807d
to
faf3862
Compare
3e12745
to
f3bc17b
Compare
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.
Nice start!
@@ -444,6 +444,12 @@ MySQL.prototype.fromColumnValue = function(prop, val) { | |||
lat: val.y, | |||
}; | |||
break; | |||
case 'ObjectID': |
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.
Interesting. Why do we need to deal with ObjectID
, considering that it's a type specific to MongoDB? Is this related to changes made in juggler v4?
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.
@bajtos See tests in https://github.com/strongloop/loopback-connector-mysql/blob/1849507e065985ea0242440979a073bcebe4682e/test/mysql.test.js#L14, I guess it's for the consistent behaviors across all connectors.
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.
I see. test/mysql.test.js
is not part of the shared test suite imported from juggler, so why are we fixing it in this pull request? Can you please open a new pull requests to fix problems that are unrelated to the shared test suite first?
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.
@bajtos Interesting 🤔 I thought you have noticed that after configuring the shared tests, the connector tests run with juggler v4(which this PR does) instead of juggler v3(the current master), and that's how all these fixes happen.
And I thought "running connector tests with juggler v4" is what we intend to do...
@@ -206,7 +207,8 @@ describe('MySQL specific datatypes', function() { | |||
var xcor, ycor; | |||
City.create(city1, function(err, res) { | |||
if (err) return done(err); | |||
res.loc.should.deepEqual(city1.loc); | |||
const loc_in_geo_type = new GeoPoint(city1.loc); | |||
res.loc.should.deepEqual(loc_in_geo_type); |
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.
This change seems unrelated to the introduction of shared test suite from juggler v4. Is it needed to fix failing tests? Can we make it in a standalone PR please?
cb(err, fields); | ||
// The returned data are in arrays of type `RowDataPacket`, | ||
// which are not objects. | ||
cb(err, JSON.parse(JSON.stringify(fields))); |
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.
This change seems unrelated to the introduction of shared test suite from juggler v4. Is it needed to fix failing tests? Can we make it in a standalone PR please?
@@ -88,7 +89,7 @@ describe('mysql', function() { | |||
|
|||
p.content.should.be.equal(post.content); | |||
p.title.should.be.equal('a'); | |||
p.comments.should.eql(['1', '2']); | |||
p.comments.should.eql(new List(['1', '2'])); |
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.
This change seems unrelated to the introduction of shared test suite from juggler v4. Is it needed to fix failing tests? Can we make it in a standalone PR please?
#390 (comment) I submitted another PR to verify are they working with juggler v3 in #392 |
@bajtos Those 3 tests are related to the v3->v4 upgrade of juggler, see PR #392, so those fixes should still be kept in this PR. I think v4 has a breaking change for the type coercion. |
I am not sure if we need a new major version, leave that up to you to decide. I think I am starting to understand what's the problem here. We are not only adding the shared test suite from juggler v4, but also upgrading the mysql-connector-specific test suite to execute against juggler v4. On In that case it makes sense to keep the changes in |
Ah yes! Then never mind about my comment #390 (comment). |
172acf5
to
2fe7d64
Compare
2fe7d64
to
01c94b6
Compare
feat: run shared tests
Description
connect to #386
Run shared tests from juggler v3 and v4.
Related issues
#386
Checklist
guide