Skip to content

Merge v1.21 into v2.1 #1721

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 3 commits into from
Jun 4, 2025
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
68 changes: 0 additions & 68 deletions .evergreen/config/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions .evergreen/config/generated/test-variant/phpc.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions .evergreen/config/templates/test-variant/phpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
38 changes: 0 additions & 38 deletions .evergreen/config/test-task-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 0 additions & 18 deletions .evergreen/config/test-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down
9 changes: 1 addition & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions tests/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion tests/SpecTests/ClientSideEncryptionSpecTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
Loading