Skip to content

Commit f7b9ba2

Browse files
authored
PHPLIB-672: Drop support for PHP 7.1 (#868)
* PHPLIB-672: Drop support for PHP 7.1 This commit also removes the old bootstrap file for PHPUnit, since it's no longer relevant. The class aliases were previously introduced in a8b4862 and 016eb3e and should no longer be necessary for PHPUnit 8+. * PHPLIB-672: Update Evergreen config for PHP 7.2+, driver 1.11, and MongoDB 5.0 Bump edge-versions:latest-stable to MongoDB 5.0. Drops PHP 7.1 and adds PHP 8.0 to php-versions and php-edge-versions. Revert various tests to latest-stable driver version now that 1.11 exists. Use debian92 for feature-based testing (e.g. Atlas Data Lake). Make display names consistent, which will make it easier to find redundant build variants. * Serverless scripts expect to be run with bash
1 parent d9b563b commit f7b9ba2

File tree

6 files changed

+68
-87
lines changed

6 files changed

+68
-87
lines changed

.evergreen/config.yml

Lines changed: 62 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ functions:
212212
export SERVERLESS_API_PRIVATE_KEY=${SERVERLESS_API_PRIVATE_KEY}
213213
export SERVERLESS_ATLAS_USER=${SERVERLESS_ATLAS_USER}
214214
export SERVERLESS_ATLAS_PASSWORD=${SERVERLESS_ATLAS_PASSWORD}
215-
sh ${PROJECT_DIRECTORY}/.evergreen/serverless/create-instance.sh
215+
bash ${PROJECT_DIRECTORY}/.evergreen/serverless/create-instance.sh
216216
- command: expansions.update
217217
params:
218218
file: src/serverless-expansion.yml
@@ -229,7 +229,7 @@ functions:
229229
export SERVERLESS_ATLAS_USER=${SERVERLESS_ATLAS_USER}
230230
export SERVERLESS_ATLAS_PASSWORD=${SERVERLESS_ATLAS_PASSWORD}
231231
export SERVERLESS_INSTANCE_NAME=${SERVERLESS_INSTANCE_NAME}
232-
sh ${PROJECT_DIRECTORY}/.evergreen/serverless/delete-instance.sh
232+
bash ${PROJECT_DIRECTORY}/.evergreen/serverless/delete-instance.sh
233233
234234
"run tests":
235235
- command: shell.exec
@@ -472,37 +472,39 @@ tasks:
472472

473473

474474
axes:
475+
# Note: install-dependencies.sh will search for the latest minor version
476+
# matching the PHP_VERSION constant
475477
- id: php-versions
476478
display_name: PHP Version
477479
values:
480+
- id: "8.0"
481+
display_name: "8.0"
482+
variables:
483+
PHP_VERSION: "8.0"
478484
- id: "7.4"
479485
display_name: "7.4"
480486
variables:
481-
PHP_VERSION: "7.4.7"
487+
PHP_VERSION: "7.4"
482488
- id: "7.3"
483489
display_name: "7.3"
484490
variables:
485-
PHP_VERSION: "7.3.8"
491+
PHP_VERSION: "7.3"
486492
- id: "7.2"
487493
display_name: "7.2"
488494
variables:
489-
PHP_VERSION: "7.2.21"
490-
- id: "7.1"
491-
display_name: "7.1"
492-
variables:
493-
PHP_VERSION: "7.1.31"
495+
PHP_VERSION: "7.2"
494496

495497
- id: php-edge-versions
496498
display_name: PHP Version
497499
values:
498500
- id: "latest-stable"
499-
display_name: "7.4"
501+
display_name: "8.0"
500502
variables:
501-
PHP_VERSION: "7.4.7"
503+
PHP_VERSION: "8.0"
502504
- id: "oldest-supported"
503-
display_name: "7.1"
505+
display_name: "7.2"
504506
variables:
505-
PHP_VERSION: "7.1.31"
507+
PHP_VERSION: "7.2"
506508

507509
- id: versions
508510
display_name: MongoDB Version
@@ -548,9 +550,9 @@ axes:
548550
display_name: MongoDB Version
549551
values:
550552
- id: "latest-stable"
551-
display_name: "4.4"
553+
display_name: "5.0"
552554
variables:
553-
VERSION: "4.4"
555+
VERSION: "5.0"
554556
- id: "oldest-supported"
555557
display_name: "3.0"
556558
variables:
@@ -559,25 +561,24 @@ axes:
559561
- id: driver-versions
560562
display_name: Driver Version
561563
values:
562-
# * lowest-supported can be enabled once a 1.10 patch release has been tagged
563-
# - id: "lowest-supported"
564-
# display_name: "1.10.0"
565-
# variables:
566-
# EXTENSION_VERSION: "1.10.0"
567-
# - id: "latest-stable"
568-
# display_name: "Latest Stable (1.10.x)"
569-
# variables:
570-
# EXTENSION_VERSION: "stable"
571-
# - id: "upcoming-stable"
572-
# display_name: "1.10-dev"
573-
# variables:
574-
# EXTENSION_BRANCH: "v1.10"
564+
- id: "lowest-supported"
565+
display_name: "1.11.0"
566+
variables:
567+
EXTENSION_VERSION: "1.11.0"
568+
- id: "latest-stable"
569+
display_name: "Latest Stable (1.11.x)"
570+
variables:
571+
EXTENSION_VERSION: "stable"
572+
- id: "upcoming-stable"
573+
display_name: "1.11-dev"
574+
variables:
575+
EXTENSION_BRANCH: "v1.11"
575576
- id: "latest-dev"
576-
display_name: "1.11-dev (master)"
577+
display_name: "1.12-dev (master)"
577578
variables:
578579
EXTENSION_BRANCH: "master"
579580

580-
- id: os-php7
581+
- id: os
581582
display_name: OS
582583
values:
583584
- id: debian92-test
@@ -662,76 +663,80 @@ axes:
662663

663664
buildvariants:
664665

665-
# Tests all PHP versions on all operating systems.
666-
# Only tests against latest MongoDB and ext-mongodb versions
666+
# Tests all PHP versions on all operating systems and latest MongoDB and ext-mongodb versions
667667
- matrix_name: "test-php-versions"
668-
matrix_spec: {"os-php7": "*", "php-versions": "*", "edge-versions": "latest-stable", "driver-versions": "latest-dev" }
668+
matrix_spec: { "os": "*", "edge-versions": "latest-stable", "php-versions": "*", "driver-versions": "latest-stable" }
669669
exclude_spec:
670670
# rhel71-power8 fails due to not reaching pecl
671-
- { "os-php7": "rhel71-power8", "php-versions": "*", edge-versions: "*", "driver-versions": "*" }
671+
- { "os": "rhel71-power8", "edge-versions": "*", "php-versions": "*", "driver-versions": "*" }
672672
# rhel74-zseries doesn't start in a timely fashion - most likely missing executors
673-
- { "os-php7": "rhel74-zseries", "php-versions": "*", edge-versions: "*", "driver-versions": "*" }
674-
display_name: "* ${os-php7}, PHP ${php-versions}, MongoDB ${edge-versions}, ext-mongodb ${driver-versions}"
673+
- { "os": "rhel74-zseries", "edge-versions": "*", "php-versions": "*", "driver-versions": "*" }
674+
# rhel70 does not have PHP 8.0
675+
- { "os": "rhel70-test", "edge-versions": "*", "php-versions": "8.0", "driver-versions": "*" }
676+
display_name: "${os}, MongoDB ${edge-versions}, PHP ${php-versions}, ext-mongodb ${driver-versions}"
675677
tasks:
676678
- name: "test-standalone"
677679
- name: "test-replica_set"
678680
- name: "test-sharded_cluster"
679681

680-
# Tests all driver versions on all PHP versions
681-
# Only tests on Ubuntu 18.04 and latest MongoDB
682+
# Tests all driver versions on all PHP versions using latest MongoDB and Ubuntu 18.04
682683
- matrix_name: "test-driver-versions"
683-
matrix_spec: {"os-php7": "ubuntu1804-arm64-test", "php-versions": "*", "edge-versions": "latest-stable", "driver-versions": "*" }
684-
display_name: "ext-mongodb ${driver-versions}, PHP ${php-versions}, ${os-php7}, MongoDB ${edge-versions}"
684+
matrix_spec: { "os": "ubuntu1804-arm64-test", "edge-versions": "latest-stable", "php-versions": "*", "driver-versions": "*" }
685+
exclude_spec:
686+
# Avoid duplicate build variants from test-php-versions
687+
- { "os": "ubuntu1804-arm64-test", "edge-versions": "latest-stable", "php-versions": "*", "driver-versions": "latest-stable" }
688+
display_name: "${os}, MongoDB ${edge-versions}, PHP ${php-versions}, ext-mongodb ${driver-versions}"
685689
tasks:
686690
- name: "test-standalone"
687691
- name: "test-replica_set"
688692
- name: "test-sharded_cluster"
689693

690-
# Tests all MongoDB versions
691-
# Only tests on Ubuntu 18.04, with latest stable PHP and driver versions
692-
# Tests against various topologies
694+
# Tests all MongoDB versions with latest stable PHP and driver versions
693695
- matrix_name: "test-mongodb-versions"
694-
matrix_spec: {"os-php7": "rhel70-test", "php-edge-versions": "latest-stable", "versions": "*", "driver-versions": "latest-dev" }
695-
display_name: "MongoDB ${versions}, PHP ${php-edge-versions}, ${os-php7}, ext-mongodb ${driver-versions}"
696+
matrix_spec: { "os": "debian92-test", "versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" }
697+
exclude_spec:
698+
# Avoid duplicate build variants from test-php-versions (assumes edge-versions:latest-stable is 5.0)
699+
- { "os": "debian92-test", "versions": "5.0", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" }
700+
display_name: "${os}, MongoDB ${versions}, PHP ${php-edge-versions}, ext-mongodb ${driver-versions}"
696701
tasks:
697702
- name: "test-standalone"
698703
- name: "test-replica_set"
699704
- name: "test-sharded_cluster"
700705

701-
# Tests oldest supported version
706+
# Tests all MongoDB versions with lowest supported PHP and driver versions
702707
# Enables --prefer-lowest for composer to test oldest dependencies against all server versions
703-
# TODO: driver-versions can be changed back to lowest-supported when that version is enabled in the axis
704708
- matrix_name: "test-dependencies"
705-
matrix_spec: { "dependencies": "lowest", "os-php7": "rhel70-test", "php-edge-versions": "oldest-supported", "versions": "*", "driver-versions": "latest-dev" }
706-
display_name: "Dependencies: ${dependencies}, MongoDB ${versions}, PHP ${php-edge-versions}, ${os-php7}, ext-mongodb ${driver-versions}"
709+
matrix_spec: { "os": "debian92-test", "versions": "*", "php-edge-versions": "oldest-supported", "driver-versions": "lowest-supported", "dependencies": "lowest" }
710+
display_name: "Lowest Dependencies: ${os}, MongoDB ${versions}, PHP ${php-edge-versions}, ext-mongodb ${driver-versions}"
707711
tasks:
708712
- name: "test-standalone"
709713
- name: "test-replica_set"
710714
- name: "test-sharded_cluster"
711715

712716
- matrix_name: "atlas-data-lake-test"
713-
matrix_spec: { "php-edge-versions": "latest-stable", "driver-versions": "latest-dev" }
714-
display_name: "Atlas Data Lake test"
715-
run_on: rhel70
717+
matrix_spec: { "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" }
718+
display_name: "Atlas Data Lake"
719+
run_on: debian92-test
716720
tasks:
717721
- name: "test-atlas-data-lake"
718722

719723
- matrix_name: "test-versioned-api"
720-
matrix_spec: { "php-edge-versions": "latest-stable", "versions": ["5.0", "latest"], "driver-versions": "latest-dev" }
724+
matrix_spec: { "versions": ["5.0", "latest"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" }
721725
display_name: "Versioned API - ${versions}"
722-
run_on: rhel70
726+
run_on: debian92-test
723727
tasks:
724728
- .versioned-api
725729

726730
- matrix_name: "serverless"
727-
matrix_spec: { "php-edge-versions": "latest-stable", "driver-versions": "latest-dev" }
731+
matrix_spec: { "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" }
728732
display_name: "Serverless"
729-
run_on: rhel70
733+
run_on: debian92-test
730734
tasks:
731735
- .serverless
732736

733737
- matrix_name: "test-loadBalanced"
734-
matrix_spec: { "os-php7": "debian92-test", "php-versions": "7.3", "versions": ["5.0", "latest"], "driver-versions": "latest-dev" }
738+
matrix_spec: { "versions": ["5.0", "latest"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" }
735739
display_name: "Load balanced - ${versions}"
740+
run_on: debian92-test
736741
tasks:
737742
- name: "test-loadBalanced"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{ "name": "Jeremy Mikola", "email": "[email protected]" }
1010
],
1111
"require": {
12-
"php": "^7.1 || ^8.0",
12+
"php": "^7.2 || ^8.0",
1313
"ext-hash": "*",
1414
"ext-json": "*",
1515
"ext-mongodb": "^1.11.0",

phpunit.evergreen.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
beStrictAboutOutputDuringTests="true"
77
beStrictAboutChangesToGlobalState="true"
88
colors="true"
9-
bootstrap="tests/bootstrap.php"
9+
bootstrap="vendor/autoload.php"
1010
defaultTestSuite="Default Test Suite"
1111
>
1212

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
beStrictAboutOutputDuringTests="true"
77
beStrictAboutChangesToGlobalState="true"
88
colors="true"
9-
bootstrap="tests/bootstrap.php"
9+
bootstrap="vendor/autoload.php"
1010
defaultTestSuite="Default Test Suite"
1111
>
1212

tests/GridFS/BucketFunctionalTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use MongoDB\Model\BSONDocument;
1515
use MongoDB\Model\IndexInfo;
1616
use MongoDB\Operation\ListIndexes;
17-
use PHPUnit\Framework\Error\Warning;
1817

1918
use function array_merge;
2019
use function call_user_func;
@@ -174,7 +173,7 @@ public function testDownloadingFileWithMissingChunk(): void
174173

175174
$this->chunksCollection->deleteOne(['files_id' => $id, 'n' => 0]);
176175

177-
$this->expectException(Warning::class);
176+
$this->expectWarning();
178177
stream_get_contents($this->bucket->openDownloadStream($id));
179178
}
180179

@@ -187,7 +186,7 @@ public function testDownloadingFileWithUnexpectedChunkIndex(): void
187186
['$set' => ['n' => 1]]
188187
);
189188

190-
$this->expectException(Warning::class);
189+
$this->expectWarning();
191190
stream_get_contents($this->bucket->openDownloadStream($id));
192191
}
193192

@@ -200,7 +199,7 @@ public function testDownloadingFileWithUnexpectedChunkSize(): void
200199
['$set' => ['data' => new Binary('fooba', Binary::TYPE_GENERIC)]]
201200
);
202201

203-
$this->expectException(Warning::class);
202+
$this->expectWarning();
204203
stream_get_contents($this->bucket->openDownloadStream($id));
205204
}
206205

tests/bootstrap.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)