Skip to content

PHPLIB-530: Test against MongoDB 4.3 #723

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 5 commits into from
Feb 27, 2020
Merged

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Feb 24, 2020

https://jira.mongodb.org/browse/PHPLIB-530, https://jira.mongodb.org/browse/PHPLIB-515

While working on #721, I noticed that we don't test against MongoDB 4.3. This PR adds 4.3 to the build pipeline and fixes test failures that come from this. Also removes execution stats from MapReduce (PHPLIB-515).

@alcaeus alcaeus requested a review from p-mongo February 24, 2020 09:20
@alcaeus alcaeus self-assigned this Feb 24, 2020
With MR being moved to aggregation, result order can sometimes be different than expected. This adds a sort function before assertions to avoid test failures due to sorting.
private $databaseName;

/**
* @param string|null $databaseName
Copy link
Member

Choose a reason for hiding this comment

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

This doc block is inconsistent with the params.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since the first argument is typed, it does not need a doc block to further clarify the type of the argument. I can add the @param annotation, but it doesn't add any value to the method.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I didn't realize this was just intended to document the union type. SGTM.

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: we can't use nullable types yet as they were only introduced in PHP 7.1.

@@ -14,6 +14,13 @@
*/
class CrudSpecTest extends FunctionalTestCase
{
/** @var array */
private static $incompleteTests = [
'find-allowdiskuse: Find does not send allowDiskuse when value is not specified' => 'PHPLIB-500',
Copy link
Member

Choose a reason for hiding this comment

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

Noted that this depends on #721, which in turn is waiting for this PR to get merged.

$info = parent::current();

if ($this->databaseName !== null && isset($info['idIndex']) && ! isset($info['idIndex']['ns'])) {
$info['idIndex']['ns'] = $this->databaseName . '.' . $info['name'];
Copy link
Member

Choose a reason for hiding this comment

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

Is this related to PHPLIB-499 (#718)? If so, I'm curious if the spec change needs to be revised. mongodb/specifications@8ed5d56 for SPEC-1399 only addressed the listIndexes, but I gather this pertains to some behavioral change in listCollections.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, which is why I missed this in the original PR. listCollections returns information about the _id index, which also omits the ns key in 4.4+. I've created SPEC-1584 to track this and will add this to the spec.

@alcaeus alcaeus merged commit 68d4908 into mongodb:master Feb 27, 2020
@alcaeus alcaeus deleted the phplib-530 branch February 27, 2020 10:21
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