-
Notifications
You must be signed in to change notification settings - Fork 208
Test fixes for libmongoc 1.9.0-dev (post rc1) #701
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
Conversation
@@ -28,10 +28,10 @@ echo throws(function() use ($bulk) { | |||
<?php exit(0); ?> | |||
--EXPECT-- | |||
OK: Got MongoDB\Driver\Exception\InvalidArgumentException | |||
update document contains invalid key: empty key | |||
invalid selector for update: empty key |
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.
Note: this expected output will need to be changed again once mongodb/mongo-c-driver#472 is merged.
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.
Do we care enough about the exact word? I'd be happy if we just just %s for the word "selector"/"argument".
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 personally don't care, but without this test we wouldn't have caught the mistake in libmongoc. I don't think libmongoc is going to add tests for all of its error messages, so I'm OK with keeping this around.
@@ -0,0 +1,48 @@ | |||
--TEST-- | |||
MongoDB\Driver\Manager::executeCommand() options |
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 file was renamed from manager-executeRawCommand-001.phpt
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 had specifically named this to match that PR's changes - where we have Raw, Read, Write, and ReadWrite, so I am not sure if this a good idea.
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.
Was this the only occurrence of "Raw" from that PR? I gathered it was more confusing to have a test named in the class-method
for a method that doesn't exist.
We both know that executeCommand()
implies MONGO_CMD_RAW
. Would adding "Raw Command" (or similar) to the test title be a fair compromise?
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.
Just noticed that manager-executeCommand_error-002.phpt
was added in the same PR and didn't use the "RawCommand" name.
<?php exit(0); ?> | ||
--EXPECTF-- | ||
Read Preference: secondary | ||
Read Concern: local |
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.
Note: this test currently fails because CDRIVER-2418 now ignores the readConcern
option unless the read flag is set for the command (not done for the raw and write modes). This should be fixed by CDRIVER-2422.
public function commandFailed( \MongoDB\Driver\Monitoring\CommandFailedEvent $event ) | ||
{ | ||
} | ||
public function commandStarted( \MongoDB\Driver\Monitoring\CommandStartedEvent $event ) |
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 noticed that some of the newer executeCommand()
tests were using tabs instead of spaces. A text search turned up many more occurrences, so I've fixed them all in a single commit within this PR.
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 think this is a pointless change. And would rather have seen that in a specific PR, as now it's more difficult to review this as I have to go through all of it.
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.
LGTM, but left some comments that you might want to look at.
public function commandFailed( \MongoDB\Driver\Monitoring\CommandFailedEvent $event ) | ||
{ | ||
} | ||
public function commandStarted( \MongoDB\Driver\Monitoring\CommandStartedEvent $event ) |
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 think this is a pointless change. And would rather have seen that in a specific PR, as now it's more difficult to review this as I have to go through all of it.
@@ -28,10 +28,10 @@ echo throws(function() use ($bulk) { | |||
<?php exit(0); ?> | |||
--EXPECT-- | |||
OK: Got MongoDB\Driver\Exception\InvalidArgumentException | |||
update document contains invalid key: empty key | |||
invalid selector for update: empty key |
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.
Do we care enough about the exact word? I'd be happy if we just just %s for the word "selector"/"argument".
@@ -0,0 +1,48 @@ | |||
--TEST-- | |||
MongoDB\Driver\Manager::executeCommand() options |
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 had specifically named this to match that PR's changes - where we have Raw, Read, Write, and ReadWrite, so I am not sure if this a good idea.
8c08b5f
to
15771c4
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.
LGTM
6109d13
to
464265e
Compare
The error message was changed in mongodb/mongo-c-driver@a625b39
The error message was changed in mongodb/mongo-c-driver@0c9cc9d
As of mongodb/mongo-c-driver@c2639c8, libmongoc no longer adds a default write concern to commands.
This serves as a reminder that executeCommand() is the execution method for raw commands.
This test is adapted from manager-executeCommand-004.phpt.
464265e
to
154ca93
Compare
https://jira.mongodb.org/browse/PHPC-1037