Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 62a321e

Browse files
authoredJun 4, 2025··
Merge v1.21 into v2.1 (#1721)
2 parents da665bb + e052367 commit 62a321e

29 files changed

+7
-263
lines changed
 

‎.evergreen/config/functions.yml

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -172,38 +172,6 @@ functions:
172172
DRIVERS_TOOLS="${DRIVERS_TOOLS}" \
173173
bash ./run-mongohouse-image.sh
174174
175-
"create serverless instance":
176-
- command: subprocess.exec
177-
params:
178-
working_dir: "src"
179-
binary: bash
180-
args:
181-
- ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
182-
- command: expansions.update
183-
params:
184-
file: src/serverless-expansion.yml
185-
186-
"create serverless proxy instance":
187-
- command: shell.exec
188-
params:
189-
working_dir: "src"
190-
script: |
191-
${PREPARE_SHELL}
192-
193-
VAULT_NAME=serverless_next \
194-
bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
195-
- command: expansions.update
196-
params:
197-
file: src/serverless-expansion.yml
198-
199-
"delete serverless instance":
200-
- command: subprocess.exec
201-
params:
202-
working_dir: "src"
203-
binary: bash
204-
args:
205-
- ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh
206-
207175
"run tests":
208176
- command: shell.exec
209177
type: test
@@ -252,42 +220,6 @@ functions:
252220
TESTS="atlas-data-lake" \
253221
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
254222
255-
"run serverless tests":
256-
- command: shell.exec
257-
type: test
258-
params:
259-
working_dir: "src"
260-
script: |
261-
${PREPARE_SHELL}
262-
export AWS_ACCESS_KEY_ID="${client_side_encryption_aws_access_key_id}"
263-
export AWS_SECRET_ACCESS_KEY="${client_side_encryption_aws_secret_access_key}"
264-
export AWS_TEMP_ACCESS_KEY_ID="${client_side_encryption_aws_temp_access_key_id}"
265-
export AWS_TEMP_SECRET_ACCESS_KEY="${client_side_encryption_aws_temp_secret_access_key_key}"
266-
export AWS_TEMP_SESSION_TOKEN="${client_side_encryption_aws_temp_session_token}"
267-
export AZURE_TENANT_ID="${client_side_encryption_azure_tenant_id}"
268-
export AZURE_CLIENT_ID="${client_side_encryption_azure_client_id}"
269-
export AZURE_CLIENT_SECRET="${client_side_encryption_azure_client_secret}"
270-
export GCP_EMAIL="${client_side_encryption_gcp_email}"
271-
export GCP_PRIVATE_KEY="${client_side_encryption_gcp_privatekey}"
272-
export KMIP_ENDPOINT="${client_side_encryption_kmip_endpoint}"
273-
export KMS_ENDPOINT_EXPIRED="${client_side_encryption_kms_endpoint_expired}"
274-
export KMS_ENDPOINT_WRONG_HOST="${client_side_encryption_kms_endpoint_wrong_host}"
275-
export KMS_ENDPOINT_REQUIRE_CLIENT_CERT="${client_side_encryption_kms_endpoint_require_client_cert}"
276-
export KMS_TLS_CA_FILE="${client_side_encryption_kms_tls_ca_file}"
277-
export KMS_TLS_CERTIFICATE_KEY_FILE="${client_side_encryption_kms_tls_certificate_key_file}"
278-
export MONGODB_IS_SERVERLESS=on
279-
export PATH="${PHP_PATH}/bin:$PATH"
280-
281-
. ${DRIVERS_TOOLS}/.evergreen/serverless/secrets-export.sh
282-
283-
export MONGODB_USERNAME=$SERVERLESS_ATLAS_USER
284-
export MONGODB_PASSWORD=$SERVERLESS_ATLAS_PASSWORD
285-
286-
CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \
287-
MONGODB_URI="${SERVERLESS_URI}" \
288-
TESTS="serverless" \
289-
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
290-
291223
"cleanup":
292224
- command: shell.exec
293225
params:

‎.evergreen/config/generated/test-variant/modern-php-full.yml

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.evergreen/config/generated/test-variant/phpc.yml

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.evergreen/config/templates/test-variant/modern-php-full.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
- ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0"
1717
- ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0"
1818
- ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0"
19-
- "test_serverless_task_group"
20-
- "test_serverless_proxy_task_group"
2119
- "test-atlas-data-lake"
2220

2321
# Test MongoDB 5.0 and 6.0

‎.evergreen/config/templates/test-variant/phpc.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
- ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0"
1616
- ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0"
1717
- ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0"
18-
- "test_serverless_task_group"
19-
- "test_serverless_proxy_task_group"
2018
- "test-atlas-data-lake"
2119

2220
- name: test-debian12-php-%phpVersion%-phpc-next-minor
@@ -35,6 +33,4 @@
3533
- ".replicaset .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0"
3634
- ".sharded .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0"
3735
- ".loadbalanced .local !.csfle !.4.2 !.4.4 !.5.0 !.6.0"
38-
- "test_serverless_task_group"
39-
- "test_serverless_proxy_task_group"
4036
- "test-atlas-data-lake"

‎.evergreen/config/test-task-groups.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -37,41 +37,3 @@ task_groups:
3737
setup_group_timeout_secs: 1800
3838
tasks:
3939
- test-atlas
40-
41-
- name: test_serverless_task_group
42-
setup_group:
43-
- func: "fetch source"
44-
- func: "prepare resources"
45-
- func: "fix absolute paths"
46-
- func: "install dependencies"
47-
- func: "locate PHP binaries"
48-
- func: "fetch extension"
49-
- func: "install composer"
50-
- func: "create serverless instance"
51-
teardown_group:
52-
- func: "delete serverless instance"
53-
- func: "upload test results"
54-
- func: "cleanup"
55-
setup_group_can_fail_task: true
56-
setup_group_timeout_secs: 1800
57-
tasks:
58-
- test-serverless
59-
60-
- name: test_serverless_proxy_task_group
61-
setup_group:
62-
- func: "fetch source"
63-
- func: "prepare resources"
64-
- func: "fix absolute paths"
65-
- func: "install dependencies"
66-
- func: "locate PHP binaries"
67-
- func: "fetch extension"
68-
- func: "install composer"
69-
- func: "create serverless proxy instance"
70-
teardown_group:
71-
- func: "delete serverless instance"
72-
- func: "upload test results"
73-
- func: "cleanup"
74-
setup_group_can_fail_task: true
75-
setup_group_timeout_secs: 1800
76-
tasks:
77-
- test-serverless-proxy

‎.evergreen/config/test-tasks.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,6 @@ tasks:
77
vars:
88
TESTS: "atlas"
99

10-
- name: "test-serverless"
11-
tags: ["serverless"]
12-
exec_timeout_secs: 10800
13-
patch_only: true
14-
commands:
15-
- func: "start kms servers"
16-
- func: "set aws temp creds"
17-
- func: "run serverless tests"
18-
19-
- name: "test-serverless-proxy"
20-
tags: ["serverless"]
21-
exec_timeout_secs: 10800
22-
patch_only: true
23-
commands:
24-
- func: "start kms servers"
25-
- func: "set aws temp creds"
26-
- func: "run serverless tests"
27-
2810
- name: "test-atlas-data-lake"
2911
commands:
3012
- command: ec2.assume_role

‎.evergreen/run-tests.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ case "$TESTS" in
102102
php vendor/bin/phpunit $PHPUNIT_OPTS --group versioned-api
103103
;;
104104

105-
serverless)
106-
php vendor/bin/phpunit $PHPUNIT_OPTS --group serverless
107-
;;
108-
109105
*)
110106
php vendor/bin/phpunit $PHPUNIT_OPTS
111107
;;

