Skip to content

PHPLIB-616 Continuous Matrix Testing for 4.2 era drivers #812

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
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/Collection/CollectionFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ public function testWithOptionsPassesOptions()

/**
* @group matrix-testing-server-4.4-driver-4.0
* @group matrix-testing-server-4.4-driver-4.2
* @group matrix-testing-server-5.0-driver-4.0
* @group matrix-testing-server-5.0-driver-4.2
Copy link
Member

Choose a reason for hiding this comment

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

I realize this format dates back to https://github.com/mongodb/mongo-php-library/pull/810/files#r579294457 (already merged in v1.4), but seeing this again I wonder if it makes sense to add something to this name that communicates the tests are actually skipped for this server/driver combination.

My first impression reading this after not thinking about it for some time is that these are tests for this particular version, not incompatible tests intended to be skipped.

Maybe just prefix "exclude-" to these?

Copy link
Member Author

Choose a reason for hiding this comment

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

Adding a prefix sounds good. I'll make the change in 1.4 and merge up, fixing things along the way.

*/
public function testMapReduce()
{
Expand Down
5 changes: 4 additions & 1 deletion tests/Model/IndexInfoFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ public function testIs2dSphere()
$this->assertEquals($expectedVersion, $index['2dsphereIndexVersion']);
}

/** @group matrix-testing-server-5.0-driver-4.0 */
/**
* @group matrix-testing-server-5.0-driver-4.0
* @group matrix-testing-server-5.0-driver-4.2
*/
public function testIsGeoHaystack()
{
$indexName = $this->collection->createIndex(['pos' => 'geoHaystack', 'x' => 1], ['bucketSize' => 5]);
Expand Down
2 changes: 2 additions & 0 deletions tests/Operation/ListCollectionsFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public function testListCollectionsForNewlyCreatedDatabase()

/**
* @group matrix-testing-server-4.4-driver-4.0
* @group matrix-testing-server-4.4-driver-4.2
* @group matrix-testing-server-5.0-driver-4.0
* @group matrix-testing-server-5.0-driver-4.2
*/
public function testIdIndexAndInfo()
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Operation/MapReduceFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

/**
* @group matrix-testing-server-4.4-driver-4.0
* @group matrix-testing-server-4.4-driver-4.2
* @group matrix-testing-server-5.0-driver-4.0
* @group matrix-testing-server-5.0-driver-4.2
*/
class MapReduceFunctionalTest extends FunctionalTestCase
{
Expand Down
4 changes: 4 additions & 0 deletions tests/SpecTests/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ protected function dropTestAndOutcomeCollections()
{
$context = $this->getContext();

if ($context->databaseName === 'admin') {
return;
}

if ($context->bucketName !== null) {
$bucket = $context->getGridFSBucket($context->defaultWriteOptions);
$bucket->drop();
Expand Down
3 changes: 3 additions & 0 deletions tests/SpecTests/RetryableReadsSpecTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public static function assertCommandMatches(stdClass $expected, stdClass $actual
* Execute an individual test case from the specification.
*
* @dataProvider provideTests
* @group matrix-testing-server-4.4-driver-4.2
* @group matrix-testing-server-5.0-driver-4.2
*
* @param stdClass $test Individual "tests[]" document
* @param array $runOn Top-level "runOn" array with server requirements
* @param array|object $data Top-level "data" array to initialize collection
Expand Down