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

ci: fix previously failing tests #505

Merged
merged 1 commit into from Apr 16, 2019

Conversation

Projects
None yet
3 participants
@b-admike
Copy link
Member

commented Apr 12, 2019

Description

Fix assertions to account for different MongoDB versions (check err code instead of message). Taken out from #501.

Checklist

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

@b-admike b-admike requested review from dhmlau, jannyHou and virkt25 as code owners Apr 12, 2019

@b-admike b-admike self-assigned this Apr 12, 2019

p.length.should.be.equal(0);
Post.find(nestedWhereFilter, (err, p) => {
should.exist(err);
err.message.should.match(/not allowed in query/);

This comment has been minimized.

Copy link
@bajtos

bajtos Apr 12, 2019

Member

This is changing what's being asserted in the test. Before, we assert the connector does not report error and returns an empty array. Now you are asserting that an error is reported.

Could you please elaborate more on why are you making this change? I don't know what should be the expected behavior and thus cannot asses impact of this change.

This comment has been minimized.

Copy link
@b-admike

b-admike Apr 12, 2019

Author Member

I believe the behaviour comes from strongloop/loopback-datasource-juggler@bae60d1 because juggler restricts us from performing these type of queries. I also used https://github.com/strongloop/loopback-connector-mongodb/pull/483/files#diff-f44d7a6206dcaa5ddd05b31118b5c2be as inspiration.

This comment has been minimized.

Copy link
@bajtos

bajtos Apr 12, 2019

Member

I'll trust you on this.

Just make sure that all relevant CI builds are passing.

This comment has been minimized.

Copy link
@jannyHou

jannyHou Apr 12, 2019

Contributor

a nitpick: I think the test here was intended to make sure when extended operators are allowed, the nested $where won't be executed.

So could you add the option {allowExtendedOperators: true} in the query and assert the error message accordingly?
Just like https://github.com/strongloop/loopback-connector-mongodb/pull/483/files#diff-f44d7a6206dcaa5ddd05b31118b5c2beR786
Otherwise LGTM, thanks!

This comment has been minimized.

Copy link
@b-admike

b-admike Apr 16, 2019

Author Member

Thanks Janny, added the option and renamed the test accordingly.

@b-admike b-admike referenced this pull request Apr 12, 2019

Merged

Fix/nested decimal props #501

2 of 2 tasks complete

@b-admike b-admike force-pushed the fix/failing-test-cases branch from cff0deb to b2779b9 Apr 12, 2019

@jannyHou
Copy link
Contributor

left a comment

@b-admike I left a nitpick, otherwise LGTM 👍

@dhmlau dhmlau referenced this pull request Apr 16, 2019

Closed

Fix CI on OPERATOR_NOT_ALLOWED_IN_QUERY #503

0 of 3 tasks complete

@b-admike b-admike force-pushed the fix/failing-test-cases branch from b2779b9 to 9eb5c5d Apr 16, 2019

@b-admike b-admike force-pushed the fix/failing-test-cases branch from 9eb5c5d to 20212e9 Apr 16, 2019

@b-admike b-admike merged commit 6e3e702 into master Apr 16, 2019

10 of 17 checks passed

[cis-jenkins] PR Builder Build finished.
Details
[cis-jenkins] downstream: bluemix-metering@develop Failed! (20212e9)
Details
[cis-jenkins] downstream: bluemix-service-broker@develop Failed! (20212e9)
Details
[cis-jenkins] downstream: plan-manager@develop Failed! (20212e9)
Details
loopback-connector-mongodb Failed! (20212e9)
Details
loopback-connector-mongodb/node=6.x,os=windows Failed! (20212e9)
Details
pr-builder ${BUILD_FAILURE_ANALYZER}
Details
Commit Linter commits are all properly formatted
Details
PR Linter PR is up to date
Details
[cis-jenkins] x64 && linux && nvm && dbs,10 Success! (20212e9)
Details
[cis-jenkins] x64 && linux && nvm && dbs,6 Success! (20212e9)
Details
[cis-jenkins] x64 && linux && nvm && dbs,8 Success! (20212e9)
Details
clahub All contributors have signed the Contributor License Agreement.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
loopback-connector-mongodb/node=4.x,os=windows Success! (20212e9)
Details
security/snyk - package.json (StrongLoop) No manifest changes detected

@b-admike b-admike deleted the fix/failing-test-cases branch Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.