Skip to content

Commit ae3821a

Browse files
authored
PHPLIB-1667: Remove serverless testing (#1720)
* Remove serverless tasks/functions from evergreen config * Remove serverless logic in test runners * Remove serverless test groups * Remove mentions of serverless from contributing guide * Fix phpcs thingamabobs
1 parent 2c5e6fe commit ae3821a

18 files changed

+7
-213
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 & 2 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.0 !.4.2 !.4.4 !.5.0 !.6.0"
1717
- ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
1818
- ".loadbalanced .local !.csfle !.4.0 !.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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@
1515
- ".replicaset .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
1616
- ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
1717
- ".loadbalanced .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
18-
- "test_serverless_task_group"
19-
- "test_serverless_proxy_task_group"
2018
- "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 & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,6 @@ tasks:
77
vars:
88
TESTS: "atlas"
99

10-
- name: "test-serverless"
11-
tags: ["serverless"]
12-
exec_timeout_secs: 10800
13-
commands:
14-
- func: "start kms servers"
15-
- func: "set aws temp creds"
16-
- func: "run serverless tests"
17-
18-
- name: "test-serverless-proxy"
19-
tags: ["serverless"]
20-
exec_timeout_secs: 10800
21-
commands:
22-
- func: "start kms servers"
23-
- func: "set aws temp creds"
24-
- func: "run serverless tests"
25-
2610
- name: "test-atlas-data-lake"
2711
commands:
2812
- 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

@@ -420,16 +418,6 @@ protected function isStandalone()
420418
return $this->getPrimaryServer()->getType() == Server::TYPE_STANDALONE;
421419
}
422420

423-
/**
424-
* Return whether serverless (i.e. proxy as mongos) is being utilized.
425-
*/
426-
protected static function isServerless(): bool
427-
{
428-
$isServerless = getenv('MONGODB_IS_SERVERLESS');
429-
430-
return $isServerless !== false ? filter_var($isServerless, FILTER_VALIDATE_BOOLEAN) : false;
431-
}
432-
433421
protected function isShardedCluster()
434422
{
435423
$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/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) {

0 commit comments

Comments
 (0)