Skip to content

PHPLIB-500: Support for allowDiskUse on find operations #721

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

Merged
merged 2 commits into from
Feb 27, 2020

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Feb 11, 2020

https://jira.mongodb.org/browse/PHPLIB-500

PHP 5 build failures will be fixed by #720.

@alcaeus alcaeus requested a review from jmikola February 11, 2020 19:08
@alcaeus alcaeus self-assigned this Feb 11, 2020
@@ -276,6 +276,10 @@ private function assertEquals(ArrayObject $expected, ArrayObject $actual, $ignor
}

foreach ($expected as $key => $expectedValue) {
if ($expectedValue === null) {
continue;
Copy link
Member

Choose a reason for hiding this comment

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

I assume this was done to satisfy the Fields that must NOT be present in Actual Documents spec test change introduced by mongodb/specifications#692.

I think this is technically incorrect, as it's skipping the assertion entirely if the expected value is null. At the very least, I think you'd want to assert that $actualHasKey (set below) is false.\But rather than modify DocumentsMatchConstraint at all (which inadvertently affect other assertions, such as change stream results), I'd propose handling this in CrudSpecTest::assertCommandMatches(), similar to as is done in TransactionSpecTest here. I believe the transaction spec tests are the only other tests that use the same "null means unset" concept for command assertions.

Lastly, I believe this PR is also missing find-allowdiskuse.json from mongodb/specifications@92255e0.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I've moved the check to not affect other tests. The find-allowdiskuse.json test was added in #717, but didn't get executed because we're not testing against a 4.3 server. Since some tests currently fail on 4.3, I'll add this in a separate PR and hold off on merging this until we're properly testing this functionality.

Copy link
Member

@jmikola jmikola Feb 14, 2020

Choose a reason for hiding this comment

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

Ah, I totally forgot that was included in my PR.

Good point. I've moved the check to not affect other tests.

Does this mean the change to DocumentsMatchConstraint.php above was reverted? If so, it wasn't pushed when you made this comment. I'll circle back later to review the change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, I forgot to push this change 😅

@alcaeus
Copy link
Member Author

alcaeus commented Feb 18, 2020

@jmikola holding off on merging this until PHPLIB-530 is done as the functionality introduced here currently isn't tested for lack of a 4.3 build stage.

@alcaeus alcaeus merged commit 8060d72 into mongodb:master Feb 27, 2020
@alcaeus alcaeus deleted the phplib-500 branch February 27, 2020 11:27
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.

2 participants