‎CONTRIBUTING.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ The `phpunit.xml.dist` file is used as the default configuration file for the
3535
test suite. In addition to various PHPUnit options, it defines environment
3636
variables such as `MONGODB_URI` and `MONGODB_DATABASE`. You may customize
3737
this configuration by creating your own `phpunit.xml` file based on the
38-
`phpunit.xml.dist` file we provide. To run the tests in serverless mode, set the
39-
`MONGODB_IS_SERVERLESS` environment variable to `on`.
38+
`phpunit.xml.dist` file we provide.
4039

4140
To run tests against a cluster that requires authentication, either include the
4241
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
6665
which will then be specified as the `serverApi` driver option for clients
6766
created by the test suite.
6867

69-
The following environment variable is used for [serverless testing](https://github.com/mongodb/specifications/blob/master/source/serverless-testing/README.rst):
70-
71-
* `MONGODB_IS_SERVERLESS`: Specify a true boolean string
72-
(see: [`FILTER_VALIDATE_BOOLEAN`](https://www.php.net/manual/en/filter.filters.validate.php))
73-
if `MONGODB_URI` points to a serverless instance. Defaults to false.
74-
7568
The following environment variables are used for [load balancer testing](https://github.com/mongodb/specifications/blob/master/source/load-balancers/tests/README.rst):
7669

7770
* `MONGODB_SINGLE_MONGOS_LB_URI`: Connection string to a load balancer backed

‎tests/FunctionalTestCase.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use function count;
2525
use function current;
2626
use function explode;
27-
use function filter_var;
2827
use function getenv;
2928
use function implode;
3029
use function in_array;
@@ -46,7 +45,6 @@
4645
use function version_compare;
4746

4847
use const DIRECTORY_SEPARATOR;
49-
use const FILTER_VALIDATE_BOOLEAN;
5048
use const INFO_MODULES;
5149
use const PATH_SEPARATOR;
5250

@@ -413,16 +411,6 @@ protected function isStandalone()
413411
return $this->getPrimaryServer()->getType() == Server::TYPE_STANDALONE;
414412
}
415413

416-
/**
417-
* Return whether serverless (i.e. proxy as mongos) is being utilized.
418-
*/
419-
protected static function isServerless(): bool
420-
{
421-
$isServerless = getenv('MONGODB_IS_SERVERLESS');
422-
423-
return $isServerless !== false ? filter_var($isServerless, FILTER_VALIDATE_BOOLEAN) : false;
424-
}
425-
426414
protected function isShardedCluster()
427415
{
428416
$type = $this->getPrimaryServer()->getType();

‎tests/SpecTests/ClientSideEncryption/Prose21_AutomaticDataEncryptionKeysTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
* @see https://github.com/mongodb/specifications/tree/master/source/client-side-encryption/tests#automatic-data-encryption-keys
2222
*/
2323
#[Group('csfle')]
24-
#[Group('serverless')]
2524
class Prose21_AutomaticDataEncryptionKeysTest extends FunctionalTestCase
2625
{
2726
public const SERVER_ERROR_TYPEMISMATCH = 14;

‎tests/SpecTests/ClientSideEncryption/Prose22_RangeExplicitEncryptionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
* @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#22-range-explicit-encryption
3131
*/
3232
#[Group('csfle')]
33-
#[Group('serverless')]
3433
class Prose22_RangeExplicitEncryptionTest extends FunctionalTestCase
3534
{
3635
private ?ClientEncryption $clientEncryption = null;

‎tests/SpecTests/ClientSideEncryptionSpecTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
* @see https://github.com/mongodb/specifications/tree/master/source/client-side-encryption
5454
*/
5555
#[Group('csfle')]
56-
#[Group('serverless')]
5756
class ClientSideEncryptionSpecTest extends FunctionalTestCase
5857
{
5958
public const LOCAL_MASTERKEY = 'Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk';

‎tests/SpecTests/Crud/Prose11_BulkWriteBatchSplitsWhenNamespaceExceedsMessageSizeTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ public function setUp(): void
2727
{
2828
parent::setUp();
2929

30-
if ($this->isServerless()) {
31-
$this->markTestSkipped('bulkWrite command is not supported');
32-
}
33-
3430
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
3531

3632
$this->client = self::createTestClient();

‎tests/SpecTests/Crud/Prose12_BulkWriteExceedsMaxMessageSizeBytesTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ public function setUp(): void
1919
{
2020
parent::setUp();
2121

22-
if ($this->isServerless()) {
23-
$this->markTestSkipped('bulkWrite command is not supported');
24-
}
25-
2622
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
2723
}
2824

‎tests/SpecTests/Crud/Prose13_BulkWriteUnsupportedForAutoEncryptionTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ class Prose13_BulkWriteUnsupportedForAutoEncryptionTest extends FunctionalTestCa
1515
{
1616
public function testErrorIfAutoEncryptionIsConfigured(): void
1717
{
18-
if ($this->isServerless()) {
19-
$this->markTestSkipped('bulkWrite command is not supported');
20-
}
21-
2218
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
2319

2420
$this->skipIfClientSideEncryptionIsNotSupported();

‎tests/SpecTests/Crud/Prose15_BulkWriteUnacknowledgedWriteConcernTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ class Prose15_BulkWriteUnacknowledgedWriteConcernTest extends FunctionalTestCase
2121
{
2222
public function testUnacknowledgedWriteConcern(): void
2323
{
24-
if ($this->isServerless()) {
25-
$this->markTestSkipped('bulkWrite command is not supported');
26-
}
27-
2824
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
2925

3026
$client = self::createTestClient();

‎tests/SpecTests/Crud/Prose3_BulkWriteSplitsOnMaxWriteBatchSizeTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ class Prose3_BulkWriteSplitsOnMaxWriteBatchSizeTest extends FunctionalTestCase
1818
{
1919
public function testSplitOnMaxWriteBatchSize(): void
2020
{
21-
if ($this->isServerless()) {
22-
$this->markTestSkipped('bulkWrite command is not supported');
23-
}
24-
2521
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
2622

2723
$client = self::createTestClient();

‎tests/SpecTests/Crud/Prose4_BulkWriteSplitsOnMaxMessageSizeBytesTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ class Prose4_BulkWriteSplitsOnMaxMessageSizeBytesTest extends FunctionalTestCase
2020
{
2121
public function testSplitOnMaxWriteBatchSize(): void
2222
{
23-
if ($this->isServerless()) {
24-
$this->markTestSkipped('bulkWrite command is not supported');
25-
}
26-
2723
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
2824

2925
$client = self::createTestClient();

‎tests/SpecTests/Crud/Prose5_BulkWriteCollectsWriteConcernErrorsAcrossBatchesTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ class Prose5_BulkWriteCollectsWriteConcernErrorsAcrossBatchesTest extends Functi
1919
{
2020
public function testCollectWriteConcernErrors(): void
2121
{
22-
if ($this->isServerless()) {
23-
$this->markTestSkipped('bulkWrite command is not supported');
24-
}
25-
2622
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
2723

2824
$client = self::createTestClient(null, ['retryWrites' => false]);

‎tests/SpecTests/Crud/Prose6_BulkWriteHandlesWriteErrorsAcrossBatchesTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ public function setUp(): void
2121
{
2222
parent::setUp();
2323

24-
if ($this->isServerless()) {
25-
$this->markTestSkipped('bulkWrite command is not supported');
26-
}
27-
2824
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
2925
}
3026

‎tests/SpecTests/Crud/Prose7_BulkWriteHandlesCursorRequiringGetMoreTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ class Prose7_BulkWriteHandlesCursorRequiringGetMoreTest extends FunctionalTestCa
2020
{
2121
public function testHandlesCursor(): void
2222
{
23-
if ($this->isServerless()) {
24-
$this->markTestSkipped('bulkWrite command is not supported');
25-
}
26-
2723
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
2824

2925
$client = self::createTestClient();

‎tests/SpecTests/Crud/Prose8_BulkWriteHandlesCursorRequiringGetMoreWithinTransactionTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ class Prose8_BulkWriteHandlesCursorRequiringGetMoreWithinTransactionTest extends
2020
{
2121
public function testHandlesCursorWithinTransaction(): void
2222
{
23-
if ($this->isServerless()) {
24-
$this->markTestSkipped('bulkWrite command is not supported');
25-
}
26-
2723
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
2824
$this->skipIfTransactionsAreNotSupported();
2925

‎tests/SpecTests/Crud/Prose9_BulkWriteHandlesGetMoreErrorTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ class Prose9_BulkWriteHandlesGetMoreErrorTest extends FunctionalTestCase
2323

2424
public function testHandlesGetMoreError(): void
2525
{
26-
if ($this->isServerless()) {
27-
$this->markTestSkipped('bulkWrite command is not supported');
28-
}
29-
3026
$this->skipIfServerVersion('<', '8.0', 'bulkWrite command is not supported');
3127

3228
$client = self::createTestClient();

‎tests/SpecTests/FunctionalTestCase.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,7 @@ private function isServerlessRequirementSatisfied(?string $serverlessMode): bool
277277
return true;
278278
}
279279

280-
return match ($serverlessMode) {
281-
self::SERVERLESS_ALLOW => true,
282-
self::SERVERLESS_FORBID => ! static::isServerless(),
283-
self::SERVERLESS_REQUIRE => static::isServerless(),
284-
default => throw new UnexpectedValueException(sprintf('Invalid serverless requirement "%s" found.', $serverlessMode)),
285-
};
280+
return $serverlessMode !== self::SERVERLESS_REQUIRE;
286281
}
287282

288283
/**

‎tests/SpecTests/RetryableWrites/Prose3_ReturnOriginalErrorTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
use MongoDB\Driver\Monitoring\CommandSubscriber;
99
use MongoDB\Driver\Monitoring\CommandSucceededEvent;
1010
use MongoDB\Tests\SpecTests\FunctionalTestCase;
11-
use PHPUnit\Framework\Attributes\Group;
1211

1312
/**
1413
* Prose test 3: Return Original Error
1514
*
1615
* @see https://github.com/mongodb/specifications/blob/master/source/retryable-writes/tests/README.md
1716
*/
18-
#[Group('serverless')]
1917
class Prose3_ReturnOriginalErrorTest extends FunctionalTestCase
2018
{
2119
public const NOT_WRITABLE_PRIMARY = 10107;

‎tests/UnifiedSpecTests/RunOnRequirement.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function __construct(stdClass $o)
104104
}
105105
}
106106

107-
public function isSatisfied(string $serverVersion, string $topology, ServerParameterHelper $serverParameters, bool $isAuthenticated, bool $isServerless, bool $isClientSideEncryptionSupported): bool
107+
public function isSatisfied(string $serverVersion, string $topology, ServerParameterHelper $serverParameters, bool $isAuthenticated, bool $isClientSideEncryptionSupported): bool
108108
{
109109
if (isset($this->minServerVersion) && version_compare($serverVersion, $this->minServerVersion, '<')) {
110110
return false;
@@ -131,14 +131,8 @@ public function isSatisfied(string $serverVersion, string $topology, ServerParam
131131
return false;
132132
}
133133

134-
if (isset($this->serverless)) {
135-
if (! $isServerless && $this->serverless === self::SERVERLESS_REQUIRE) {
136-
return false;
137-
}
138-
139-
if ($isServerless && $this->serverless === self::SERVERLESS_FORBID) {
140-
return false;
141-
}
134+
if (isset($this->serverless) && $this->serverless === self::SERVERLESS_REQUIRE) {
135+
return false;
142136
}
143137

144138
if (isset($this->csfle) && $isClientSideEncryptionSupported !== $this->csfle) {

‎tests/UnifiedSpecTests/UnifiedSpecTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ public static function provideAtlasDataLakeTests(): Generator
130130
}
131131

132132
#[DataProvider('provideChangeStreamsTests')]
133-
#[Group('serverless')]
134133
public function testChangeStreams(UnifiedTestCase $test): void
135134
{
136135
self::$runner->run($test);
@@ -143,7 +142,6 @@ public static function provideChangeStreamsTests(): Generator
143142

144143
#[DataProvider('provideClientSideEncryptionTests')]
145144
#[Group('csfle')]
146-
#[Group('serverless')]
147145
public function testClientSideEncryption(UnifiedTestCase $test): void
148146
{
149147
self::$runner->run($test);
@@ -155,7 +153,6 @@ public static function provideClientSideEncryptionTests(): Generator
155153
}
156154

157155
#[DataProvider('provideCollectionManagementTests')]
158-
#[Group('serverless')]
159156
public function testCollectionManagement(UnifiedTestCase $test): void
160157
{
161158
self::$runner->run($test);
@@ -167,7 +164,6 @@ public static function provideCollectionManagementTests(): Generator
167164
}
168165

169166
#[DataProvider('provideCommandMonitoringTests')]
170-
#[Group('serverless')]
171167
public function testCommandMonitoring(UnifiedTestCase $test): void
172168
{
173169
self::$runner->run($test);
@@ -179,7 +175,6 @@ public static function provideCommandMonitoringTests(): Generator
179175
}
180176

181177
#[DataProvider('provideCrudTests')]
182-
#[Group('serverless')]
183178
public function testCrud(UnifiedTestCase $test): void
184179
{
185180
self::$runner->run($test);
@@ -191,7 +186,6 @@ public static function provideCrudTests(): Generator
191186
}
192187

193188
#[DataProvider('provideGridFSTests')]
194-
#[Group('serverless')]
195189
public function testGridFS(UnifiedTestCase $test): void
196190
{
197191
self::$runner->run($test);
@@ -203,7 +197,6 @@ public static function provideGridFSTests(): Generator
203197
}
204198

205199
#[DataProvider('provideLoadBalancers')]
206-
#[Group('serverless')]
207200
public function testLoadBalancers(UnifiedTestCase $test): void
208201
{
209202
self::$runner->run($test);
@@ -226,7 +219,6 @@ public static function provideReadWriteConcernTests(): Generator
226219
}
227220

228221
#[DataProvider('provideRetryableReadsTests')]
229-
#[Group('serverless')]
230222
public function testRetryableReads(UnifiedTestCase $test): void
231223
{
232224
self::$runner->run($test);
@@ -238,7 +230,6 @@ public static function provideRetryableReadsTests(): Generator
238230
}
239231

240232
#[DataProvider('provideRetryableWritesTests')]
241-
#[Group('serverless')]
242233
public function testRetryableWrites(UnifiedTestCase $test): void
243234
{
244235
self::$runner->run($test);
@@ -250,7 +241,6 @@ public static function provideRetryableWritesTests(): Generator
250241
}
251242

252243
#[DataProvider('provideRunCommandTests')]
253-
#[Group('serverless')]
254244
public function testRunCommand(UnifiedTestCase $test): void
255245
{
256246
self::$runner->run($test);
@@ -262,7 +252,6 @@ public static function provideRunCommandTests(): Generator
262252
}
263253

264254
#[DataProvider('provideSessionsTests')]
265-
#[Group('serverless')]
266255
public function testSessions(UnifiedTestCase $test): void
267256
{
268257
self::$runner->run($test);
@@ -274,7 +263,6 @@ public static function provideSessionsTests(): Generator
274263
}
275264

276265
#[DataProvider('provideTransactionsTests')]
277-
#[Group('serverless')]
278266
public function testTransactions(UnifiedTestCase $test): void
279267
{
280268
self::$runner->run($test);
@@ -297,7 +285,6 @@ public static function provideTransactionsConvenientApiTests(): Generator
297285
}
298286

299287
#[DataProvider('provideVersionedApiTests')]
300-
#[Group('serverless')]
301288
#[Group('versioned-api')]
302289
public function testVersionedApi(UnifiedTestCase $test): void
303290
{

‎tests/UnifiedSpecTests/UnifiedTestRunner.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use function call_user_func;
2121
use function count;
2222
use function explode;
23-
use function filter_var;
2423
use function gc_collect_cycles;
2524
use function getenv;
2625
use function implode;
@@ -41,8 +40,6 @@
4140
use function substr_replace;
4241
use function version_compare;
4342

44-
use const FILTER_VALIDATE_BOOLEAN;
45-
4643
/**
4744
* Unified test runner.
4845
*
@@ -92,7 +89,7 @@ public function __construct(private string $internalClientUri)
9289
*
9390
* Atlas Data Lake also does not support killAllSessions.
9491
*/
95-
if ($this->isServerless() || FunctionalTestCase::isAtlas($internalClientUri) || $this->isAtlasDataLake()) {
92+
if (FunctionalTestCase::isAtlas($internalClientUri) || $this->isAtlasDataLake()) {
9693
$this->allowKillAllSessions = false;
9794
}
9895

@@ -252,7 +249,6 @@ private function checkRunOnRequirements(array $runOnRequirements): void
252249
$this->getTopology(),
253250
$this->serverParameterHelper,
254251
$this->isAuthenticated(),
255-
$this->isServerless(),
256252
$this->isClientSideEncryptionSupported(),
257253
];
258254
}
@@ -321,10 +317,6 @@ private function isAtlasDataLake(): bool
321317

322318
/**
323319
* Return whether the connection is authenticated.
324-
*
325-
* Note: if the connectionStatus command is not portable for serverless, it
326-
* may be necessary to rewrite this to instead inspect the connection string
327-
* or consult an environment variable, as is done in libmongoc.
328320
*/
329321
private function isAuthenticated(): bool
330322
{
@@ -358,16 +350,6 @@ private function isClientSideEncryptionSupported(): bool
358350
return FunctionalTestCase::isCryptSharedLibAvailable() || FunctionalTestCase::isMongocryptdAvailable();
359351
}
360352

361-
/**
362-
* Return whether serverless (i.e. proxy as mongos) is being utilized.
363-
*/
364-
private function isServerless(): bool
365-
{
366-
$isServerless = getenv('MONGODB_IS_SERVERLESS');
367-
368-
return $isServerless !== false ? filter_var($isServerless, FILTER_VALIDATE_BOOLEAN) : false;
369-
}
370-
371353
/**
372354
* Checks is a test format schema version is supported.
373355
*/
@@ -535,7 +517,7 @@ private function createContext(): Context
535517
$context->setUrisForUseMultipleMongoses($singleMongosUri, $multiMongosUri);
536518
}
537519

538-
if ($this->getPrimaryServer()->getType() === Server::TYPE_LOAD_BALANCER && ! $this->isServerless()) {
520+
if ($this->getPrimaryServer()->getType() === Server::TYPE_LOAD_BALANCER) {
539521
$singleMongosUri = getenv('MONGODB_SINGLE_MONGOS_LB_URI');
540522
$multiMongosUri = getenv('MONGODB_MULTI_MONGOS_LB_URI');
541523

0 commit comments

Comments
 (0)
Please sign in to comment.