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

feat: run shared tests #390

Merged
merged 1 commit into from
Jul 9, 2019
Merged

feat: run shared tests #390

merged 1 commit into from
Jul 9, 2019

Conversation

jannyHou
Copy link
Contributor

@jannyHou jannyHou commented Jun 28, 2019

Description

connect to #386

Run shared tests from juggler v3 and v4.

Related issues

#386

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

@jannyHou jannyHou changed the title feat: run shared tests [WIP]feat: run shared tests Jun 28, 2019
@jannyHou jannyHou force-pushed the refactor/juggler-test branch 2 times, most recently from 892807d to faf3862 Compare July 4, 2019 20:13
package-lock.json Outdated Show resolved Hide resolved
@jannyHou jannyHou force-pushed the refactor/juggler-test branch 3 times, most recently from 3e12745 to f3bc17b Compare July 5, 2019 20:58
@jannyHou jannyHou changed the title [WIP]feat: run shared tests feat: run shared tests Jul 8, 2019
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Nice start!

.travis.yml Show resolved Hide resolved
@@ -444,6 +444,12 @@ MySQL.prototype.fromColumnValue = function(prop, val) {
lat: val.y,
};
break;
case 'ObjectID':
Copy link
Member

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?

Copy link
Contributor Author

@jannyHou jannyHou Jul 8, 2019

Choose a reason for hiding this comment

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

Copy link
Member

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?

Copy link
Contributor Author

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...

lib/mysql.js Show resolved Hide resolved
test/init.js Outdated Show resolved Hide resolved
@@ -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);
Copy link
Member

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)));
Copy link
Member

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']));
Copy link
Member

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?

@jannyHou
Copy link
Contributor Author

jannyHou commented Jul 8, 2019

#390 (comment)
#390 (comment)
#390 (comment)

I submitted another PR to verify are they working with juggler v3 in #392

@jannyHou jannyHou mentioned this pull request Jul 8, 2019
2 tasks
@jannyHou
Copy link
Contributor Author

jannyHou commented Jul 8, 2019

@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.

@jannyHou
Copy link
Contributor Author

jannyHou commented Jul 8, 2019

@bajtos Thank you for the review, replied.

I am ok to release a new major version for upgrading to juggler v4. For the failures on the current master, I prefer to leave it out of the scope of issue #386, we can either reopen #378 or create a new task for it :)

@bajtos
Copy link
Member

bajtos commented Jul 9, 2019

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 master, these connector-specific tests are executed against juggler v3.

In that case it makes sense to keep the changes in test/* files as part of this pull request 👍

@jannyHou
Copy link
Contributor Author

jannyHou commented Jul 9, 2019

@bajtos

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 master, these connector-specific tests are executed against juggler v3.

Ah yes! Then never mind about my comment #390 (comment).

@jannyHou jannyHou force-pushed the refactor/juggler-test branch from 172acf5 to 2fe7d64 Compare July 9, 2019 14:51
@jannyHou jannyHou force-pushed the refactor/juggler-test branch from 2fe7d64 to 01c94b6 Compare July 9, 2019 15:36
@jannyHou jannyHou merged commit f556b7c into master Jul 9, 2019
@delete-merged-branch delete-merged-branch bot deleted the refactor/juggler-test branch July 9, 2019 16:01
loryk pushed a commit to loryk/loopback-connector-mysql that referenced this pull request Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants