diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 1c4e2a22a..2c7fcb3b9 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -71,3 +71,5 @@ include: - filename: .evergreen/config/generated/test/require-api-version.yml - filename: .evergreen/config/generated/test/csfle.yml - filename: .evergreen/config/generated/test-variant/modern-php-full.yml + - filename: .evergreen/config/generated/test-variant/phpc.yml + - filename: .evergreen/config/generated/test-variant/lowest.yml diff --git a/.evergreen/config/generate-config.php b/.evergreen/config/generate-config.php index ed2c6a28e..3bd1c710b 100644 --- a/.evergreen/config/generate-config.php +++ b/.evergreen/config/generate-config.php @@ -55,9 +55,8 @@ // Test variants $allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'modern-php-full.yml', $supportedPhpVersions); -// TODO: Re-enable when 1.20.0 is released -// $allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'phpc.yml', [$latestPhpVersion]); -// $allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'lowest.yml', [$lowestPhpVersion]); +$allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'phpc.yml', [$latestPhpVersion]); +$allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'lowest.yml', [$lowestPhpVersion]); echo "Generated config. Use the following list to import files:\n"; echo implode("\n", array_map('getImportConfig', $allFiles)) . "\n"; diff --git a/.evergreen/config/generated/build/build-extension.yml b/.evergreen/config/generated/build/build-extension.yml index c16586063..22adcfc8a 100644 --- a/.evergreen/config/generated/build/build-extension.yml +++ b/.evergreen/config/generated/build/build-extension.yml @@ -7,41 +7,37 @@ tasks: vars: PHP_VERSION: "8.3" - func: "compile extension" - # TODO: remove once 1.20.0 is released + - func: "upload extension" + - name: "build-php-8.3-lowest" + tags: ["build", "php8.3", "lowest", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.3" + - func: "compile extension" + vars: + EXTENSION_VERSION: "1.20.0" + - func: "upload extension" + - name: "build-php-8.3-next-stable" + tags: ["build", "php8.3", "next-stable", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.3" + - func: "compile extension" vars: EXTENSION_BRANCH: "v1.20" - func: "upload extension" - # TODO: re-enable once 1.20.0 is released -# - name: "build-php-8.3-lowest" -# tags: ["build", "php8.3", "lowest", "pr", "tag"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "8.3" -# - func: "compile extension" -# vars: -# EXTENSION_VERSION: "1.20.0" -# - func: "upload extension" -# - name: "build-php-8.3-next-stable" -# tags: ["build", "php8.3", "next-stable", "pr", "tag"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "8.3" -# - func: "compile extension" -# vars: -# EXTENSION_BRANCH: "v1.20.0" -# - func: "upload extension" -# - name: "build-php-8.3-next-minor" -# tags: ["build", "php8.3", "next-minor"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "8.3" -# - func: "compile extension" -# vars: -# EXTENSION_BRANCH: "master" -# - func: "upload extension" + - name: "build-php-8.3-next-minor" + tags: ["build", "php8.3", "next-minor"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.3" + - func: "compile extension" + vars: + EXTENSION_BRANCH: "v1.x" + - func: "upload extension" - name: "build-php-8.2" tags: ["build", "php8.2", "stable", "pr", "tag"] commands: @@ -49,41 +45,37 @@ tasks: vars: PHP_VERSION: "8.2" - func: "compile extension" - # TODO: remove once 1.20.0 is released + - func: "upload extension" + - name: "build-php-8.2-lowest" + tags: ["build", "php8.2", "lowest", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.2" + - func: "compile extension" + vars: + EXTENSION_VERSION: "1.20.0" + - func: "upload extension" + - name: "build-php-8.2-next-stable" + tags: ["build", "php8.2", "next-stable", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.2" + - func: "compile extension" vars: EXTENSION_BRANCH: "v1.20" - func: "upload extension" - # TODO: re-enable once 1.20.0 is released -# - name: "build-php-8.2-lowest" -# tags: ["build", "php8.2", "lowest", "pr", "tag"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "8.2" -# - func: "compile extension" -# vars: -# EXTENSION_VERSION: "1.20.0" -# - func: "upload extension" -# - name: "build-php-8.2-next-stable" -# tags: ["build", "php8.2", "next-stable", "pr", "tag"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "8.2" -# - func: "compile extension" -# vars: -# EXTENSION_BRANCH: "v1.20.0" -# - func: "upload extension" -# - name: "build-php-8.2-next-minor" -# tags: ["build", "php8.2", "next-minor"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "8.2" -# - func: "compile extension" -# vars: -# EXTENSION_BRANCH: "master" -# - func: "upload extension" + - name: "build-php-8.2-next-minor" + tags: ["build", "php8.2", "next-minor"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.2" + - func: "compile extension" + vars: + EXTENSION_BRANCH: "v1.x" + - func: "upload extension" - name: "build-php-8.1" tags: ["build", "php8.1", "stable", "pr", "tag"] commands: @@ -91,38 +83,34 @@ tasks: vars: PHP_VERSION: "8.1" - func: "compile extension" - # TODO: remove once 1.20.0 is released + - func: "upload extension" + - name: "build-php-8.1-lowest" + tags: ["build", "php8.1", "lowest", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.1" + - func: "compile extension" + vars: + EXTENSION_VERSION: "1.20.0" + - func: "upload extension" + - name: "build-php-8.1-next-stable" + tags: ["build", "php8.1", "next-stable", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.1" + - func: "compile extension" vars: EXTENSION_BRANCH: "v1.20" - func: "upload extension" - # TODO: re-enable once 1.20.0 is released -# - name: "build-php-8.1-lowest" -# tags: ["build", "php8.1", "lowest", "pr", "tag"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "8.1" -# - func: "compile extension" -# vars: -# EXTENSION_VERSION: "1.20.0" -# - func: "upload extension" -# - name: "build-php-8.1-next-stable" -# tags: ["build", "php8.1", "next-stable", "pr", "tag"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "8.1" -# - func: "compile extension" -# vars: -# EXTENSION_BRANCH: "v1.20.0" -# - func: "upload extension" -# - name: "build-php-8.1-next-minor" -# tags: ["build", "php8.1", "next-minor"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "8.1" -# - func: "compile extension" -# vars: -# EXTENSION_BRANCH: "master" -# - func: "upload extension" + - name: "build-php-8.1-next-minor" + tags: ["build", "php8.1", "next-minor"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.1" + - func: "compile extension" + vars: + EXTENSION_BRANCH: "v1.x" + - func: "upload extension" diff --git a/.evergreen/config/generated/test-variant/lowest.yml b/.evergreen/config/generated/test-variant/lowest.yml new file mode 100644 index 000000000..61874e006 --- /dev/null +++ b/.evergreen/config/generated/test-variant/lowest.yml @@ -0,0 +1,16 @@ +# This file is generated automatically - please edit the "templates/test-variant/lowest.yml" template file instead. +buildvariants: + - name: test-debian92-php-8.1-local-lowest + tags: ["test", "debian", "x64", "php8.1", "pr", "tag"] + display_name: "Test: Debian 9.2, PHP 8.1, Lowest Dependencies" + run_on: debian92-small + expansions: + FETCH_BUILD_VARIANT: "build-debian92" + FETCH_BUILD_TASK: "build-php-8.1-lowest" + PHP_VERSION: "8.1" + DEPENDENCIES: "lowest" + depends_on: + - variant: "build-debian92" + name: "build-php-8.1-lowest" + tasks: + - ".replicaset .local .4.0 !.csfle" diff --git a/.evergreen/config/generated/test-variant/phpc.yml b/.evergreen/config/generated/test-variant/phpc.yml new file mode 100644 index 000000000..e0eb428ce --- /dev/null +++ b/.evergreen/config/generated/test-variant/phpc.yml @@ -0,0 +1,42 @@ +# This file is generated automatically - please edit the "templates/test-variant/phpc.yml" template file instead. +buildvariants: + # Variants with different PHPC versions + - name: test-debian12-php-8.3-phpc-next-stable + tags: ["test", "debian", "x64", "php8.3", "pr", "tag"] + display_name: "Test: Debian 12, PHP 8.3, PHPC next-stable" + run_on: debian12-small + expansions: + FETCH_BUILD_VARIANT: "build-debian12" + FETCH_BUILD_TASK: "build-php-8.3-next-stable" + PHP_VERSION: "8.3" + depends_on: + - variant: "build-debian12" + name: "build-php-8.3-next-stable" + tasks: + - ".standalone .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0" + - ".replicaset .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0" + - ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0" + - ".loadbalanced .local !.csfle !.4.0 !.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.3-phpc-next-minor + tags: ["test", "debian", "x64", "php8.3"] + display_name: "Test: Debian 12, PHP 8.3, PHPC next-minor" + run_on: debian12-small + expansions: + FETCH_BUILD_VARIANT: "build-debian12" + FETCH_BUILD_TASK: "build-php-8.3-next-minor" + PHP_VERSION: "8.3" + depends_on: + - variant: "build-debian12" + name: "build-php-8.3-next-minor" + tasks: + - ".standalone .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0" + - ".replicaset .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0" + - ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0" + - ".loadbalanced .local !.csfle !.4.0 !.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/build/build-extension.yml b/.evergreen/config/templates/build/build-extension.yml index ecd1fffdd..869c0a9e4 100644 --- a/.evergreen/config/templates/build/build-extension.yml +++ b/.evergreen/config/templates/build/build-extension.yml @@ -5,38 +5,34 @@ vars: PHP_VERSION: "%phpVersion%" - func: "compile extension" - # TODO: remove once 1.20.0 is released + - func: "upload extension" + - name: "build-php-%phpVersion%-lowest" + tags: ["build", "php%phpVersion%", "lowest", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "%phpVersion%" + - func: "compile extension" + vars: + EXTENSION_VERSION: "1.20.0" + - func: "upload extension" + - name: "build-php-%phpVersion%-next-stable" + tags: ["build", "php%phpVersion%", "next-stable", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "%phpVersion%" + - func: "compile extension" vars: EXTENSION_BRANCH: "v1.20" - func: "upload extension" - # TODO: re-enable once 1.20.0 is released -# - name: "build-php-%phpVersion%-lowest" -# tags: ["build", "php%phpVersion%", "lowest", "pr", "tag"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "%phpVersion%" -# - func: "compile extension" -# vars: -# EXTENSION_VERSION: "1.20.0" -# - func: "upload extension" -# - name: "build-php-%phpVersion%-next-stable" -# tags: ["build", "php%phpVersion%", "next-stable", "pr", "tag"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "%phpVersion%" -# - func: "compile extension" -# vars: -# EXTENSION_BRANCH: "v1.20.0" -# - func: "upload extension" -# - name: "build-php-%phpVersion%-next-minor" -# tags: ["build", "php%phpVersion%", "next-minor"] -# commands: -# - func: "locate PHP binaries" -# vars: -# PHP_VERSION: "%phpVersion%" -# - func: "compile extension" -# vars: -# EXTENSION_BRANCH: "master" -# - func: "upload extension" + - name: "build-php-%phpVersion%-next-minor" + tags: ["build", "php%phpVersion%", "next-minor"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "%phpVersion%" + - func: "compile extension" + vars: + EXTENSION_BRANCH: "v1.x" + - func: "upload extension" diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 5dbb7dd71..462e4d67e 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -13,9 +13,7 @@ on: env: PHP_VERSION: "8.2" - # TODO: change to "stable" once 1.20.0 is released - # DRIVER_VERSION: "stable" - DRIVER_VERSION: "mongodb/mongo-php-driver@v1.20" + DRIVER_VERSION: "stable" jobs: phpcs: diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index ebb60cabf..0103bdcd1 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -19,9 +19,7 @@ on: env: PHP_VERSION: "8.2" - # TODO: change to "stable" once 1.20.0 is released - # DRIVER_VERSION: "stable" - DRIVER_VERSION: "mongodb/mongo-php-driver@v1.20" + DRIVER_VERSION: "stable" jobs: psalm: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 803eb476d..825c975b8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,9 +12,7 @@ on: - "feature/*" env: - # TODO: change to "stable" once 1.20.0 is released - # DRIVER_VERSION: "stable" - DRIVER_VERSION: "mongodb/mongo-php-driver@v1.20" + DRIVER_VERSION: "stable" jobs: phpunit: diff --git a/tests/Operation/FindFunctionalTest.php b/tests/Operation/FindFunctionalTest.php index 3b6a90218..2a64a7d71 100644 --- a/tests/Operation/FindFunctionalTest.php +++ b/tests/Operation/FindFunctionalTest.php @@ -48,7 +48,9 @@ function () use ($modifiers): void { ['modifiers' => $modifiers], ); - $operation->execute($this->getPrimaryServer()); + $this->assertDeprecated( + fn () => $operation->execute($this->getPrimaryServer()), + ); }, function (array $event) use ($expectedSort): void { $this->assertEquals($expectedSort, $event['started']->getCommand()->sort ?? null); diff --git a/tests/TestCase.php b/tests/TestCase.php index 1d965606d..4bff57e0d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -37,6 +37,7 @@ use function sprintf; use function strtr; +use const E_DEPRECATED; use const E_USER_DEPRECATED; abstract class TestCase extends BaseTestCase @@ -166,7 +167,7 @@ protected function assertDeprecated(callable $execution): void set_error_handler(function ($errno, $errstr) use (&$errors): void { $errors[] = $errstr; - }, E_USER_DEPRECATED); + }, E_USER_DEPRECATED | E_DEPRECATED); try { call_user_func($execution);