Skip to content

PHPLIB-563: Finalise PHP runtime axis #788

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 5 commits into from
Sep 22, 2020
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
34 changes: 29 additions & 5 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ functions:
${PREPARE_SHELL}
file="${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh"
# Don't use ${file} syntax here because evergreen treats it as an empty expansion.
[ -f "$file" ] && PHP_VERSION=${PHP_VERSION} DRIVER_VERSION=${DRIVER_VERSION} DRIVER_REPO=${DRIVER_REPO} DRIVER_BRANCH=${DRIVER_BRANCH} sh $file || echo "$file not available, skipping"
[ -f "$file" ] && PHP_VERSION=${PHP_VERSION} DRIVER_VERSION=${DRIVER_VERSION} DRIVER_REPO=${DRIVER_REPO} DRIVER_BRANCH=${DRIVER_BRANCH} DEPENDENCIES=${DEPENDENCIES} sh $file || echo "$file not available, skipping"

pre:
- func: "fetch source"
Expand Down Expand Up @@ -434,6 +434,10 @@ axes:
- id: driver-versions
display_name: Driver Version
values:
- id: "lowest-supported"
display_name: "1.8.0"
variables:
DRIVER_VERSION: "1.8.0"
- id: "latest-stable"
display_name: "1.8-stable"
- id: "latest-minor-dev"
Expand All @@ -459,7 +463,7 @@ axes:
run_on: rhel71-power8-test
- id: rhel74-zseries
display_name: "RHEL 7.4 zSeries"
run_on: rhel72-zseries-test
run_on: rhel74-zseries-test
- id: ubuntu1804-arm64-test
display_name: "Ubuntu 18.04 ARM64"
run_on: ubuntu1804-arm64-test
Expand Down Expand Up @@ -520,16 +524,26 @@ axes:
variables:
STORAGE_ENGINE: "inmemory"

- id: dependencies
display_name: Dependencies
values:
- id: lowest
display_name: Lowest
variables:
DEPENDENCIES: "lowest"

buildvariants:

# Tests all PHP versions on all operating systems.
# Only tests against latest MongoDB and ext-mongodb versions
- matrix_name: "test-php-versions"
matrix_spec: {"os-php7": ["debian92-test", "ubuntu1804-arm64-test", "rhel70-test"], "php-versions": "*", "edge-versions": "latest-stable", "driver-versions": "latest-stable" }
matrix_spec: {"os-php7": "*", "php-versions": "*", "edge-versions": "latest-stable", "driver-versions": "latest-stable" }
exclude_spec:
- { "os-php7": ["debian92-test", "rhel70-test"], "php-versions": "7.0", edge-versions: "*", "driver-versions": "*" }
display_name: "PHP ${php-versions}, ${os-php7}, MongoDB ${edge-versions}, ext-mongodb ${driver-versions}"
# rhel71-power8 fails due to not reaching pecl
- { "os-php7": "rhel71-power8", "php-versions": "*", edge-versions: "*", "driver-versions": "*" }
# rhel74-zseries doesn't start in a timely fashion - most likely missing executors
- { "os-php7": "rhel74-zseries", "php-versions": "*", edge-versions: "*", "driver-versions": "*" }
display_name: "* ${os-php7}, PHP ${php-versions}, MongoDB ${edge-versions}, ext-mongodb ${driver-versions}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the display name start with an asterisk?

Should we use a consistent order with other display names? I noticed the "test-dependencies" matrix below has some of the components here in a different order.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The asterisk is there to make sure these variants are sorted to the top of the list, as they are the ones we require for a PR to pass.

As for ordering in display names, I moved the main variant (e.g. PHP version in this case, MongoDB server version in other cases) to the front of the list. I have no objections against changing this if you prefer to have them alphabetically sorted in general.

Copy link
Member

@jmikola jmikola Sep 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see now that you're prioritizing the variable axes over the fixed ones, and in the "test-dependencies" matrix only the MongoDB version varies. That all makes sense to leave as-is.

tasks:
- name: "test-standalone"
- name: "test-replica_set"
Expand All @@ -556,6 +570,16 @@ buildvariants:
- name: "test-replica_set"
- name: "test-sharded_cluster"

# Tests oldest supported version
# Enables --prefer-lowest for composer to test oldest dependencies against all server versions
- matrix_name: "test-dependencies"
matrix_spec: { "dependencies": "lowest", "os-php7": "rhel70-test", "php-edge-versions": "oldest-supported", "versions": "*", "driver-versions": "lowest-supported" }
display_name: "Dependencies: ${dependencies}, MongoDB ${versions}, PHP ${php-edge-versions}, ${os-php7}, ext-mongodb ${driver-versions}"
tasks:
- name: "test-standalone"
- name: "test-replica_set"
- name: "test-sharded_cluster"

- matrix_name: "atlas-data-lake-test"
matrix_spec: { "php-edge-versions": "latest-stable" }
display_name: "Atlas Data Lake test"
Expand Down
13 changes: 13 additions & 0 deletions .evergreen/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -o errexit # Exit the script with error if any of the commands fail

install_extension ()
{
# Workaround to get PECL running on PHP 7.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to guard this in a conditional for PHP_VERSION starting with "7.0."?

https://stackoverflow.com/a/2172367/162228 suggests you could use if [[ $PHP_VERSION == 7.0.* ]]

Copy link
Member Author

@alcaeus alcaeus Sep 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite me trying to use bash as a shell, I couldn't get evergreen to play nice:

[2020/09/22 08:21:34.150] + [[ 7.0.32 == 7.0.* ]]
[2020/09/22 08:21:34.150] [...]/.evergreen/install-dependencies.sh: 8: [...]/.evergreen/install-dependencies.sh: [[: not found

Since this has no negative impact on other PHP versions, I'd use this unconditionally, especially since 7.0 is the next PHP version we'll drop support for (although no timeline for this exists).

export PHP_PEAR_PHP_BIN=${PHP_PATH}/bin/php
export PHP_PEAR_INSTALL_DIR=${PHP_PATH}/lib/php

rm -f ${PHP_PATH}/lib/php.ini

if [ "x${DRIVER_BRANCH}" != "x" ] || [ "x${DRIVER_REPO}" != "x" ]; then
Expand Down Expand Up @@ -72,6 +76,15 @@ case "$DISTRO" in
;;
esac

case "$DEPENDENCIES" in
lowest*)
COMPOSER_FLAGS="${COMPOSER_FLAGS} --prefer-lowest"
;;

*)
;;
esac

PHP_PATH=/opt/php/${PHP_VERSION}-64bit
OLD_PATH=$PATH
PATH=$PHP_PATH/bin:$OLD_PATH
Expand Down