diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 2312b7afa..470f7dc8e 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -172,38 +172,6 @@ functions: DRIVERS_TOOLS="${DRIVERS_TOOLS}" \ bash ./run-mongohouse-image.sh - "create serverless instance": - - command: subprocess.exec - params: - working_dir: "src" - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh - - command: expansions.update - params: - file: src/serverless-expansion.yml - - "create serverless proxy instance": - - command: shell.exec - params: - working_dir: "src" - script: | - ${PREPARE_SHELL} - - VAULT_NAME=serverless_next \ - bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh - - command: expansions.update - params: - file: src/serverless-expansion.yml - - "delete serverless instance": - - command: subprocess.exec - params: - working_dir: "src" - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh - "run tests": - command: shell.exec type: test @@ -252,42 +220,6 @@ functions: TESTS="atlas-data-lake" \ bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh - "run serverless tests": - - command: shell.exec - type: test - params: - working_dir: "src" - script: | - ${PREPARE_SHELL} - export AWS_ACCESS_KEY_ID="${client_side_encryption_aws_access_key_id}" - export AWS_SECRET_ACCESS_KEY="${client_side_encryption_aws_secret_access_key}" - export AWS_TEMP_ACCESS_KEY_ID="${client_side_encryption_aws_temp_access_key_id}" - export AWS_TEMP_SECRET_ACCESS_KEY="${client_side_encryption_aws_temp_secret_access_key_key}" - export AWS_TEMP_SESSION_TOKEN="${client_side_encryption_aws_temp_session_token}" - export AZURE_TENANT_ID="${client_side_encryption_azure_tenant_id}" - export AZURE_CLIENT_ID="${client_side_encryption_azure_client_id}" - export AZURE_CLIENT_SECRET="${client_side_encryption_azure_client_secret}" - export GCP_EMAIL="${client_side_encryption_gcp_email}" - export GCP_PRIVATE_KEY="${client_side_encryption_gcp_privatekey}" - export KMIP_ENDPOINT="${client_side_encryption_kmip_endpoint}" - export KMS_ENDPOINT_EXPIRED="${client_side_encryption_kms_endpoint_expired}" - export KMS_ENDPOINT_WRONG_HOST="${client_side_encryption_kms_endpoint_wrong_host}" - export KMS_ENDPOINT_REQUIRE_CLIENT_CERT="${client_side_encryption_kms_endpoint_require_client_cert}" - export KMS_TLS_CA_FILE="${client_side_encryption_kms_tls_ca_file}" - export KMS_TLS_CERTIFICATE_KEY_FILE="${client_side_encryption_kms_tls_certificate_key_file}" - export MONGODB_IS_SERVERLESS=on - export PATH="${PHP_PATH}/bin:$PATH" - - . ${DRIVERS_TOOLS}/.evergreen/serverless/secrets-export.sh - - export MONGODB_USERNAME=$SERVERLESS_ATLAS_USER - export MONGODB_PASSWORD=$SERVERLESS_ATLAS_PASSWORD - - CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \ - MONGODB_URI="${SERVERLESS_URI}" \ - TESTS="serverless" \ - bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh - "cleanup": - command: shell.exec params: diff --git a/.evergreen/config/generated/test-variant/modern-php-full.yml b/.evergreen/config/generated/test-variant/modern-php-full.yml index 5e8d34b0d..81af870fc 100644 --- a/.evergreen/config/generated/test-variant/modern-php-full.yml +++ b/.evergreen/config/generated/test-variant/modern-php-full.yml @@ -18,8 +18,6 @@ buildvariants: - ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - - "test_serverless_task_group" - - "test_serverless_proxy_task_group" - "test-atlas-data-lake" # Test MongoDB 5.0 and 6.0 @@ -79,8 +77,6 @@ buildvariants: - ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - - "test_serverless_task_group" - - "test_serverless_proxy_task_group" - "test-atlas-data-lake" # Test MongoDB 5.0 and 6.0 @@ -140,8 +136,6 @@ buildvariants: - ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - - "test_serverless_task_group" - - "test_serverless_proxy_task_group" - "test-atlas-data-lake" # Test MongoDB 5.0 and 6.0 @@ -201,8 +195,6 @@ buildvariants: - ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - - "test_serverless_task_group" - - "test_serverless_proxy_task_group" - "test-atlas-data-lake" # Test MongoDB 5.0 and 6.0 diff --git a/.evergreen/config/generated/test-variant/phpc.yml b/.evergreen/config/generated/test-variant/phpc.yml index df1ebb2d2..f6cc2d679 100644 --- a/.evergreen/config/generated/test-variant/phpc.yml +++ b/.evergreen/config/generated/test-variant/phpc.yml @@ -17,8 +17,6 @@ buildvariants: - ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - - "test_serverless_task_group" - - "test_serverless_proxy_task_group" - "test-atlas-data-lake" - name: test-debian12-php-8.4-phpc-next-minor @@ -37,6 +35,4 @@ buildvariants: - ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - - "test_serverless_task_group" - - "test_serverless_proxy_task_group" - "test-atlas-data-lake" diff --git a/.evergreen/config/templates/test-variant/modern-php-full.yml b/.evergreen/config/templates/test-variant/modern-php-full.yml index 449e952b8..3aad2639f 100644 --- a/.evergreen/config/templates/test-variant/modern-php-full.yml +++ b/.evergreen/config/templates/test-variant/modern-php-full.yml @@ -16,8 +16,6 @@ - ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - - "test_serverless_task_group" - - "test_serverless_proxy_task_group" - "test-atlas-data-lake" # Test MongoDB 5.0 and 6.0 diff --git a/.evergreen/config/templates/test-variant/phpc.yml b/.evergreen/config/templates/test-variant/phpc.yml index 4bb6e3914..235f24b4b 100644 --- a/.evergreen/config/templates/test-variant/phpc.yml +++ b/.evergreen/config/templates/test-variant/phpc.yml @@ -15,8 +15,6 @@ - ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - - "test_serverless_task_group" - - "test_serverless_proxy_task_group" - "test-atlas-data-lake" - name: test-debian12-php-%phpVersion%-phpc-next-minor @@ -35,6 +33,4 @@ - ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0" - - "test_serverless_task_group" - - "test_serverless_proxy_task_group" - "test-atlas-data-lake" diff --git a/.evergreen/config/test-task-groups.yml b/.evergreen/config/test-task-groups.yml index 4a83bac2c..06f159ac2 100644 --- a/.evergreen/config/test-task-groups.yml +++ b/.evergreen/config/test-task-groups.yml @@ -37,41 +37,3 @@ task_groups: setup_group_timeout_secs: 1800 tasks: - test-atlas - - - name: test_serverless_task_group - setup_group: - - func: "fetch source" - - func: "prepare resources" - - func: "fix absolute paths" - - func: "install dependencies" - - func: "locate PHP binaries" - - func: "fetch extension" - - func: "install composer" - - func: "create serverless instance" - teardown_group: - - func: "delete serverless instance" - - func: "upload test results" - - func: "cleanup" - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - test-serverless - - - name: test_serverless_proxy_task_group - setup_group: - - func: "fetch source" - - func: "prepare resources" - - func: "fix absolute paths" - - func: "install dependencies" - - func: "locate PHP binaries" - - func: "fetch extension" - - func: "install composer" - - func: "create serverless proxy instance" - teardown_group: - - func: "delete serverless instance" - - func: "upload test results" - - func: "cleanup" - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - test-serverless-proxy diff --git a/.evergreen/config/test-tasks.yml b/.evergreen/config/test-tasks.yml index ae1ef37cf..1ed40a32d 100644 --- a/.evergreen/config/test-tasks.yml +++ b/.evergreen/config/test-tasks.yml @@ -7,24 +7,6 @@ tasks: vars: TESTS: "atlas" - - name: "test-serverless" - tags: ["serverless"] - exec_timeout_secs: 10800 - patch_only: true - commands: - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run serverless tests" - - - name: "test-serverless-proxy" - tags: ["serverless"] - exec_timeout_secs: 10800 - patch_only: true - commands: - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run serverless tests" - - name: "test-atlas-data-lake" commands: - command: ec2.assume_role diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index d5344791e..497ad89dd 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -102,10 +102,6 @@ case "$TESTS" in php vendor/bin/phpunit $PHPUNIT_OPTS --group versioned-api ;; - serverless) - php vendor/bin/phpunit $PHPUNIT_OPTS --group serverless - ;; - *) php vendor/bin/phpunit $PHPUNIT_OPTS ;; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6ddeaac83..40f94eef6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,8 +35,7 @@ The `phpunit.xml.dist` file is used as the default configuration file for the test suite. In addition to various PHPUnit options, it defines environment variables such as `MONGODB_URI` and `MONGODB_DATABASE`. You may customize this configuration by creating your own `phpunit.xml` file based on the -`phpunit.xml.dist` file we provide. To run the tests in serverless mode, set the -`MONGODB_IS_SERVERLESS` environment variable to `on`. +`phpunit.xml.dist` file we provide. To run tests against a cluster that requires authentication, either include the credentials in the connection string (i.e. `MONGODB_URI`) or set the @@ -66,12 +65,6 @@ The following environment variable is used for [stable API testing](https://gith which will then be specified as the `serverApi` driver option for clients created by the test suite. -The following environment variable is used for [serverless testing](https://github.com/mongodb/specifications/blob/master/source/serverless-testing/README.rst): - - * `MONGODB_IS_SERVERLESS`: Specify a true boolean string - (see: [`FILTER_VALIDATE_BOOLEAN`](https://www.php.net/manual/en/filter.filters.validate.php)) - if `MONGODB_URI` points to a serverless instance. Defaults to false. - The following environment variables are used for [load balancer testing](https://github.com/mongodb/specifications/blob/master/source/load-balancers/tests/README.rst): * `MONGODB_SINGLE_MONGOS_LB_URI`: Connection string to a load balancer backed diff --git a/tests/FunctionalTestCase.php b/tests/FunctionalTestCase.php index f8a179bc5..aa314a230 100644 --- a/tests/FunctionalTestCase.php +++ b/tests/FunctionalTestCase.php @@ -24,7 +24,6 @@ use function count; use function current; use function explode; -use function filter_var; use function getenv; use function implode; use function in_array; @@ -46,7 +45,6 @@ use function version_compare; use const DIRECTORY_SEPARATOR; -use const FILTER_VALIDATE_BOOLEAN; use const INFO_MODULES; use const PATH_SEPARATOR; @@ -413,16 +411,6 @@ protected function isStandalone() return $this->getPrimaryServer()->getType() == Server::TYPE_STANDALONE; } - /** - * Return whether serverless (i.e. proxy as mongos) is being utilized. - */ - protected static function isServerless(): bool - { - $isServerless = getenv('MONGODB_IS_SERVERLESS'); - - return $isServerless !== false ? filter_var($isServerless, FILTER_VALIDATE_BOOLEAN) : false; - } - protected function isShardedCluster() { $type = $this->getPrimaryServer()->getType(); diff --git a/tests/SpecTests/ClientSideEncryption/Prose21_AutomaticDataEncryptionKeysTest.php b/tests/SpecTests/ClientSideEncryption/Prose21_AutomaticDataEncryptionKeysTest.php index e5d8e72d5..ee4d61b1a 100644 --- a/tests/SpecTests/ClientSideEncryption/Prose21_AutomaticDataEncryptionKeysTest.php +++ b/tests/SpecTests/ClientSideEncryption/Prose21_AutomaticDataEncryptionKeysTest.php @@ -21,7 +21,6 @@ * @see https://github.com/mongodb/specifications/tree/master/source/client-side-encryption/tests#automatic-data-encryption-keys */ #[Group('csfle')] -#[Group('serverless')] class Prose21_AutomaticDataEncryptionKeysTest extends FunctionalTestCase { public const SERVER_ERROR_TYPEMISMATCH = 14; diff --git a/tests/SpecTests/ClientSideEncryption/Prose22_RangeExplicitEncryptionTest.php b/tests/SpecTests/ClientSideEncryption/Prose22_RangeExplicitEncryptionTest.php index 946b6b785..f030c8b36 100644 --- a/tests/SpecTests/ClientSideEncryption/Prose22_RangeExplicitEncryptionTest.php +++ b/tests/SpecTests/ClientSideEncryption/Prose22_RangeExplicitEncryptionTest.php @@ -30,7 +30,6 @@ * @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#22-range-explicit-encryption */ #[Group('csfle')] -#[Group('serverless')] class Prose22_RangeExplicitEncryptionTest extends FunctionalTestCase { private ?ClientEncryption $clientEncryption = null; diff --git a/tests/SpecTests/ClientSideEncryptionSpecTest.php b/tests/SpecTests/ClientSideEncryptionSpecTest.php index 0a3783354..bba651559 100644 --- a/tests/SpecTests/ClientSideEncryptionSpecTest.php +++ b/tests/SpecTests/ClientSideEncryptionSpecTest.php @@ -53,7 +53,6 @@ * @see https://github.com/mongodb/specifications/tree/master/source/client-side-encryption */ #[Group('csfle')] -#[Group('serverless')] class ClientSideEncryptionSpecTest extends FunctionalTestCase { public const LOCAL_MASTERKEY = 'Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk'; diff --git a/tests/SpecTests/Crud/Prose11_BulkWriteBatchSplitsWhenNamespaceExceedsMessageSizeTest.php b/tests/SpecTests/Crud/Prose11_BulkWriteBatchSplitsWhenNamespaceExceedsMessageSizeTest.php index a44986217..ae6a46d5d 100644 --- a/tests/SpecTests/Crud/Prose11_BulkWriteBatchSplitsWhenNamespaceExceedsMessageSizeTest.php +++ b/tests/SpecTests/Crud/Prose11_BulkWriteBatchSplitsWhenNamespaceExceedsMessageSizeTest.php @@ -27,10 +27,6 @@ public function setUp(): void { parent::setUp(); - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); $this->client = self::createTestClient(); diff --git a/tests/SpecTests/Crud/Prose12_BulkWriteExceedsMaxMessageSizeBytesTest.php b/tests/SpecTests/Crud/Prose12_BulkWriteExceedsMaxMessageSizeBytesTest.php index 7fa0c6f30..4fbe5adcd 100644 --- a/tests/SpecTests/Crud/Prose12_BulkWriteExceedsMaxMessageSizeBytesTest.php +++ b/tests/SpecTests/Crud/Prose12_BulkWriteExceedsMaxMessageSizeBytesTest.php @@ -19,10 +19,6 @@ public function setUp(): void { parent::setUp(); - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); } diff --git a/tests/SpecTests/Crud/Prose13_BulkWriteUnsupportedForAutoEncryptionTest.php b/tests/SpecTests/Crud/Prose13_BulkWriteUnsupportedForAutoEncryptionTest.php index d9b6b70a7..c59078f5f 100644 --- a/tests/SpecTests/Crud/Prose13_BulkWriteUnsupportedForAutoEncryptionTest.php +++ b/tests/SpecTests/Crud/Prose13_BulkWriteUnsupportedForAutoEncryptionTest.php @@ -15,10 +15,6 @@ class Prose13_BulkWriteUnsupportedForAutoEncryptionTest extends FunctionalTestCa { public function testErrorIfAutoEncryptionIsConfigured(): void { - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); $this->skipIfClientSideEncryptionIsNotSupported(); diff --git a/tests/SpecTests/Crud/Prose15_BulkWriteUnacknowledgedWriteConcernTest.php b/tests/SpecTests/Crud/Prose15_BulkWriteUnacknowledgedWriteConcernTest.php index f35433dac..f7aa6b5bc 100644 --- a/tests/SpecTests/Crud/Prose15_BulkWriteUnacknowledgedWriteConcernTest.php +++ b/tests/SpecTests/Crud/Prose15_BulkWriteUnacknowledgedWriteConcernTest.php @@ -21,10 +21,6 @@ class Prose15_BulkWriteUnacknowledgedWriteConcernTest extends FunctionalTestCase { public function testUnacknowledgedWriteConcern(): void { - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); $client = self::createTestClient(); diff --git a/tests/SpecTests/Crud/Prose3_BulkWriteSplitsOnMaxWriteBatchSizeTest.php b/tests/SpecTests/Crud/Prose3_BulkWriteSplitsOnMaxWriteBatchSizeTest.php index 94e158423..4173bffcf 100644 --- a/tests/SpecTests/Crud/Prose3_BulkWriteSplitsOnMaxWriteBatchSizeTest.php +++ b/tests/SpecTests/Crud/Prose3_BulkWriteSplitsOnMaxWriteBatchSizeTest.php @@ -18,10 +18,6 @@ class Prose3_BulkWriteSplitsOnMaxWriteBatchSizeTest extends FunctionalTestCase { public function testSplitOnMaxWriteBatchSize(): void { - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); $client = self::createTestClient(); diff --git a/tests/SpecTests/Crud/Prose4_BulkWriteSplitsOnMaxMessageSizeBytesTest.php b/tests/SpecTests/Crud/Prose4_BulkWriteSplitsOnMaxMessageSizeBytesTest.php index 2b45a5999..74678cedc 100644 --- a/tests/SpecTests/Crud/Prose4_BulkWriteSplitsOnMaxMessageSizeBytesTest.php +++ b/tests/SpecTests/Crud/Prose4_BulkWriteSplitsOnMaxMessageSizeBytesTest.php @@ -20,10 +20,6 @@ class Prose4_BulkWriteSplitsOnMaxMessageSizeBytesTest extends FunctionalTestCase { public function testSplitOnMaxWriteBatchSize(): void { - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); $client = self::createTestClient(); diff --git a/tests/SpecTests/Crud/Prose5_BulkWriteCollectsWriteConcernErrorsAcrossBatchesTest.php b/tests/SpecTests/Crud/Prose5_BulkWriteCollectsWriteConcernErrorsAcrossBatchesTest.php index 727347a95..8a0943db7 100644 --- a/tests/SpecTests/Crud/Prose5_BulkWriteCollectsWriteConcernErrorsAcrossBatchesTest.php +++ b/tests/SpecTests/Crud/Prose5_BulkWriteCollectsWriteConcernErrorsAcrossBatchesTest.php @@ -19,10 +19,6 @@ class Prose5_BulkWriteCollectsWriteConcernErrorsAcrossBatchesTest extends Functi { public function testCollectWriteConcernErrors(): void { - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); $client = self::createTestClient(null, ['retryWrites' => false]); diff --git a/tests/SpecTests/Crud/Prose6_BulkWriteHandlesWriteErrorsAcrossBatchesTest.php b/tests/SpecTests/Crud/Prose6_BulkWriteHandlesWriteErrorsAcrossBatchesTest.php index 975147e4f..8ea8bcf05 100644 --- a/tests/SpecTests/Crud/Prose6_BulkWriteHandlesWriteErrorsAcrossBatchesTest.php +++ b/tests/SpecTests/Crud/Prose6_BulkWriteHandlesWriteErrorsAcrossBatchesTest.php @@ -21,10 +21,6 @@ public function setUp(): void { parent::setUp(); - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); } diff --git a/tests/SpecTests/Crud/Prose7_BulkWriteHandlesCursorRequiringGetMoreTest.php b/tests/SpecTests/Crud/Prose7_BulkWriteHandlesCursorRequiringGetMoreTest.php index 1171c3998..29149babe 100644 --- a/tests/SpecTests/Crud/Prose7_BulkWriteHandlesCursorRequiringGetMoreTest.php +++ b/tests/SpecTests/Crud/Prose7_BulkWriteHandlesCursorRequiringGetMoreTest.php @@ -20,10 +20,6 @@ class Prose7_BulkWriteHandlesCursorRequiringGetMoreTest extends FunctionalTestCa { public function testHandlesCursor(): void { - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); $client = self::createTestClient(); diff --git a/tests/SpecTests/Crud/Prose8_BulkWriteHandlesCursorRequiringGetMoreWithinTransactionTest.php b/tests/SpecTests/Crud/Prose8_BulkWriteHandlesCursorRequiringGetMoreWithinTransactionTest.php index d6b3290ae..3c4d64d98 100644 --- a/tests/SpecTests/Crud/Prose8_BulkWriteHandlesCursorRequiringGetMoreWithinTransactionTest.php +++ b/tests/SpecTests/Crud/Prose8_BulkWriteHandlesCursorRequiringGetMoreWithinTransactionTest.php @@ -20,10 +20,6 @@ class Prose8_BulkWriteHandlesCursorRequiringGetMoreWithinTransactionTest extends { public function testHandlesCursorWithinTransaction(): void { - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); $this->skipIfTransactionsAreNotSupported(); diff --git a/tests/SpecTests/Crud/Prose9_BulkWriteHandlesGetMoreErrorTest.php b/tests/SpecTests/Crud/Prose9_BulkWriteHandlesGetMoreErrorTest.php index d65cf0b05..903bf486b 100644 --- a/tests/SpecTests/Crud/Prose9_BulkWriteHandlesGetMoreErrorTest.php +++ b/tests/SpecTests/Crud/Prose9_BulkWriteHandlesGetMoreErrorTest.php @@ -23,10 +23,6 @@ class Prose9_BulkWriteHandlesGetMoreErrorTest extends FunctionalTestCase public function testHandlesGetMoreError(): void { - if ($this->isServerless()) { - $this->markTestSkipped('bulkWrite command is not supported'); - } - $this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported'); $client = self::createTestClient(); diff --git a/tests/SpecTests/FunctionalTestCase.php b/tests/SpecTests/FunctionalTestCase.php index ce2b815d5..69ffcf3cf 100644 --- a/tests/SpecTests/FunctionalTestCase.php +++ b/tests/SpecTests/FunctionalTestCase.php @@ -277,12 +277,7 @@ private function isServerlessRequirementSatisfied(?string $serverlessMode): bool return true; } - return match ($serverlessMode) { - self::SERVERLESS_ALLOW => true, - self::SERVERLESS_FORBID => ! static::isServerless(), - self::SERVERLESS_REQUIRE => static::isServerless(), - default => throw new UnexpectedValueException(sprintf('Invalid serverless requirement "%s" found.', $serverlessMode)), - }; + return $serverlessMode !== self::SERVERLESS_REQUIRE; } /** diff --git a/tests/SpecTests/RetryableWrites/Prose3_ReturnOriginalErrorTest.php b/tests/SpecTests/RetryableWrites/Prose3_ReturnOriginalErrorTest.php index 06c35c825..55afae5e0 100644 --- a/tests/SpecTests/RetryableWrites/Prose3_ReturnOriginalErrorTest.php +++ b/tests/SpecTests/RetryableWrites/Prose3_ReturnOriginalErrorTest.php @@ -8,14 +8,12 @@ use MongoDB\Driver\Monitoring\CommandSubscriber; use MongoDB\Driver\Monitoring\CommandSucceededEvent; use MongoDB\Tests\SpecTests\FunctionalTestCase; -use PHPUnit\Framework\Attributes\Group; /** * Prose test 3: Return Original Error * * @see https://github.com/mongodb/specifications/blob/master/source/retryable-writes/tests/README.md */ -#[Group('serverless')] class Prose3_ReturnOriginalErrorTest extends FunctionalTestCase { public const NOT_WRITABLE_PRIMARY = 10107; diff --git a/tests/UnifiedSpecTests/RunOnRequirement.php b/tests/UnifiedSpecTests/RunOnRequirement.php index ba00e15a8..9dff581db 100644 --- a/tests/UnifiedSpecTests/RunOnRequirement.php +++ b/tests/UnifiedSpecTests/RunOnRequirement.php @@ -104,7 +104,7 @@ public function __construct(stdClass $o) } } - public function isSatisfied(string $serverVersion, string $topology, ServerParameterHelper $serverParameters, bool $isAuthenticated, bool $isServerless, bool $isClientSideEncryptionSupported): bool + public function isSatisfied(string $serverVersion, string $topology, ServerParameterHelper $serverParameters, bool $isAuthenticated, bool $isClientSideEncryptionSupported): bool { if (isset($this->minServerVersion) && version_compare($serverVersion, $this->minServerVersion, '<')) { return false; @@ -131,14 +131,8 @@ public function isSatisfied(string $serverVersion, string $topology, ServerParam return false; } - if (isset($this->serverless)) { - if (! $isServerless && $this->serverless === self::SERVERLESS_REQUIRE) { - return false; - } - - if ($isServerless && $this->serverless === self::SERVERLESS_FORBID) { - return false; - } + if (isset($this->serverless) && $this->serverless === self::SERVERLESS_REQUIRE) { + return false; } if (isset($this->csfle) && $isClientSideEncryptionSupported !== $this->csfle) { diff --git a/tests/UnifiedSpecTests/UnifiedSpecTest.php b/tests/UnifiedSpecTests/UnifiedSpecTest.php index d057c5420..947469a50 100644 --- a/tests/UnifiedSpecTests/UnifiedSpecTest.php +++ b/tests/UnifiedSpecTests/UnifiedSpecTest.php @@ -130,7 +130,6 @@ public static function provideAtlasDataLakeTests(): Generator } #[DataProvider('provideChangeStreamsTests')] - #[Group('serverless')] public function testChangeStreams(UnifiedTestCase $test): void { self::$runner->run($test); @@ -143,7 +142,6 @@ public static function provideChangeStreamsTests(): Generator #[DataProvider('provideClientSideEncryptionTests')] #[Group('csfle')] - #[Group('serverless')] public function testClientSideEncryption(UnifiedTestCase $test): void { self::$runner->run($test); @@ -155,7 +153,6 @@ public static function provideClientSideEncryptionTests(): Generator } #[DataProvider('provideCollectionManagementTests')] - #[Group('serverless')] public function testCollectionManagement(UnifiedTestCase $test): void { self::$runner->run($test); @@ -167,7 +164,6 @@ public static function provideCollectionManagementTests(): Generator } #[DataProvider('provideCommandMonitoringTests')] - #[Group('serverless')] public function testCommandMonitoring(UnifiedTestCase $test): void { self::$runner->run($test); @@ -179,7 +175,6 @@ public static function provideCommandMonitoringTests(): Generator } #[DataProvider('provideCrudTests')] - #[Group('serverless')] public function testCrud(UnifiedTestCase $test): void { self::$runner->run($test); @@ -191,7 +186,6 @@ public static function provideCrudTests(): Generator } #[DataProvider('provideGridFSTests')] - #[Group('serverless')] public function testGridFS(UnifiedTestCase $test): void { self::$runner->run($test); @@ -203,7 +197,6 @@ public static function provideGridFSTests(): Generator } #[DataProvider('provideLoadBalancers')] - #[Group('serverless')] public function testLoadBalancers(UnifiedTestCase $test): void { self::$runner->run($test); @@ -226,7 +219,6 @@ public static function provideReadWriteConcernTests(): Generator } #[DataProvider('provideRetryableReadsTests')] - #[Group('serverless')] public function testRetryableReads(UnifiedTestCase $test): void { self::$runner->run($test); @@ -238,7 +230,6 @@ public static function provideRetryableReadsTests(): Generator } #[DataProvider('provideRetryableWritesTests')] - #[Group('serverless')] public function testRetryableWrites(UnifiedTestCase $test): void { self::$runner->run($test); @@ -250,7 +241,6 @@ public static function provideRetryableWritesTests(): Generator } #[DataProvider('provideRunCommandTests')] - #[Group('serverless')] public function testRunCommand(UnifiedTestCase $test): void { self::$runner->run($test); @@ -262,7 +252,6 @@ public static function provideRunCommandTests(): Generator } #[DataProvider('provideSessionsTests')] - #[Group('serverless')] public function testSessions(UnifiedTestCase $test): void { self::$runner->run($test); @@ -274,7 +263,6 @@ public static function provideSessionsTests(): Generator } #[DataProvider('provideTransactionsTests')] - #[Group('serverless')] public function testTransactions(UnifiedTestCase $test): void { self::$runner->run($test); @@ -297,7 +285,6 @@ public static function provideTransactionsConvenientApiTests(): Generator } #[DataProvider('provideVersionedApiTests')] - #[Group('serverless')] #[Group('versioned-api')] public function testVersionedApi(UnifiedTestCase $test): void { diff --git a/tests/UnifiedSpecTests/UnifiedTestRunner.php b/tests/UnifiedSpecTests/UnifiedTestRunner.php index 6b700f49e..c16eab6e3 100644 --- a/tests/UnifiedSpecTests/UnifiedTestRunner.php +++ b/tests/UnifiedSpecTests/UnifiedTestRunner.php @@ -20,7 +20,6 @@ use function call_user_func; use function count; use function explode; -use function filter_var; use function gc_collect_cycles; use function getenv; use function implode; @@ -41,8 +40,6 @@ use function substr_replace; use function version_compare; -use const FILTER_VALIDATE_BOOLEAN; - /** * Unified test runner. * @@ -92,7 +89,7 @@ public function __construct(private string $internalClientUri) * * Atlas Data Lake also does not support killAllSessions. */ - if ($this->isServerless() || FunctionalTestCase::isAtlas($internalClientUri) || $this->isAtlasDataLake()) { + if (FunctionalTestCase::isAtlas($internalClientUri) || $this->isAtlasDataLake()) { $this->allowKillAllSessions = false; } @@ -252,7 +249,6 @@ private function checkRunOnRequirements(array $runOnRequirements): void $this->getTopology(), $this->serverParameterHelper, $this->isAuthenticated(), - $this->isServerless(), $this->isClientSideEncryptionSupported(), ]; } @@ -321,10 +317,6 @@ private function isAtlasDataLake(): bool /** * Return whether the connection is authenticated. - * - * Note: if the connectionStatus command is not portable for serverless, it - * may be necessary to rewrite this to instead inspect the connection string - * or consult an environment variable, as is done in libmongoc. */ private function isAuthenticated(): bool { @@ -358,16 +350,6 @@ private function isClientSideEncryptionSupported(): bool return FunctionalTestCase::isCryptSharedLibAvailable() || FunctionalTestCase::isMongocryptdAvailable(); } - /** - * Return whether serverless (i.e. proxy as mongos) is being utilized. - */ - private function isServerless(): bool - { - $isServerless = getenv('MONGODB_IS_SERVERLESS'); - - return $isServerless !== false ? filter_var($isServerless, FILTER_VALIDATE_BOOLEAN) : false; - } - /** * Checks is a test format schema version is supported. */ @@ -535,7 +517,7 @@ private function createContext(): Context $context->setUrisForUseMultipleMongoses($singleMongosUri, $multiMongosUri); } - if ($this->getPrimaryServer()->getType() === Server::TYPE_LOAD_BALANCER && ! $this->isServerless()) { + if ($this->getPrimaryServer()->getType() === Server::TYPE_LOAD_BALANCER) { $singleMongosUri = getenv('MONGODB_SINGLE_MONGOS_LB_URI'); $multiMongosUri = getenv('MONGODB_MULTI_MONGOS_LB_URI');