From 9e80b4f2d5b4fb5f2e829b09ce33f57a39431af1 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 26 Sep 2023 14:45:00 +0200 Subject: [PATCH 01/28] Split up evergreen config and create single build variant --- .evergreen/compile-extension.sh | 71 ++ .evergreen/config.yml | 1032 +---------------- .evergreen/config/build-task-groups.yml | 34 + .evergreen/config/build-variants.yml | 11 + .../build/_template-build-extension.yml | 10 + .evergreen/config/build/build-php-7.4.yml | 11 + .evergreen/config/build/build-php-8.0.yml | 11 + .evergreen/config/build/build-php-8.1.yml | 11 + .evergreen/config/build/build-php-8.2.yml | 9 + .evergreen/config/functions.yml | 502 ++++++++ .evergreen/config/generate-config.php | 81 ++ .evergreen/config/legacy-tasks.yml | 130 +++ .evergreen/config/legacy-variants.yml | 354 ++++++ .evergreen/config/test/_template-local.yml | 33 + .evergreen/install-dependencies.sh | 93 -- 15 files changed, 1291 insertions(+), 1102 deletions(-) create mode 100644 .evergreen/compile-extension.sh create mode 100644 .evergreen/config/build-task-groups.yml create mode 100644 .evergreen/config/build-variants.yml create mode 100644 .evergreen/config/build/_template-build-extension.yml create mode 100644 .evergreen/config/build/build-php-7.4.yml create mode 100644 .evergreen/config/build/build-php-8.0.yml create mode 100644 .evergreen/config/build/build-php-8.1.yml create mode 100644 .evergreen/config/build/build-php-8.2.yml create mode 100644 .evergreen/config/functions.yml create mode 100644 .evergreen/config/generate-config.php create mode 100644 .evergreen/config/legacy-tasks.yml create mode 100644 .evergreen/config/legacy-variants.yml create mode 100644 .evergreen/config/test/_template-local.yml diff --git a/.evergreen/compile-extension.sh b/.evergreen/compile-extension.sh new file mode 100644 index 000000000..4eca2c291 --- /dev/null +++ b/.evergreen/compile-extension.sh @@ -0,0 +1,71 @@ +#!/bin/sh +set -o errexit # Exit the script with error if any of the commands fail + +PATH="$PHP_PATH/bin:$PATH" + +install_extension () +{ + rm -f ${PHP_PATH}/lib/php.ini + + if [ "x${EXTENSION_BRANCH}" != "x" ] || [ "x${EXTENSION_REPO}" != "x" ]; then + CLONE_REPO=${EXTENSION_REPO:-https://github.com/mongodb/mongo-php-driver} + CHECKOUT_BRANCH=${EXTENSION_BRANCH:-master} + + echo "Compiling driver branch ${CHECKOUT_BRANCH} from repository ${CLONE_REPO}" + + mkdir -p /tmp/compile + rm -rf /tmp/compile/mongo-php-driver + git clone ${CLONE_REPO} /tmp/compile/mongo-php-driver + cd /tmp/compile/mongo-php-driver + + git checkout ${CHECKOUT_BRANCH} + git submodule update --init + phpize + ./configure --enable-mongodb-developer-flags + make all -j20 > /dev/null + make install + + cd ${PROJECT_DIRECTORY} + elif [ "${EXTENSION_VERSION}" != "" ]; then + echo "Installing driver version ${EXTENSION_VERSION} from PECL" + pecl install -f mongodb-${EXTENSION_VERSION} + else + echo "Installing latest driver version from PECL" + pecl install -f mongodb + fi + + sudo cp ${PROJECT_DIRECTORY}/.evergreen/config/php.ini ${PHP_PATH}/lib/php.ini + + php --ri mongodb +} + +install_composer () +{ + EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" + php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" + ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" + + if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then + >&2 echo 'ERROR: Invalid installer checksum' + rm composer-setup.php + exit 1 + fi + + php composer-setup.php --quiet + rm composer-setup.php +} + +case "$DEPENDENCIES" in + lowest*) + COMPOSER_FLAGS="${COMPOSER_FLAGS} --prefer-lowest" + ;; + + *) + ;; +esac + +install_extension + +# install_composer + +# php composer.phar update $COMPOSER_FLAGS diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 9e6027b37..8d7713824 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1,507 +1,26 @@ -######################################## -# Evergreen Template for MongoDB Drivers -######################################## - -# When a task that used to pass starts to fail -# Go through all versions that may have been skipped to detect -# when the task started failing +# When a task that used to pass starts to fail, go through all versions that may have been skipped to detect when the +# task started failing. stepback: true -# Mark a failure as a system/bootstrap failure (purple box) rather then a task -# failure by default. +# Mark a failure as a system/bootstrap failure (purple box) rather than a task failure by default. # Actual testing tasks are marked with `type: test` command_type: system -# Protect ourself against rogue test case, or curl gone wild, that runs forever -# Good rule of thumb: the averageish length a task takes, times 5 -# That roughly accounts for variable system performance for various buildvariants -exec_timeout_secs: 1800 # 6 minutes is the longest we'll ever run - -# What to do when evergreen hits the timeout (`post:` tasks are run automatically) -timeout: - - command: shell.exec - params: - script: | - ls -la - -functions: - "fetch source": - # Executes git clone and applies the submitted patch, if any - - command: git.get_project - params: - directory: "src" - # Make an evergreen exapanstion file with dynamic values - - command: shell.exec - params: - working_dir: "src" - script: | - # Get the current unique version of this checkout - if [ "${is_patch}" = "true" ]; then - CURRENT_VERSION=$(git describe)-patch-${version_id} - else - CURRENT_VERSION=latest - fi - - export DRIVERS_TOOLS="$(pwd)/../drivers-tools" - export PROJECT_DIRECTORY="$(pwd)" - - # Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory - if [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin - export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS) - export PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY) - fi - - export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration" - export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin" - export UPLOAD_BUCKET="${project}" - - cat < expansion.yml - CURRENT_VERSION: "$CURRENT_VERSION" - DRIVERS_TOOLS: "$DRIVERS_TOOLS" - MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME" - MONGODB_BINARIES: "$MONGODB_BINARIES" - UPLOAD_BUCKET: "$UPLOAD_BUCKET" - PROJECT_DIRECTORY: "$PROJECT_DIRECTORY" - PREPARE_SHELL: | - set -o errexit - export DRIVERS_TOOLS="$DRIVERS_TOOLS" - export MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME" - export MONGODB_BINARIES="$MONGODB_BINARIES" - export UPLOAD_BUCKET="$UPLOAD_BUCKET" - export PROJECT_DIRECTORY="$PROJECT_DIRECTORY" - - export TMPDIR="$MONGO_ORCHESTRATION_HOME/db" - export PATH="$MONGODB_BINARIES:$PATH" - export PROJECT="${project}" - EOT - # See what we've done - cat expansion.yml - - # Load the expansion file to make an evergreen variable with the current unique version - - command: expansions.update - params: - file: src/expansion.yml - - "prepare resources": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - rm -rf $DRIVERS_TOOLS - if [ "${project}" = "drivers-tools" ]; then - # If this was a patch build, doing a fresh clone would not actually test the patch - cp -R ${PROJECT_DIRECTORY}/ $DRIVERS_TOOLS - else - git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git --depth 1 $DRIVERS_TOOLS - fi - echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config - - "upload mo artifacts": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - find $MONGO_ORCHESTRATION_HOME -name \*.log | xargs tar czf mongodb-logs.tar.gz - - command: s3.put - params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} - local_file: mongodb-logs.tar.gz - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-logs.tar.gz - bucket: mciuploads - permissions: public-read - content_type: ${content_type|application/x-gzip} - display_name: "mongodb-logs.tar.gz" - - command: s3.put - params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} - local_file: ${DRIVERS_TOOLS}/.evergreen/orchestration/server.log - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-orchestration.log - bucket: mciuploads - permissions: public-read - content_type: ${content_type|text/plain} - display_name: "orchestration.log" - - "upload working dir": - - command: archive.targz_pack - params: - target: "working-dir.tar.gz" - source_dir: ${PROJECT_DIRECTORY}/ - include: - - "./**" - - command: s3.put - params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} - local_file: working-dir.tar.gz - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-working-dir.tar.gz - bucket: mciuploads - permissions: public-read - content_type: ${content_type|application/x-gzip} - display_name: "working-dir.tar.gz" - - command: archive.targz_pack - params: - target: "drivers-dir.tar.gz" - source_dir: ${DRIVERS_TOOLS} - include: - - "./**" - exclude_files: - # Windows cannot read the mongod *.lock files because they are locked. - - "*.lock" - - command: s3.put - params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} - local_file: drivers-dir.tar.gz - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-drivers-dir.tar.gz - bucket: mciuploads - permissions: public-read - content_type: ${content_type|application/x-gzip} - display_name: "drivers-dir.tar.gz" - - "upload test results": - - command: attach.xunit_results - params: - # Uploading test results does not work when using ${PROJECT_DIRECTORY}, - # so we use an absolute path to work around this - file: "src/test-results.xml" - - command: attach.results - params: - file_location: "${DRIVERS_TOOLS}/results.json" - - "bootstrap mongo-orchestration": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - SKIP_CRYPT_SHARED=${SKIP_CRYPT_SHARED} SKIP_LEGACY_SHELL=true MONGODB_VERSION=${MONGODB_VERSION} ORCHESTRATION_FILE=${ORCHESTRATION_FILE} TOPOLOGY=${TOPOLOGY} AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} LOAD_BALANCER=${LOAD_BALANCER} REQUIRE_API_VERSION=${REQUIRE_API_VERSION} sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh - # run-orchestration generates expansion file with MONGODB_URI and CRYPT_SHARED_LIB_PATH - - command: expansions.update - params: - file: mo-expansion.yml - - "stop mongo-orchestration": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - sh ${DRIVERS_TOOLS}/.evergreen/stop-orchestration.sh - - "bootstrap mongohoused": - - command: shell.exec - params: - script: | - VARIANT=${VARIANT} DRIVERS_TOOLS="${DRIVERS_TOOLS}" sh ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/build-mongohouse-local.sh - - command: shell.exec - params: - background: true - script: | - DRIVERS_TOOLS="${DRIVERS_TOOLS}" sh ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/run-mongohouse-local.sh - - "create serverless instance": - - command: shell.exec - params: - working_dir: "src" - script: | - ${PREPARE_SHELL} - SERVERLESS_DRIVERS_GROUP=${SERVERLESS_DRIVERS_GROUP} \ - SERVERLESS_API_PUBLIC_KEY=${SERVERLESS_API_PUBLIC_KEY} \ - SERVERLESS_API_PRIVATE_KEY=${SERVERLESS_API_PRIVATE_KEY} \ - bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh - - command: expansions.update - params: - file: src/serverless-expansion.yml - - command: shell.exec - params: - shell: bash - script: | - ${PREPARE_SHELL} - - if [ -z "${SERVERLESS_MONGODB_VERSION}" ]; then - echo "expected SERVERLESS_MONGODB_VERSION to be set" - exit 1 - fi - - . ${DRIVERS_TOOLS}/.evergreen/find-python3.sh - PYTHON_BINARY="$(find_python3)" || exit 1 - - # Download the enterprise server download for current platform to $MONGODB_BINARIES. - # This is required for tests that need mongocryptd. - # $MONGODB_BINARIES is added to the $PATH in fetch-source. - ${PYTHON_BINARY} ${DRIVERS_TOOLS}/.evergreen/mongodl.py \ - --component archive \ - --version ${SERVERLESS_MONGODB_VERSION} \ - --edition enterprise \ - --out $MONGODB_BINARIES \ - --strip-path-components 2 - - # Download the crypt_shared dynamic library for the current platform. - ${PYTHON_BINARY} ${DRIVERS_TOOLS}/.evergreen/mongodl.py \ - --component crypt_shared \ - --version ${SERVERLESS_MONGODB_VERSION} \ - --edition enterprise \ - --out . \ - --only "**/mongo_crypt_v1.*" \ - --strip-path-components 1 - - # Find the crypt_shared library file in the current directory and set the CRYPT_SHARED_LIB_PATH to - # the path of that file. Only look for .so, .dll, or .dylib files to prevent matching any other - # downloaded files. - CRYPT_SHARED_LIB_PATH="$(find $(pwd) -maxdepth 1 -type f \ - -name 'mongo_crypt_v1.so' -o \ - -name 'mongo_crypt_v1.dll' -o \ - -name 'mongo_crypt_v1.dylib')" - - echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH" >> crypt-expansion.yml - - # Load the expansion file to make an evergreen variable with the current unique version - - command: expansions.update - params: - file: crypt-expansion.yml - - "delete serverless instance": - - command: shell.exec - params: - script: | - # Only run if a serverless instance was started - if [ -n "${SERVERLESS_INSTANCE_NAME}" ]; then - SERVERLESS_INSTANCE_NAME=${SERVERLESS_INSTANCE_NAME} \ - SERVERLESS_DRIVERS_GROUP=${SERVERLESS_DRIVERS_GROUP} \ - SERVERLESS_API_PUBLIC_KEY=${SERVERLESS_API_PUBLIC_KEY} \ - SERVERLESS_API_PRIVATE_KEY=${SERVERLESS_API_PRIVATE_KEY} \ - bash ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh - fi - - "run 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 PATH="${PHP_PATH}/bin:$PATH" - - API_VERSION=${API_VERSION} \ - CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \ - MONGODB_URI="${MONGODB_URI}" \ - MONGODB_SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI}" \ - MONGODB_MULTI_MONGOS_LB_URI="${MULTI_MONGOS_LB_URI}" \ - PHP_VERSION=${PHP_VERSION} \ - SSL=${SSL} \ - TESTS=${TESTS} \ - sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh - - "run atlas data lake test": - - command: shell.exec - type: test - params: - working_dir: "src" - script: | - ${PREPARE_SHELL} - export PATH="${PHP_PATH}/bin:$PATH" - - MONGODB_URI="mongodb://mhuser:pencil@127.0.0.1:27017" \ - TESTS="atlas-data-lake" \ - sh ${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 MONGODB_USERNAME=${SERVERLESS_ATLAS_USER} - export MONGODB_PASSWORD=${SERVERLESS_ATLAS_PASSWORD} - export PATH="${PHP_PATH}/bin:$PATH" - - CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \ - MONGODB_URI="${SERVERLESS_URI}" \ - TESTS="serverless" \ - sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh - - "cleanup": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - rm -rf $DRIVERS_TOOLS || true - - "fix absolute paths": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - for filename in $(find ${DRIVERS_TOOLS} -name \*.json); do - perl -p -i -e "s|ABSOLUTE_PATH_REPLACEMENT_TOKEN|${DRIVERS_TOOLS}|g" $filename - done - - "windows fix": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do - cat $i | tr -d '\r' > $i.new - mv $i.new $i - done - # Copy client certificate because symlinks do not work on Windows. - cp ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem - - "make files executable": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do - chmod +x $i - done - - "install dependencies": - - command: shell.exec - params: - working_dir: "src" - script: | - ${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} EXTENSION_VERSION=${EXTENSION_VERSION} EXTENSION_REPO=${EXTENSION_REPO} EXTENSION_BRANCH=${EXTENSION_BRANCH} DEPENDENCIES=${DEPENDENCIES} sh $file || echo "$file not available, skipping" - # install-dependencies generates expansion file with the PHP_PATH for the chosen PHP version - - command: expansions.update - params: - file: src/php-expansion.yml - - "start load balancer": - - command: shell.exec - params: - script: | - MONGODB_URI="${MONGODB_URI}" ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh start - - command: expansions.update - params: - file: lb-expansion.yml - - "stop load balancer": - - command: shell.exec - params: - script: | - # Only run if a load balancer was started - if [ -n "${SINGLE_MONGOS_LB_URI}" ]; then - ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh stop - fi - - "start kms servers": - - command: shell.exec - # Init venv without background:true to install dependencies - params: - shell: bash - script: |- - set -o errexit - cd ${DRIVERS_TOOLS}/.evergreen/csfle - . ./activate-kmstlsvenv.sh - - command: shell.exec - params: - background: true - shell: bash - # Use different ports for KMS HTTP servers to avoid conflicts with load balancers - script: |- - set -o errexit - cd ${DRIVERS_TOOLS}/.evergreen/csfle - . ./activate-kmstlsvenv.sh - python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8100 & - python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8101 & - python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8102 --require_client_cert & - python -u kms_kmip_server.py --port 5698 & - - command: expansions.update - params: - updates: - - key: client_side_encryption_kms_tls_ca_file - value: ${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem - - key: client_side_encryption_kms_tls_certificate_key_file - value: ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem - - key: client_side_encryption_kms_endpoint_expired - value: 127.0.0.1:8100 - - key: client_side_encryption_kms_endpoint_wrong_host - value: 127.0.0.1:8101 - - key: client_side_encryption_kms_endpoint_require_client_cert - value: 127.0.0.1:8102 - - key: client_side_encryption_kmip_endpoint - value: localhost:5698 - - "set aws temp creds": - - command: shell.exec - params: - shell: bash - script: |- - set -o errexit - - 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_DEFAULT_REGION="us-east-1" - - pushd ${DRIVERS_TOOLS}/.evergreen/csfle - . ./activate-kmstlsvenv.sh - . ./set-temp-creds.sh - popd +# Protect ourselves against rogue test case that runs forever +# Good rule of thumb: the average length a task takes, times 5, which roughly accounts for variable system performance +# for various build variants +exec_timeout_secs: 1800 - if [ -z "$CSFLE_AWS_TEMP_ACCESS_KEY_ID" ]; then - echo "Failed to set AWS temporary credentials!" - exit 1 - fi - - cat < aws-expansion.yml - client_side_encryption_aws_temp_access_key_id: "$CSFLE_AWS_TEMP_ACCESS_KEY_ID" - client_side_encryption_aws_temp_secret_access_key_key: "$CSFLE_AWS_TEMP_SECRET_ACCESS_KEY" - client_side_encryption_aws_temp_session_token: "$CSFLE_AWS_TEMP_SESSION_TOKEN" - EOT - - command: expansions.update - params: - file: aws-expansion.yml - -pre: +# These pre and post rules apply to all tasks not part of a task group, which should only ever be tests against local +# MongoDB instances. All other tasks that require special preparation should be run from within a task group +pre: &test_setup - func: "fetch source" - func: "prepare resources" - func: "windows fix" - func: "fix absolute paths" - func: "make files executable" - func: "install dependencies" - -post: - # Skip: uploading the full working directory is not needed by drivers-evergreen-tools. - # - func: "upload working dir" +post: &test_teardown - func: "upload mo artifacts" - func: "upload test results" - func: "delete serverless instance" @@ -509,523 +28,18 @@ post: - func: "stop mongo-orchestration" - func: "cleanup" -tasks: - - # Wildcard task. Do you need to find out what tools are available and where? - # Throw it here, and execute this task on all buildvariants - - name: getdata - commands: - - command: shell.exec - type: test - params: - script: | - . ${DRIVERS_TOOLS}/.evergreen/download-mongodb.sh || true - get_distro || true - echo $DISTRO - echo $MARCH - echo $OS - uname -a || true - ls /etc/*release* || true - cc --version || true - gcc --version || true - clang --version || true - gcov --version || true - lcov --version || true - llvm-cov --version || true - echo $PATH - ls -la /usr/local/Cellar/llvm/*/bin/ || true - ls -la /usr/local/Cellar/ || true - scan-build --version || true - genhtml --version || true - valgrind --version || true - - -# Standard test tasks {{{ - - - name: "test-standalone" - tags: ["standalone"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "server" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - - - name: "test-replica_set" - tags: ["replica_set"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "replica_set" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - - - name: "test-sharded_cluster" - tags: ["sharded_cluster"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "sharded_cluster" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - - - name: "test-atlas-data-lake" - commands: - - func: "bootstrap mongohoused" - - func: "run atlas data lake test" - - - name: "test-requireApiVersion" - tags: ["versioned-api"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "server" - AUTH: "auth" - REQUIRE_API_VERSION: "yes" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - vars: - API_VERSION: "1" - - - name: "test-acceptApiVersion2" - tags: ["versioned-api"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "server" - ORCHESTRATION_FILE: "versioned-api-testing.json" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - vars: - TESTS: "versioned-api" - - - name: "test-serverless" - tags: ["serverless"] - commands: - - func: "create serverless instance" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run serverless tests" - - - name: "test-loadBalanced" - tags: ["loadbalanced"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "sharded_cluster" - LOAD_BALANCER: "true" - SSL: "yes" - - func: "start load balancer" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - vars: - # Note: loadBalanced=true should already be appended to SINGLE_MONGOS_LB_URI - MONGODB_URI: "${SINGLE_MONGOS_LB_URI}" - SSL: "yes" - # Note: "stop load balancer" will be called from "post" - - - name: "test-csfle-crypt_shared" - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "replica_set" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - vars: - TESTS: "csfle" - - - name: "test-csfle-mongocryptd" - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "replica_set" - SKIP_CRYPT_SHARED: "yes" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - vars: - TESTS: "csfle" - - - name: "test-without_aws_creds" - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "replica_set" - - func: "start kms servers" - - func: "run tests" - vars: - client_side_encryption_aws_access_key_id: "" - client_side_encryption_aws_secret_access_key: "" - TESTS: "csfle-without-aws-creds" - - - name: "test-atlas" - commands: - - func: "start kms servers" - - func: "run tests" - vars: - TESTS: "atlas" - -# }}} - - -axes: - # Note: install-dependencies.sh will search for the latest minor version - # matching the PHP_VERSION constant - - id: php-versions - display_name: PHP Version - values: - - id: "8.2" - display_name: "PHP 8.2" - variables: - PHP_VERSION: "8.2" - - id: "8.1" - display_name: "PHP 8.1" - variables: - PHP_VERSION: "8.1" - - id: "8.0" - display_name: "PHP 8.0" - variables: - PHP_VERSION: "8.0" - - id: "7.4" - display_name: "PHP 7.4" - variables: - PHP_VERSION: "7.4" - - - id: php-edge-versions - display_name: PHP Version - values: - - id: "latest-stable" - display_name: "PHP 8.2" - variables: - PHP_VERSION: "8.2" - - id: "oldest-supported" - display_name: "PHP 7.4" - variables: - PHP_VERSION: "7.4" - - - id: mongodb-versions - display_name: MongoDB Version - values: - - id: "latest" - display_name: "MongoDB latest" - variables: - MONGODB_VERSION: "latest" - - id: "rapid" - display_name: "MongoDB rapid" - variables: - MONGODB_VERSION: "rapid" - - id: "7.0" - display_name: "MongoDB 7.0" - variables: - MONGODB_VERSION: "7.0" - - id: "6.0" - display_name: "MongoDB 6.0" - variables: - MONGODB_VERSION: "6.0" - - id: "5.0" - display_name: "MongoDB 5.0" - variables: - MONGODB_VERSION: "5.0" - - id: "4.4" - display_name: "MongoDB 4.4" - variables: - MONGODB_VERSION: "4.4" - - id: "4.2" - display_name: "MongoDB 4.2" - variables: - MONGODB_VERSION: "4.2" - - id: "4.0" - display_name: "MongoDB 4.0" - variables: - MONGODB_VERSION: "4.0" - - id: "3.6" - display_name: "MongoDB 3.6" - variables: - MONGODB_VERSION: "3.6" - - - id: mongodb-edge-versions - display_name: MongoDB Version - values: - - id: "latest-stable" - display_name: "MongoDB 6.0" - variables: - MONGODB_VERSION: "6.0" - - id: "oldest-supported" - display_name: "MongoDB 3.6" - variables: - MONGODB_VERSION: "3.6" - - - id: driver-versions - display_name: Driver Version - values: - - id: "oldest-supported" - display_name: "PHPC 1.17.0" - variables: - EXTENSION_BRANCH: "master" - - id: "latest-stable" - display_name: "PHPC (1.17.x)" - variables: - EXTENSION_BRANCH: "master" - - id: "latest-dev" - display_name: "PHPC (1.17-dev)" - variables: - EXTENSION_BRANCH: "master" - - - id: os - display_name: OS - values: - # Debian - - id: debian11 - display_name: "Debian 11" - run_on: debian11-small - - id: debian10 - display_name: "Debian 10" - run_on: debian10-small - - id: debian92 - display_name: "Debian 9.2" - run_on: debian92-small - - # RHEL - - id: rhel90 - display_name: "RHEL 9.0" - run_on: rhel90-small - - id: rhel80 - display_name: "RHEL 8.0" - run_on: rhel80-small - - # Ubuntu LTS - - id: ubuntu2204 - display_name: "Ubuntu 22.04 x64" - run_on: ubuntu2204-small - - id: ubuntu2204-arm64 - display_name: "Ubuntu 22.04 ARM64" - run_on: ubuntu2204-arm64-small - - id: ubuntu2004 - display_name: "Ubuntu 20.04 x64" - run_on: ubuntu2004-small - - id: ubuntu2004-arm64 - display_name: "Ubuntu 20.04 ARM64" - run_on: ubuntu2204-arm64-small - - - id: topology - display_name: Topology - values: - - id: standalone - display_name: Standalone - variables: - TOPOLOGY: "server" - - id: replicaset - display_name: Replica Set - variables: - TOPOLOGY: "replica_set" - - id: sharded-cluster - display_name: Sharded Cluster - variables: - TOPOLOGY: "sharded_cluster" - - - id: auth - display_name: Authentication - values: - - id: auth - display_name: Auth - variables: - AUTH: "auth" - - id: noauth - display_name: NoAuth - variables: - AUTH: "noauth" - - - id: ssl - display_name: SSL - values: - - id: ssl - display_name: SSL - variables: - SSL: "ssl" - - id: nossl - display_name: NoSSL - variables: - SSL: "nossl" - - - id: storage-engine - display_name: Storage - values: - - id: mmapv1 - display_name: MMAPv1 - variables: - STORAGE_ENGINE: "mmapv1" - - id: wiredtiger - display_name: WiredTiger - variables: - STORAGE_ENGINE: "wiredtiger" - - id: inmemory - display_name: InMemory - variables: - STORAGE_ENGINE: "inmemory" - - - id: dependencies - display_name: Dependencies - values: - - id: lowest - display_name: Lowest - variables: - DEPENDENCIES: "lowest" - -task_groups: - - name: test_atlas_task_group - setup_group: - - func: "fetch source" - - func: "prepare resources" - - func: "fix absolute paths" - - func: "make files executable" - - func: "install dependencies" - - command: subprocess.exec - params: - working_dir: src - binary: bash - add_expansions_to_env: true - env: - MONGODB_VERSION: '7.0' - args: - - ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh - - command: expansions.update - params: - file: src/atlas-expansion.yml - teardown_group: - - command: subprocess.exec - params: - working_dir: src - binary: bash - add_expansions_to_env: true - args: - - ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh - - func: "upload test results" - - func: "cleanup" - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - test-atlas - -buildvariants: -# Test all PHP versions with latest-stable MongoDB and PHPC on all platforms -- matrix_name: "test-php-versions" - matrix_spec: - os: - - debian11 - - debian10 - - rhel90 - - ubuntu2204 - - ubuntu2204-arm64 - - ubuntu2004 - mongodb-edge-versions: "latest-stable" - php-versions: "*" - driver-versions: "latest-stable" - display_name: "${os}, ${mongodb-edge-versions}, ${php-versions}, ${driver-versions}" - exclude_spec: - # Exclude "latest-stable" PHP version for Debian 11 (see: test-mongodb-versions matrix) - - { "os": "debian11", "mongodb-edge-versions": "latest-stable", "php-versions": "8.2", "driver-versions": "latest-stable" } - # Exclude PHP versions older than 8.1 on RHEL 9 and Ubuntu 22.04 (OpenSSL 3 is only supported on PHP 8.1+) - - { "os": ["rhel90", "ubuntu2204-arm64", "ubuntu2204"], "php-versions": ["7.4", "8.0"], "mongodb-edge-versions": "*", "driver-versions": "*" } - tasks: - - name: "test-standalone" - - name: "test-replica_set" - - name: "test-sharded_cluster" - -# Test all topologies and MongoDB versions with latest-stable PHP and PHPC on Debian -- matrix_name: "test-mongodb-versions" - matrix_spec: { "os": ["debian92", "debian11"], "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "${os}, ${mongodb-versions}, ${php-edge-versions}, ${driver-versions}" - exclude_spec: - # Debian 9.2 only supports up to MongoDB 5.0 - - { "os": "debian92", "mongodb-versions": ["6.0", "7.0", "rapid", "latest"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4", "5.0"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - tasks: - - name: "test-standalone" - - name: "test-replica_set" - - name: "test-sharded_cluster" - -# Test oldest-supported PHP, MongoDB, and driver versions with lowest dependencies on Debian -- matrix_name: "test-oldest-supported" - matrix_spec: { "os": "debian92", "mongodb-edge-versions": "oldest-supported", "php-edge-versions": "oldest-supported", "driver-versions": "oldest-supported", "dependencies": "lowest" } - display_name: "Lowest Dependencies: ${os}, ${mongodb-edge-versions}, ${php-edge-versions}, ${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", "driver-versions": "latest-stable" } - display_name: "Atlas Data Lake" - run_on: debian11 - expansions: - VARIANT: debian11 # Referenced by ADL build script for downloading MQLRun - tasks: - - name: "test-atlas-data-lake" - -- matrix_name: "test-requireApiVersion" - matrix_spec: { "os": "debian11", "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "Versioned API - ${mongodb-versions}" - exclude_spec: - # Stable API is available from MongoDB 5.0+ - - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - tasks: - - .versioned-api - -- matrix_name: "serverless" - matrix_spec: { "os": "debian11", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "Serverless" - tasks: - - .serverless - -- matrix_name: "test-loadBalanced" - matrix_spec: { "os": "debian11", "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "Load balanced - ${mongodb-versions}" - exclude_spec: - # Load balancer is available from MongoDB 5.0+ - - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - tasks: - - name: "test-loadBalanced" +# Include files that contain various tasks, task groups, and build variant definitions +include: + - filename: .evergreen/config/functions.yml -# CSFLE tests (crypt_shared and mongocryptd) are tested on RHEL 8 as it's the only version that supports -# 4.2 AND 6.0 (which is required for crypt_shared), as well as a somewhat relevant PHP version. -# Newer MongoDB version may require adding different operating systems here -- matrix_name: "test-csfle-crypt_shared" - matrix_spec: { "os": "rhel80", "mongodb-versions": "*", "php-versions": "8.0", "driver-versions": "latest-stable" } - display_name: "CSFLE crypt_shared - ${mongodb-versions}" - exclude_spec: - # MongoDB < 4.2 does not need to be tested. - - { "os": "rhel80", "mongodb-versions": ["3.6", "4.0"], "php-versions": "8.0", "driver-versions": "latest-stable" } - tasks: - - name: "test-csfle-crypt_shared" -- matrix_name: "test-csfle-mongocryptd" - matrix_spec: { "os": "rhel80", "mongodb-versions": "*", "php-versions": "8.0", "driver-versions": "latest-stable" } - display_name: "CSFLE mongocryptd - ${mongodb-versions}" - exclude_spec: - # MongoDB < 4.2 does not need to be tested. - - { "os": "rhel80", "mongodb-versions": ["3.6", "4.0"], "php-versions": "8.0", "driver-versions": "latest-stable" } - tasks: - - name: "test-csfle-mongocryptd" + - filename: .evergreen/config/build-task-groups.yml + - filename: .evergreen/config/build-variants.yml -# Run CSFLE tests without AWS credentials (for "On-demand AWS Credentials" prose test) -- matrix_name: "test-csfle-without_aws_creds" - matrix_spec: { "os": ["debian92", "debian11"], "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "CSFLE without_aws_creds - ${mongodb-versions}" - exclude_spec: - # CSFLE is available from MongoDB 4.2+ and Debian 9.2 only supports up to MongoDB 5.0 - - { "os": "debian92", "mongodb-versions": ["3.6", "4.0", "6.0", "rapid", "latest"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4", "5.0"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - tasks: - - name: "test-without_aws_creds" +# - filename: .evergreen/config/test-tasks.yml +# - filename: .evergreen/config/test-variants.yml -- matrix_name: rhel8-test-atlas - matrix_spec: { "os": ["rhel80"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: Atlas Tests - tasks: - - test_atlas_task_group + # Automatically generated files + - filename: .evergreen/config/build/build-php-8.2.yml + - filename: .evergreen/config/build/build-php-8.1.yml + - filename: .evergreen/config/build/build-php-8.0.yml + - filename: .evergreen/config/build/build-php-7.4.yml diff --git a/.evergreen/config/build-task-groups.yml b/.evergreen/config/build-task-groups.yml new file mode 100644 index 000000000..eb1078db8 --- /dev/null +++ b/.evergreen/config/build-task-groups.yml @@ -0,0 +1,34 @@ +variables: + build_setup: &build_setup + - func: "fetch source" + - func: "prepare resources" + - func: "fix absolute paths" + - func: "make files executable" + - func: "install dependencies" + build_teardown: &build_teardown + - func: "upload working dir" + - func: "cleanup" + +task_groups: + # Builds all versions of PHP + - name: "build-all-php" + # Keep this number in sync with the number of PHP versions to allow for parallel builds + max_hosts: 4 + setup_task: *build_setup + setup_task_can_fail_task: true + setup_task_timeout_secs: 1800 + teardown_task: *build_teardown + tasks: + - ".build" + + # Builds all versions of PHP that support OpenSSL 3 (PHP 8.1+) +# - name: "build-php-openssl3" +# # Keep this number in sync with the number of PHP versions to allow for parallel builds +# # Subtract 2 versions as PHP 7.4 and 8.0 are not built with OpenSSL 3 +# max_hosts: 2 +# setup_task: *build_setup +# setup_task_can_fail_task: true +# setup_task_timeout_secs: 1800 +# teardown_task: *build_teardown +# tasks: +# - ".build !.php7.4 !.php8.0" diff --git a/.evergreen/config/build-variants.yml b/.evergreen/config/build-variants.yml new file mode 100644 index 000000000..d1abcf800 --- /dev/null +++ b/.evergreen/config/build-variants.yml @@ -0,0 +1,11 @@ +# +# Build variants to build the driver - these are run for all operating systems and PHP versions we support +# +buildvariants: + # Debian + - name: build-debian11 + display_name: "Build: Debian 11" + tags: ["build", "debian", "x64"] + run_on: debian11-small + tasks: + - name: "build-all-php" diff --git a/.evergreen/config/build/_template-build-extension.yml b/.evergreen/config/build/_template-build-extension.yml new file mode 100644 index 000000000..054e1d7b8 --- /dev/null +++ b/.evergreen/config/build/_template-build-extension.yml @@ -0,0 +1,10 @@ +tasks: + - name: "build-php-%phpVersion%" + tags: ["build", "php%phpVersion%"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "%phpVersion%" + - func: "compile extension" + vars: + PHP_VERSION: "%phpVersion%" diff --git a/.evergreen/config/build/build-php-7.4.yml b/.evergreen/config/build/build-php-7.4.yml new file mode 100644 index 000000000..9e22b8955 --- /dev/null +++ b/.evergreen/config/build/build-php-7.4.yml @@ -0,0 +1,11 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "build-php-7.4" + tags: ["build", "php7.4"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "7.4" + - func: "compile extension" + vars: + PHP_VERSION: "7.4" diff --git a/.evergreen/config/build/build-php-8.0.yml b/.evergreen/config/build/build-php-8.0.yml new file mode 100644 index 000000000..67677eb71 --- /dev/null +++ b/.evergreen/config/build/build-php-8.0.yml @@ -0,0 +1,11 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "build-php-8.0" + tags: ["build", "php8.0"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.0" + - func: "compile extension" + vars: + PHP_VERSION: "8.0" diff --git a/.evergreen/config/build/build-php-8.1.yml b/.evergreen/config/build/build-php-8.1.yml new file mode 100644 index 000000000..69e4f21f0 --- /dev/null +++ b/.evergreen/config/build/build-php-8.1.yml @@ -0,0 +1,11 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "build-php-8.1" + tags: ["build", "php8.1"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.1" + - func: "compile extension" + vars: + PHP_VERSION: "8.1" diff --git a/.evergreen/config/build/build-php-8.2.yml b/.evergreen/config/build/build-php-8.2.yml new file mode 100644 index 000000000..8c2afc880 --- /dev/null +++ b/.evergreen/config/build/build-php-8.2.yml @@ -0,0 +1,9 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "build-php-8.2" + tags: ["build", "php8.2"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.2" + - func: "compile extension" diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml new file mode 100644 index 000000000..6555703e6 --- /dev/null +++ b/.evergreen/config/functions.yml @@ -0,0 +1,502 @@ +functions: + "fetch source": + # Executes git clone and applies the submitted patch, if any + - command: git.get_project + params: + directory: "src" + # Make an evergreen exapanstion file with dynamic values + - command: shell.exec + params: + working_dir: "src" + script: | + # Get the current unique version of this checkout + if [ "${is_patch}" = "true" ]; then + CURRENT_VERSION=$(git describe)-patch-${version_id} + else + CURRENT_VERSION=latest + fi + + export DRIVERS_TOOLS="$(pwd)/../drivers-tools" + export PROJECT_DIRECTORY="$(pwd)" + + # Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory + if [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin + export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS) + export PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY) + fi + + export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration" + export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin" + export UPLOAD_BUCKET="${project}" + + cat < expansion.yml + CURRENT_VERSION: "$CURRENT_VERSION" + DRIVERS_TOOLS: "$DRIVERS_TOOLS" + MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME" + MONGODB_BINARIES: "$MONGODB_BINARIES" + UPLOAD_BUCKET: "$UPLOAD_BUCKET" + PROJECT_DIRECTORY: "$PROJECT_DIRECTORY" + PREPARE_SHELL: | + set -o errexit + export DRIVERS_TOOLS="$DRIVERS_TOOLS" + export MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME" + export MONGODB_BINARIES="$MONGODB_BINARIES" + export UPLOAD_BUCKET="$UPLOAD_BUCKET" + export PROJECT_DIRECTORY="$PROJECT_DIRECTORY" + + export TMPDIR="$MONGO_ORCHESTRATION_HOME/db" + export PATH="$MONGODB_BINARIES:$PATH" + export PROJECT="${project}" + EOT + # See what we've done + cat expansion.yml + + # Load the expansion file to make an evergreen variable with the current unique version + - command: expansions.update + params: + file: src/expansion.yml + + "prepare resources": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + rm -rf $DRIVERS_TOOLS + if [ "${project}" = "drivers-tools" ]; then + # If this was a patch build, doing a fresh clone would not actually test the patch + cp -R ${PROJECT_DIRECTORY}/ $DRIVERS_TOOLS + else + git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git --depth 1 $DRIVERS_TOOLS + fi + echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config + + "upload mo artifacts": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + find $MONGO_ORCHESTRATION_HOME -name \*.log | xargs tar czf mongodb-logs.tar.gz + - command: s3.put + params: + aws_key: ${aws_key} + aws_secret: ${aws_secret} + local_file: mongodb-logs.tar.gz + remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-logs.tar.gz + bucket: mciuploads + permissions: public-read + content_type: ${content_type|application/x-gzip} + display_name: "mongodb-logs.tar.gz" + - command: s3.put + params: + aws_key: ${aws_key} + aws_secret: ${aws_secret} + local_file: ${DRIVERS_TOOLS}/.evergreen/orchestration/server.log + remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-orchestration.log + bucket: mciuploads + permissions: public-read + content_type: ${content_type|text/plain} + display_name: "orchestration.log" + + "upload working dir": + - command: archive.targz_pack + params: + target: "working-dir.tar.gz" + source_dir: ${PROJECT_DIRECTORY}/ + include: + - "./**" + - command: s3.put + params: + aws_key: ${aws_key} + aws_secret: ${aws_secret} + local_file: working-dir.tar.gz + remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-working-dir.tar.gz + bucket: mciuploads + permissions: public-read + content_type: ${content_type|application/x-gzip} + display_name: "working-dir.tar.gz" + - command: archive.targz_pack + params: + target: "drivers-dir.tar.gz" + source_dir: ${DRIVERS_TOOLS} + include: + - "./**" + exclude_files: + # Windows cannot read the mongod *.lock files because they are locked. + - "*.lock" + - command: s3.put + params: + aws_key: ${aws_key} + aws_secret: ${aws_secret} + local_file: drivers-dir.tar.gz + remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-drivers-dir.tar.gz + bucket: mciuploads + permissions: public-read + content_type: ${content_type|application/x-gzip} + display_name: "drivers-dir.tar.gz" + + "upload test results": + - command: attach.xunit_results + params: + # Uploading test results does not work when using ${PROJECT_DIRECTORY}, + # so we use an absolute path to work around this + file: "src/test-results.xml" + - command: attach.results + params: + file_location: "${DRIVERS_TOOLS}/results.json" + + "bootstrap mongo-orchestration": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + SKIP_CRYPT_SHARED=${SKIP_CRYPT_SHARED} SKIP_LEGACY_SHELL=true MONGODB_VERSION=${MONGODB_VERSION} ORCHESTRATION_FILE=${ORCHESTRATION_FILE} TOPOLOGY=${TOPOLOGY} AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} LOAD_BALANCER=${LOAD_BALANCER} REQUIRE_API_VERSION=${REQUIRE_API_VERSION} sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh + # run-orchestration generates expansion file with MONGODB_URI and CRYPT_SHARED_LIB_PATH + - command: expansions.update + params: + file: mo-expansion.yml + + "stop mongo-orchestration": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + sh ${DRIVERS_TOOLS}/.evergreen/stop-orchestration.sh + + "bootstrap mongohoused": + - command: shell.exec + params: + script: | + VARIANT=${VARIANT} DRIVERS_TOOLS="${DRIVERS_TOOLS}" sh ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/build-mongohouse-local.sh + - command: shell.exec + params: + background: true + script: | + DRIVERS_TOOLS="${DRIVERS_TOOLS}" sh ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/run-mongohouse-local.sh + + "create serverless instance": + - command: shell.exec + params: + working_dir: "src" + script: | + ${PREPARE_SHELL} + SERVERLESS_DRIVERS_GROUP=${SERVERLESS_DRIVERS_GROUP} \ + SERVERLESS_API_PUBLIC_KEY=${SERVERLESS_API_PUBLIC_KEY} \ + SERVERLESS_API_PRIVATE_KEY=${SERVERLESS_API_PRIVATE_KEY} \ + bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh + - command: expansions.update + params: + file: src/serverless-expansion.yml + - command: shell.exec + params: + shell: bash + script: | + ${PREPARE_SHELL} + + if [ -z "${SERVERLESS_MONGODB_VERSION}" ]; then + echo "expected SERVERLESS_MONGODB_VERSION to be set" + exit 1 + fi + + . ${DRIVERS_TOOLS}/.evergreen/find-python3.sh + PYTHON_BINARY="$(find_python3)" || exit 1 + + # Download the enterprise server download for current platform to $MONGODB_BINARIES. + # This is required for tests that need mongocryptd. + # $MONGODB_BINARIES is added to the $PATH in fetch-source. + ${PYTHON_BINARY} ${DRIVERS_TOOLS}/.evergreen/mongodl.py \ + --component archive \ + --version ${SERVERLESS_MONGODB_VERSION} \ + --edition enterprise \ + --out $MONGODB_BINARIES \ + --strip-path-components 2 + + # Download the crypt_shared dynamic library for the current platform. + ${PYTHON_BINARY} ${DRIVERS_TOOLS}/.evergreen/mongodl.py \ + --component crypt_shared \ + --version ${SERVERLESS_MONGODB_VERSION} \ + --edition enterprise \ + --out . \ + --only "**/mongo_crypt_v1.*" \ + --strip-path-components 1 + + # Find the crypt_shared library file in the current directory and set the CRYPT_SHARED_LIB_PATH to + # the path of that file. Only look for .so, .dll, or .dylib files to prevent matching any other + # downloaded files. + CRYPT_SHARED_LIB_PATH="$(find $(pwd) -maxdepth 1 -type f \ + -name 'mongo_crypt_v1.so' -o \ + -name 'mongo_crypt_v1.dll' -o \ + -name 'mongo_crypt_v1.dylib')" + + echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH" >> crypt-expansion.yml + + # Load the expansion file to make an evergreen variable with the current unique version + - command: expansions.update + params: + file: crypt-expansion.yml + + "delete serverless instance": + - command: shell.exec + params: + script: | + # Only run if a serverless instance was started + if [ -n "${SERVERLESS_INSTANCE_NAME}" ]; then + SERVERLESS_INSTANCE_NAME=${SERVERLESS_INSTANCE_NAME} \ + SERVERLESS_DRIVERS_GROUP=${SERVERLESS_DRIVERS_GROUP} \ + SERVERLESS_API_PUBLIC_KEY=${SERVERLESS_API_PUBLIC_KEY} \ + SERVERLESS_API_PRIVATE_KEY=${SERVERLESS_API_PRIVATE_KEY} \ + bash ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh + fi + + "run 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 PATH="${PHP_PATH}/bin:$PATH" + + API_VERSION=${API_VERSION} \ + CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \ + MONGODB_URI="${MONGODB_URI}" \ + MONGODB_SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI}" \ + MONGODB_MULTI_MONGOS_LB_URI="${MULTI_MONGOS_LB_URI}" \ + PHP_VERSION=${PHP_VERSION} \ + SSL=${SSL} \ + TESTS=${TESTS} \ + sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh + + "run atlas data lake test": + - command: shell.exec + type: test + params: + working_dir: "src" + script: | + ${PREPARE_SHELL} + export PATH="${PHP_PATH}/bin:$PATH" + + MONGODB_URI="mongodb://mhuser:pencil@127.0.0.1:27017" \ + TESTS="atlas-data-lake" \ + sh ${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 MONGODB_USERNAME=${SERVERLESS_ATLAS_USER} + export MONGODB_PASSWORD=${SERVERLESS_ATLAS_PASSWORD} + export PATH="${PHP_PATH}/bin:$PATH" + + CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \ + MONGODB_URI="${SERVERLESS_URI}" \ + TESTS="serverless" \ + sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh + + "cleanup": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + rm -rf $DRIVERS_TOOLS || true + + "fix absolute paths": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + for filename in $(find ${DRIVERS_TOOLS} -name \*.json); do + perl -p -i -e "s|ABSOLUTE_PATH_REPLACEMENT_TOKEN|${DRIVERS_TOOLS}|g" $filename + done + + "windows fix": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do + cat $i | tr -d '\r' > $i.new + mv $i.new $i + done + # Copy client certificate because symlinks do not work on Windows. + cp ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem + + "make files executable": + - command: shell.exec + params: + script: | + ${PREPARE_SHELL} + for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do + chmod +x $i + done + + "install dependencies": + - command: shell.exec + params: + working_dir: "src" + script: | + ${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} EXTENSION_VERSION=${EXTENSION_VERSION} EXTENSION_REPO=${EXTENSION_REPO} EXTENSION_BRANCH=${EXTENSION_BRANCH} DEPENDENCIES=${DEPENDENCIES} sh $file || echo "$file not available, skipping" + + "start load balancer": + - command: shell.exec + params: + script: | + MONGODB_URI="${MONGODB_URI}" ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh start + - command: expansions.update + params: + file: lb-expansion.yml + + "stop load balancer": + - command: shell.exec + params: + script: | + # Only run if a load balancer was started + if [ -n "${SINGLE_MONGOS_LB_URI}" ]; then + ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh stop + fi + + "start kms servers": + - command: shell.exec + # Init venv without background:true to install dependencies + params: + shell: bash + script: |- + set -o errexit + cd ${DRIVERS_TOOLS}/.evergreen/csfle + . ./activate-kmstlsvenv.sh + - command: shell.exec + params: + background: true + shell: bash + # Use different ports for KMS HTTP servers to avoid conflicts with load balancers + script: |- + set -o errexit + cd ${DRIVERS_TOOLS}/.evergreen/csfle + . ./activate-kmstlsvenv.sh + python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8100 & + python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8101 & + python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8102 --require_client_cert & + python -u kms_kmip_server.py --port 5698 & + - command: expansions.update + params: + updates: + - key: client_side_encryption_kms_tls_ca_file + value: ${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem + - key: client_side_encryption_kms_tls_certificate_key_file + value: ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem + - key: client_side_encryption_kms_endpoint_expired + value: 127.0.0.1:8100 + - key: client_side_encryption_kms_endpoint_wrong_host + value: 127.0.0.1:8101 + - key: client_side_encryption_kms_endpoint_require_client_cert + value: 127.0.0.1:8102 + - key: client_side_encryption_kmip_endpoint + value: localhost:5698 + + "set aws temp creds": + - command: shell.exec + params: + shell: bash + script: |- + set -o errexit + + 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_DEFAULT_REGION="us-east-1" + + pushd ${DRIVERS_TOOLS}/.evergreen/csfle + . ./activate-kmstlsvenv.sh + . ./set-temp-creds.sh + popd + + if [ -z "$CSFLE_AWS_TEMP_ACCESS_KEY_ID" ]; then + echo "Failed to set AWS temporary credentials!" + exit 1 + fi + + cat < aws-expansion.yml + client_side_encryption_aws_temp_access_key_id: "$CSFLE_AWS_TEMP_ACCESS_KEY_ID" + client_side_encryption_aws_temp_secret_access_key_key: "$CSFLE_AWS_TEMP_SECRET_ACCESS_KEY" + client_side_encryption_aws_temp_session_token: "$CSFLE_AWS_TEMP_SESSION_TOKEN" + EOT + - command: expansions.update + params: + file: aws-expansion.yml + + "locate PHP binaries": + - command: shell.exec + params: + shell: bash + add_expansions_to_env: true + script: | + if [ ! -d "/opt/php" ]; then + echo "PHP is not available" + exit 1 + fi + + if [ -d "/opt/php/${PHP_VERSION}-64bit/bin" ]; then + export PHP_PATH="/opt/php/${PHP_VERSION}-64bit" + else + # Try to find the newest version matching our constant + export PHP_PATH=`find /opt/php/ -maxdepth 1 -type d -name "${PHP_VERSION}*-64bit" -print | sort -V -r | head -n 1` + fi + + if [ ! -d "$PHP_PATH" ]; then + echo "Could not find PHP binaries for version ${PHP_VERSION}. Listing available versions..." + ls -1 /opt/php + exit 1 + fi + + echo "Found PHP: $PHP_PATH" + echo 'PHP_PATH: "'$PHP_PATH'"' > php-expansion.yml + - command: expansions.update + params: + file: php-expansion.yml + + "compile extension": + - command: subprocess.exec + type: test + params: + working_dir: src + add_expansions_to_env: true + binary: bash + args: + - .evergreen/compile-extension.sh diff --git a/.evergreen/config/generate-config.php b/.evergreen/config/generate-config.php new file mode 100644 index 000000000..f56c10dc4 --- /dev/null +++ b/.evergreen/config/generate-config.php @@ -0,0 +1,81 @@ +#!/bin/env php + in_array($version, ['latest', 'rapid']) || version_compare($version, '5.0', '>='), +); +$ocspServerVersions = array_filter( + $supportedMongoDBVersions, + // OCSP supports MongoDB 4.4+ + fn (string $version): bool => in_array($version, ['latest', 'rapid']) || version_compare($version, '4.4', '>='), +); +$requireApiServerVersions = array_filter( + $supportedMongoDBVersions, + // requireApiVersion supports MongoDB 5.0+ + fn (string $version): bool => in_array($version, ['latest', 'rapid']) || version_compare($version, '5.0', '>='), +); +$skipCryptSharedServerVersions = array_filter( + $supportedMongoDBVersions, + // crypt_shared is available starting with MongoDB 6.0 + fn (string $version): bool => in_array($version, ['latest', 'rapid']) || version_compare($version, '6.0', '>='), +); + +$allFiles = []; + +// Build tasks +$allFiles[] = generateConfigs('build', 'phpVersion', '_template-build-extension.yml', 'build-php-%s', $supportedPhpVersions); + +// Test tasks +//$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-local.yml', 'local-%s', $localServerVersions); +//$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-load-balanced.yml', 'load-balanced-%s', $loadBalancedServerVersions); +//$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-ocsp.yml', 'ocsp-%s', $ocspServerVersions); +//$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-require-api-version.yml', 'require-api-version-%s', $requireApiServerVersions); +//$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-skip-crypt-shared.yml', 'skip-crypt-shared-%s', $skipCryptSharedServerVersions); + +echo "Generated config. Use the following list to import files:\n"; +echo implode("\n", array_map('getImportConfig', array_merge(...$allFiles))) . "\n"; + +function getImportConfig(string $filename): string +{ + return '- filename: ' . $filename; +} + +function generateConfigs( + string $directory, + string $replacementName, + string $templateFile, + string $outputFormat, + array $versions, +): array { + $template = file_get_contents(__DIR__ . '/' . $directory . '/' . $templateFile); + $header = '# This file is generated automatically - please edit the corresponding template file!'; + + $files = []; + + foreach ($versions as $version) { + $filename = sprintf('/%s/' . $outputFormat . '.yml', $directory, $version); + $files[] = '.evergreen/config' . $filename; + + $replacements = ['%' . $replacementName . '%' => $version]; + + file_put_contents(__DIR__ . $filename, $header . "\n" . strtr($template, $replacements)); + } + + return $files; +} + diff --git a/.evergreen/config/legacy-tasks.yml b/.evergreen/config/legacy-tasks.yml new file mode 100644 index 000000000..2d369b84c --- /dev/null +++ b/.evergreen/config/legacy-tasks.yml @@ -0,0 +1,130 @@ +tasks: + - name: "test-standalone" + tags: ["standalone"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-replica_set" + tags: ["replica_set"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-sharded_cluster" + tags: ["sharded_cluster"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-atlas-data-lake" + commands: + - func: "bootstrap mongohoused" + - func: "run atlas data lake test" + + - name: "test-requireApiVersion" + tags: ["versioned-api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + AUTH: "auth" + REQUIRE_API_VERSION: "yes" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + API_VERSION: "1" + + - name: "test-acceptApiVersion2" + tags: ["versioned-api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + ORCHESTRATION_FILE: "versioned-api-testing.json" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "versioned-api" + + - name: "test-serverless" + tags: ["serverless"] + commands: + - func: "create serverless instance" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run serverless tests" + + - name: "test-loadBalanced" + tags: ["loadbalanced"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + LOAD_BALANCER: "true" + SSL: "yes" + - func: "start load balancer" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + # Note: loadBalanced=true should already be appended to SINGLE_MONGOS_LB_URI + MONGODB_URI: "${SINGLE_MONGOS_LB_URI}" + SSL: "yes" + # Note: "stop load balancer" will be called from "post" + + - name: "test-csfle-crypt_shared" + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-csfle-mongocryptd" + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + SKIP_CRYPT_SHARED: "yes" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-without_aws_creds" + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + - func: "start kms servers" + - func: "run tests" + vars: + client_side_encryption_aws_access_key_id: "" + client_side_encryption_aws_secret_access_key: "" + TESTS: "csfle-without-aws-creds" + + - name: "test-atlas" + commands: + - func: "start kms servers" + - func: "run tests" + vars: + TESTS: "atlas" diff --git a/.evergreen/config/legacy-variants.yml b/.evergreen/config/legacy-variants.yml new file mode 100644 index 000000000..88b3a62bc --- /dev/null +++ b/.evergreen/config/legacy-variants.yml @@ -0,0 +1,354 @@ +axes: + # Note: install-dependencies.sh will search for the latest minor version + # matching the PHP_VERSION constant + - id: php-versions + display_name: PHP Version + values: + - id: "8.2" + display_name: "PHP 8.2" + variables: + PHP_VERSION: "8.2" + - id: "8.1" + display_name: "PHP 8.1" + variables: + PHP_VERSION: "8.1" + - id: "8.0" + display_name: "PHP 8.0" + variables: + PHP_VERSION: "8.0" + - id: "7.4" + display_name: "PHP 7.4" + variables: + PHP_VERSION: "7.4" + + - id: php-edge-versions + display_name: PHP Version + values: + - id: "latest-stable" + display_name: "PHP 8.2" + variables: + PHP_VERSION: "8.2" + - id: "oldest-supported" + display_name: "PHP 7.4" + variables: + PHP_VERSION: "7.4" + + - id: mongodb-versions + display_name: MongoDB Version + values: + - id: "latest" + display_name: "MongoDB latest" + variables: + MONGODB_VERSION: "latest" + - id: "rapid" + display_name: "MongoDB rapid" + variables: + MONGODB_VERSION: "rapid" + - id: "7.0" + display_name: "MongoDB 7.0" + variables: + MONGODB_VERSION: "7.0" + - id: "6.0" + display_name: "MongoDB 6.0" + variables: + MONGODB_VERSION: "6.0" + - id: "5.0" + display_name: "MongoDB 5.0" + variables: + MONGODB_VERSION: "5.0" + - id: "4.4" + display_name: "MongoDB 4.4" + variables: + MONGODB_VERSION: "4.4" + - id: "4.2" + display_name: "MongoDB 4.2" + variables: + MONGODB_VERSION: "4.2" + - id: "4.0" + display_name: "MongoDB 4.0" + variables: + MONGODB_VERSION: "4.0" + - id: "3.6" + display_name: "MongoDB 3.6" + variables: + MONGODB_VERSION: "3.6" + + - id: mongodb-edge-versions + display_name: MongoDB Version + values: + - id: "latest-stable" + display_name: "MongoDB 6.0" + variables: + MONGODB_VERSION: "6.0" + - id: "oldest-supported" + display_name: "MongoDB 3.6" + variables: + MONGODB_VERSION: "3.6" + + - id: driver-versions + display_name: Driver Version + values: + - id: "oldest-supported" + display_name: "PHPC 1.17.0" + variables: + EXTENSION_BRANCH: "master" + - id: "latest-stable" + display_name: "PHPC (1.17.x)" + variables: + EXTENSION_BRANCH: "master" + - id: "latest-dev" + display_name: "PHPC (1.17-dev)" + variables: + EXTENSION_BRANCH: "master" + + - id: os + display_name: OS + values: + # Debian + - id: debian11 + display_name: "Debian 11" + run_on: debian11-small + - id: debian10 + display_name: "Debian 10" + run_on: debian10-small + - id: debian92 + display_name: "Debian 9.2" + run_on: debian92-small + + # RHEL + - id: rhel90 + display_name: "RHEL 9.0" + run_on: rhel90-small + - id: rhel80 + display_name: "RHEL 8.0" + run_on: rhel80-small + + # Ubuntu LTS + - id: ubuntu2204 + display_name: "Ubuntu 22.04 x64" + run_on: ubuntu2204-small + - id: ubuntu2204-arm64 + display_name: "Ubuntu 22.04 ARM64" + run_on: ubuntu2204-arm64-small + - id: ubuntu2004 + display_name: "Ubuntu 20.04 x64" + run_on: ubuntu2004-small + - id: ubuntu2004-arm64 + display_name: "Ubuntu 20.04 ARM64" + run_on: ubuntu2204-arm64-small + + - id: topology + display_name: Topology + values: + - id: standalone + display_name: Standalone + variables: + TOPOLOGY: "server" + - id: replicaset + display_name: Replica Set + variables: + TOPOLOGY: "replica_set" + - id: sharded-cluster + display_name: Sharded Cluster + variables: + TOPOLOGY: "sharded_cluster" + + - id: auth + display_name: Authentication + values: + - id: auth + display_name: Auth + variables: + AUTH: "auth" + - id: noauth + display_name: NoAuth + variables: + AUTH: "noauth" + + - id: ssl + display_name: SSL + values: + - id: ssl + display_name: SSL + variables: + SSL: "ssl" + - id: nossl + display_name: NoSSL + variables: + SSL: "nossl" + + - id: storage-engine + display_name: Storage + values: + - id: mmapv1 + display_name: MMAPv1 + variables: + STORAGE_ENGINE: "mmapv1" + - id: wiredtiger + display_name: WiredTiger + variables: + STORAGE_ENGINE: "wiredtiger" + - id: inmemory + display_name: InMemory + variables: + STORAGE_ENGINE: "inmemory" + + - id: dependencies + display_name: Dependencies + values: + - id: lowest + display_name: Lowest + variables: + DEPENDENCIES: "lowest" + +task_groups: + - name: test_atlas_task_group + setup_group: + - func: "fetch source" + - func: "prepare resources" + - func: "fix absolute paths" + - func: "make files executable" + - func: "install dependencies" + - command: subprocess.exec + params: + working_dir: src + binary: bash + add_expansions_to_env: true + env: + MONGODB_VERSION: '7.0' + args: + - ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh + - command: expansions.update + params: + file: src/atlas-expansion.yml + teardown_group: + - command: subprocess.exec + params: + working_dir: src + binary: bash + add_expansions_to_env: true + args: + - ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh + - func: "upload test results" + - func: "cleanup" + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + tasks: + - test-atlas + +buildvariants: + # Test all PHP versions with latest-stable MongoDB and PHPC on all platforms + - matrix_name: "test-php-versions" + matrix_spec: + os: + - debian11 + - debian10 + - rhel90 + - ubuntu2204 + - ubuntu2204-arm64 + - ubuntu2004 + mongodb-edge-versions: "latest-stable" + php-versions: "*" + driver-versions: "latest-stable" + display_name: "${os}, ${mongodb-edge-versions}, ${php-versions}, ${driver-versions}" + exclude_spec: + # Exclude "latest-stable" PHP version for Debian 11 (see: test-mongodb-versions matrix) + - { "os": "debian11", "mongodb-edge-versions": "latest-stable", "php-versions": "8.2", "driver-versions": "latest-stable" } + # Exclude PHP versions older than 8.1 on RHEL 9 and Ubuntu 22.04 (OpenSSL 3 is only supported on PHP 8.1+) + - { "os": ["rhel90", "ubuntu2204-arm64", "ubuntu2204"], "php-versions": ["7.4", "8.0"], "mongodb-edge-versions": "*", "driver-versions": "*" } + tasks: + - name: "test-standalone" + - name: "test-replica_set" + - name: "test-sharded_cluster" + + # Test all topologies and MongoDB versions with latest-stable PHP and PHPC on Debian + - matrix_name: "test-mongodb-versions" + matrix_spec: { "os": ["debian92", "debian11"], "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + display_name: "${os}, ${mongodb-versions}, ${php-edge-versions}, ${driver-versions}" + exclude_spec: + # Debian 9.2 only supports up to MongoDB 5.0 + - { "os": "debian92", "mongodb-versions": ["6.0", "7.0", "rapid", "latest"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4", "5.0"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + tasks: + - name: "test-standalone" + - name: "test-replica_set" + - name: "test-sharded_cluster" + + # Test oldest-supported PHP, MongoDB, and driver versions with lowest dependencies on Debian + - matrix_name: "test-oldest-supported" + matrix_spec: { "os": "debian92", "mongodb-edge-versions": "oldest-supported", "php-edge-versions": "oldest-supported", "driver-versions": "oldest-supported", "dependencies": "lowest" } + display_name: "Lowest Dependencies: ${os}, ${mongodb-edge-versions}, ${php-edge-versions}, ${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", "driver-versions": "latest-stable" } + display_name: "Atlas Data Lake" + run_on: debian11 + expansions: + VARIANT: debian11 # Referenced by ADL build script for downloading MQLRun + tasks: + - name: "test-atlas-data-lake" + + - matrix_name: "test-requireApiVersion" + matrix_spec: { "os": "debian11", "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + display_name: "Versioned API - ${mongodb-versions}" + exclude_spec: + # Stable API is available from MongoDB 5.0+ + - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + tasks: + - .versioned-api + + - matrix_name: "serverless" + matrix_spec: { "os": "debian11", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + display_name: "Serverless" + tasks: + - .serverless + + - matrix_name: "test-loadBalanced" + matrix_spec: { "os": "debian11", "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + display_name: "Load balanced - ${mongodb-versions}" + exclude_spec: + # Load balancer is available from MongoDB 5.0+ + - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + tasks: + - name: "test-loadBalanced" + + # CSFLE tests (crypt_shared and mongocryptd) are tested on RHEL 8 as it's the only version that supports + # 4.2 AND 6.0 (which is required for crypt_shared), as well as a somewhat relevant PHP version. + # Newer MongoDB version may require adding different operating systems here + - matrix_name: "test-csfle-crypt_shared" + matrix_spec: { "os": "rhel80", "mongodb-versions": "*", "php-versions": "8.0", "driver-versions": "latest-stable" } + display_name: "CSFLE crypt_shared - ${mongodb-versions}" + exclude_spec: + # MongoDB < 4.2 does not need to be tested. + - { "os": "rhel80", "mongodb-versions": ["3.6", "4.0"], "php-versions": "8.0", "driver-versions": "latest-stable" } + tasks: + - name: "test-csfle-crypt_shared" + - matrix_name: "test-csfle-mongocryptd" + matrix_spec: { "os": "rhel80", "mongodb-versions": "*", "php-versions": "8.0", "driver-versions": "latest-stable" } + display_name: "CSFLE mongocryptd - ${mongodb-versions}" + exclude_spec: + # MongoDB < 4.2 does not need to be tested. + - { "os": "rhel80", "mongodb-versions": ["3.6", "4.0"], "php-versions": "8.0", "driver-versions": "latest-stable" } + tasks: + - name: "test-csfle-mongocryptd" + + # Run CSFLE tests without AWS credentials (for "On-demand AWS Credentials" prose test) + - matrix_name: "test-csfle-without_aws_creds" + matrix_spec: { "os": ["debian92", "debian11"], "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + display_name: "CSFLE without_aws_creds - ${mongodb-versions}" + exclude_spec: + # CSFLE is available from MongoDB 4.2+ and Debian 9.2 only supports up to MongoDB 5.0 + - { "os": "debian92", "mongodb-versions": ["3.6", "4.0", "6.0", "rapid", "latest"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4", "5.0"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + tasks: + - name: "test-without_aws_creds" + + - matrix_name: rhel8-test-atlas + matrix_spec: { "os": ["rhel80"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } + display_name: Atlas Tests + tasks: + - test_atlas_task_group diff --git a/.evergreen/config/test/_template-local.yml b/.evergreen/config/test/_template-local.yml new file mode 100644 index 000000000..462c7d4f6 --- /dev/null +++ b/.evergreen/config/test/_template-local.yml @@ -0,0 +1,33 @@ +tasks: + - name: "test-mongodb-%mongodbVersion%-standalone-noauth-nossl" + tags: ["standalone", "local", "%mongodbVersion%"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + MONGODB_VERSION: "%mongodbVersion%" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-%mongodbVersion%-replicaset-noauth-nossl" + tags: ["replicaset", "local", "%mongodbVersion%"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "%mongodbVersion%" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-%mongodbVersion%-sharded-noauth-nossl" + tags: ["sharded", "local", "%mongodbVersion%"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "%mongodbVersion%" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index 587558c7c..860df9d31 100644 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -1,84 +1,6 @@ #!/bin/sh set -o errexit # Exit the script with error if any of the commands fail -set_php_version () -{ - PHP_VERSION=$1 - - if [ ! -d "/opt/php" ]; then - echo "PHP is not available" - exit 1 - fi - - if [ -d "/opt/php/${PHP_VERSION}-64bit/bin" ]; then - export PHP_PATH="/opt/php/${PHP_VERSION}-64bit" - else - # Try to find the newest version matching our constant - export PHP_PATH=`find /opt/php/ -maxdepth 1 -type d -name "${PHP_VERSION}.*-64bit" -print | sort -V -r | head -1` - fi - - if [ ! -d "$PHP_PATH" ]; then - echo "Could not find PHP binaries for version ${PHP_VERSION}. Listing available versions..." - ls -1 /opt/php - exit 1 - fi - - echo 'PHP_PATH: "'$PHP_PATH'"' > php-expansion.yml - export PATH=$PHP_PATH/bin:$PATH -} - -install_extension () -{ - rm -f ${PHP_PATH}/lib/php.ini - - if [ "x${EXTENSION_BRANCH}" != "x" ] || [ "x${EXTENSION_REPO}" != "x" ]; then - CLONE_REPO=${EXTENSION_REPO:-https://github.com/mongodb/mongo-php-driver} - CHECKOUT_BRANCH=${EXTENSION_BRANCH:-master} - - echo "Compiling driver branch ${CHECKOUT_BRANCH} from repository ${CLONE_REPO}" - - mkdir -p /tmp/compile - rm -rf /tmp/compile/mongo-php-driver - git clone ${CLONE_REPO} /tmp/compile/mongo-php-driver - cd /tmp/compile/mongo-php-driver - - git checkout ${CHECKOUT_BRANCH} - git submodule update --init - phpize - ./configure --enable-mongodb-developer-flags - make all -j20 > /dev/null - make install - - cd ${PROJECT_DIRECTORY} - elif [ "x${EXTENSION_VERSION}" != "x" ]; then - echo "Installing driver version ${EXTENSION_VERSION} from PECL" - pecl install -f mongodb-${EXTENSION_VERSION} - else - echo "Installing latest driver version from PECL" - pecl install -f mongodb - fi - - sudo cp ${PROJECT_DIRECTORY}/.evergreen/config/php.ini ${PHP_PATH}/lib/php.ini - - php --ri mongodb -} - -install_composer () -{ - EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" - - if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then - >&2 echo 'ERROR: Invalid installer checksum' - rm composer-setup.php - exit 1 - fi - - php composer-setup.php --quiet - rm composer-setup.php -} - # Functions to fetch MongoDB binaries . ${DRIVERS_TOOLS}/.evergreen/download-mongodb.sh OS=$(uname -s | tr '[:upper:]' '[:lower:]') @@ -112,18 +34,3 @@ case "$DISTRO" in echo "All other platforms..." ;; esac - -case "$DEPENDENCIES" in - lowest*) - COMPOSER_FLAGS="${COMPOSER_FLAGS} --prefer-lowest" - ;; - - *) - ;; -esac - -set_php_version $PHP_VERSION -install_extension -install_composer - -php composer.phar update $COMPOSER_FLAGS From 9766ae4cae661949a4b5a536bfc58c6bce851169 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 27 Sep 2023 10:09:32 +0200 Subject: [PATCH 02/28] Upload built extension --- .../build/_template-build-extension.yml | 3 +- .evergreen/config/build/build-php-7.4.yml | 3 +- .evergreen/config/build/build-php-8.0.yml | 3 +- .evergreen/config/build/build-php-8.1.yml | 3 +- .evergreen/config/build/build-php-8.2.yml | 1 + .evergreen/config/functions.yml | 56 +++++++++++++++++++ 6 files changed, 61 insertions(+), 8 deletions(-) diff --git a/.evergreen/config/build/_template-build-extension.yml b/.evergreen/config/build/_template-build-extension.yml index 054e1d7b8..a9618c91f 100644 --- a/.evergreen/config/build/_template-build-extension.yml +++ b/.evergreen/config/build/_template-build-extension.yml @@ -6,5 +6,4 @@ tasks: vars: PHP_VERSION: "%phpVersion%" - func: "compile extension" - vars: - PHP_VERSION: "%phpVersion%" + - func: "upload extension" diff --git a/.evergreen/config/build/build-php-7.4.yml b/.evergreen/config/build/build-php-7.4.yml index 9e22b8955..1b0b920d7 100644 --- a/.evergreen/config/build/build-php-7.4.yml +++ b/.evergreen/config/build/build-php-7.4.yml @@ -7,5 +7,4 @@ tasks: vars: PHP_VERSION: "7.4" - func: "compile extension" - vars: - PHP_VERSION: "7.4" + - func: "upload extension" diff --git a/.evergreen/config/build/build-php-8.0.yml b/.evergreen/config/build/build-php-8.0.yml index 67677eb71..ea3431e82 100644 --- a/.evergreen/config/build/build-php-8.0.yml +++ b/.evergreen/config/build/build-php-8.0.yml @@ -7,5 +7,4 @@ tasks: vars: PHP_VERSION: "8.0" - func: "compile extension" - vars: - PHP_VERSION: "8.0" + - func: "upload extension" diff --git a/.evergreen/config/build/build-php-8.1.yml b/.evergreen/config/build/build-php-8.1.yml index 69e4f21f0..385665b7e 100644 --- a/.evergreen/config/build/build-php-8.1.yml +++ b/.evergreen/config/build/build-php-8.1.yml @@ -7,5 +7,4 @@ tasks: vars: PHP_VERSION: "8.1" - func: "compile extension" - vars: - PHP_VERSION: "8.1" + - func: "upload extension" diff --git a/.evergreen/config/build/build-php-8.2.yml b/.evergreen/config/build/build-php-8.2.yml index 8c2afc880..00fccbe6f 100644 --- a/.evergreen/config/build/build-php-8.2.yml +++ b/.evergreen/config/build/build-php-8.2.yml @@ -7,3 +7,4 @@ tasks: vars: PHP_VERSION: "8.2" - func: "compile extension" + - func: "upload extension" diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 6555703e6..22ea8bffa 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -56,6 +56,62 @@ functions: params: file: src/expansion.yml + # Upload build artifacts that other tasks may depend on + # Note this URL needs to be totally unique, while predictable for the next task + # so it can automatically download the artifacts + "upload extension": + # Copy compiled extension to source directory for archiving + - command: subprocess.exec + type: setup + params: + working_dir: "src" + binary: bash + args: + - -c + - cp `${PHP_PATH}/bin/php -r "echo ini_get('extension_dir');"`/mongodb.so . + # Compress and upload the entire build directory + - command: archive.targz_pack + params: + target: "${build_id}.tar.gz" + source_dir: src + include: + - "mongodb.so" + - command: s3.put + params: + aws_key: ${aws_key} + aws_secret: ${aws_secret} + bucket: mciuploads + content_type: ${content_type|application/x-gzip} + permissions: public-read + local_file: ${build_id}.tar.gz + remote_file: mongo-php-driver/${build_variant}/${revision}/${task_name}/${version}.tar.gz + # TODO: Use separate folder for the library once it exists +# remote_file: ${project}/${build_variant}/${revision}/${task_name}/${version}.tar.gz + + "fetch extension": + - command: s3.get + params: + aws_key: ${aws_key} + aws_secret: ${aws_secret} + bucket: mciuploads + # TODO: Use separate folder for the library once it exists + remote_file: mongo-php-driver/${FETCH_BUILD_VARIANT}/${revision}/${FETCH_BUILD_TASK}/${version}.tar.gz +# remote_file: ${project}/${FETCH_BUILD_VARIANT}/${revision}/${FETCH_BUILD_TASK}/${version}.tar.gz + local_file: build.tar.gz + - command: archive.targz_extract + params: + destination: src + path: build.tar.gz + # Move compiled extension to correct ini path + - command: subprocess.exec + type: setup + params: + working_dir: "src" + binary: bash + args: + - -c + - mv mongodb.so `${PHP_PATH}/bin/php -r "echo ini_get('extension_dir');"` + "prepare resources": - command: shell.exec params: From c1658f27cc2eb8f6a34068d8827c517570174904 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 27 Sep 2023 11:08:14 +0200 Subject: [PATCH 03/28] Add test variant --- .evergreen/compile-extension.sh | 29 ------------------- .evergreen/config.yml | 18 ++++++++++-- .evergreen/config/functions.yml | 11 ++++++++ .evergreen/config/generate-config.php | 2 +- .evergreen/config/test-variants.yml | 34 +++++++++++++++++++++++ .evergreen/config/test/local-3.6.yml | 34 +++++++++++++++++++++++ .evergreen/config/test/local-4.0.yml | 34 +++++++++++++++++++++++ .evergreen/config/test/local-4.2.yml | 34 +++++++++++++++++++++++ .evergreen/config/test/local-4.4.yml | 34 +++++++++++++++++++++++ .evergreen/config/test/local-5.0.yml | 34 +++++++++++++++++++++++ .evergreen/config/test/local-6.0.yml | 34 +++++++++++++++++++++++ .evergreen/config/test/local-7.0.yml | 34 +++++++++++++++++++++++ .evergreen/config/test/local-latest.yml | 34 +++++++++++++++++++++++ .evergreen/config/test/local-rapid.yml | 34 +++++++++++++++++++++++ .evergreen/install-composer.sh | 37 +++++++++++++++++++++++++ 15 files changed, 405 insertions(+), 32 deletions(-) create mode 100644 .evergreen/config/test-variants.yml create mode 100644 .evergreen/config/test/local-3.6.yml create mode 100644 .evergreen/config/test/local-4.0.yml create mode 100644 .evergreen/config/test/local-4.2.yml create mode 100644 .evergreen/config/test/local-4.4.yml create mode 100644 .evergreen/config/test/local-5.0.yml create mode 100644 .evergreen/config/test/local-6.0.yml create mode 100644 .evergreen/config/test/local-7.0.yml create mode 100644 .evergreen/config/test/local-latest.yml create mode 100644 .evergreen/config/test/local-rapid.yml create mode 100644 .evergreen/install-composer.sh diff --git a/.evergreen/compile-extension.sh b/.evergreen/compile-extension.sh index 4eca2c291..3f1c68aaf 100644 --- a/.evergreen/compile-extension.sh +++ b/.evergreen/compile-extension.sh @@ -39,33 +39,4 @@ install_extension () php --ri mongodb } -install_composer () -{ - EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" - - if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then - >&2 echo 'ERROR: Invalid installer checksum' - rm composer-setup.php - exit 1 - fi - - php composer-setup.php --quiet - rm composer-setup.php -} - -case "$DEPENDENCIES" in - lowest*) - COMPOSER_FLAGS="${COMPOSER_FLAGS} --prefer-lowest" - ;; - - *) - ;; -esac - install_extension - -# install_composer - -# php composer.phar update $COMPOSER_FLAGS diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 8d7713824..73c82142f 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -6,6 +6,9 @@ stepback: true # Actual testing tasks are marked with `type: test` command_type: system +# Fail builds when pre tasks fail. +pre_error_fails_task: true + # Protect ourselves against rogue test case that runs forever # Good rule of thumb: the average length a task takes, times 5, which roughly accounts for variable system performance # for various build variants @@ -16,10 +19,12 @@ exec_timeout_secs: 1800 pre: &test_setup - func: "fetch source" - func: "prepare resources" - - func: "windows fix" - func: "fix absolute paths" - func: "make files executable" - func: "install dependencies" + - func: "locate PHP binaries" + - func: "fetch extension" + - func: "install composer" post: &test_teardown - func: "upload mo artifacts" - func: "upload test results" @@ -36,10 +41,19 @@ include: - filename: .evergreen/config/build-variants.yml # - filename: .evergreen/config/test-tasks.yml -# - filename: .evergreen/config/test-variants.yml + - filename: .evergreen/config/test-variants.yml # Automatically generated files - filename: .evergreen/config/build/build-php-8.2.yml - filename: .evergreen/config/build/build-php-8.1.yml - filename: .evergreen/config/build/build-php-8.0.yml - filename: .evergreen/config/build/build-php-7.4.yml + - filename: .evergreen/config/test/local-latest.yml + - filename: .evergreen/config/test/local-rapid.yml + - filename: .evergreen/config/test/local-7.0.yml + - filename: .evergreen/config/test/local-6.0.yml + - filename: .evergreen/config/test/local-5.0.yml + - filename: .evergreen/config/test/local-4.4.yml + - filename: .evergreen/config/test/local-4.2.yml + - filename: .evergreen/config/test/local-4.0.yml + - filename: .evergreen/config/test/local-3.6.yml diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 22ea8bffa..43ede0be3 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -431,6 +431,17 @@ functions: # Don't use ${file} syntax here because evergreen treats it as an empty expansion. [ -f "$file" ] && PHP_VERSION=${PHP_VERSION} EXTENSION_VERSION=${EXTENSION_VERSION} EXTENSION_REPO=${EXTENSION_REPO} EXTENSION_BRANCH=${EXTENSION_BRANCH} DEPENDENCIES=${DEPENDENCIES} sh $file || echo "$file not available, skipping" + "install composer": + - command: shell.exec + params: + add_expansions_to_env: true + working_dir: "src" + script: | + ${PREPARE_SHELL} + file="${PROJECT_DIRECTORY}/.evergreen/install-composer.sh" + # Don't use ${file} syntax here because evergreen treats it as an empty expansion. + [ -f "$file" ] && PHP_VERSION=${PHP_VERSION} EXTENSION_VERSION=${EXTENSION_VERSION} EXTENSION_REPO=${EXTENSION_REPO} EXTENSION_BRANCH=${EXTENSION_BRANCH} DEPENDENCIES=${DEPENDENCIES} sh $file || echo "$file not available, skipping" + "start load balancer": - command: shell.exec params: diff --git a/.evergreen/config/generate-config.php b/.evergreen/config/generate-config.php index f56c10dc4..10102d079 100644 --- a/.evergreen/config/generate-config.php +++ b/.evergreen/config/generate-config.php @@ -41,7 +41,7 @@ $allFiles[] = generateConfigs('build', 'phpVersion', '_template-build-extension.yml', 'build-php-%s', $supportedPhpVersions); // Test tasks -//$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-local.yml', 'local-%s', $localServerVersions); +$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-local.yml', 'local-%s', $localServerVersions); //$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-load-balanced.yml', 'load-balanced-%s', $loadBalancedServerVersions); //$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-ocsp.yml', 'ocsp-%s', $ocspServerVersions); //$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-require-api-version.yml', 'require-api-version-%s', $requireApiServerVersions); diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml new file mode 100644 index 000000000..bfe3fafc2 --- /dev/null +++ b/.evergreen/config/test-variants.yml @@ -0,0 +1,34 @@ +# +# Test variants - only run for select platforms worth testing on +# +buildvariants: + # PHP 8.2: test all topologies on all versions of MongoDB + - name: test-debian11-php82-local + tags: ["test", "debian", "x64"] + display_name: "Test: Debian 11, PHP 8.2" + run_on: debian11-small + expansions: + FETCH_BUILD_VARIANT: "build-debian11" + FETCH_BUILD_TASK: "build-php-8.2" + depends_on: + - variant: "build-debian11" + name: "build-php-8.2" + tasks: + - ".standalone .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" + - ".replicaset .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" + - ".sharded .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" +# - name: test-debian92-php82-local +# tags: ["test", "debian", "x64"] +# display_name: "Test: Debian 9.2, PHP 8.2" +# run_on: debian92-small +# expansions: +# FETCH_BUILD_VARIANT: "build-debian92" +# FETCH_BUILD_TASK: "build-php-8.2" +# depends_on: +# - variant: "build-debian92" +# name: "build-php-8.2" +# tasks: +# # Remember to add new major versions here as they are released +# - ".standalone .local !.6.0 !.7.0 !.rapid !.latest" +# - ".replicaset .local !.6.0 !.7.0 !.rapid !.latest" +# - ".sharded .local !.6.0 !.7.0 !.rapid !.latest" diff --git a/.evergreen/config/test/local-3.6.yml b/.evergreen/config/test/local-3.6.yml new file mode 100644 index 000000000..0c3fb9e4d --- /dev/null +++ b/.evergreen/config/test/local-3.6.yml @@ -0,0 +1,34 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-3.6-standalone-noauth-nossl" + tags: ["standalone", "local", "3.6"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + MONGODB_VERSION: "3.6" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-3.6-replicaset-noauth-nossl" + tags: ["replicaset", "local", "3.6"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "3.6" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-3.6-sharded-noauth-nossl" + tags: ["sharded", "local", "3.6"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "3.6" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" diff --git a/.evergreen/config/test/local-4.0.yml b/.evergreen/config/test/local-4.0.yml new file mode 100644 index 000000000..3f817ccd7 --- /dev/null +++ b/.evergreen/config/test/local-4.0.yml @@ -0,0 +1,34 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-4.0-standalone-noauth-nossl" + tags: ["standalone", "local", "4.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + MONGODB_VERSION: "4.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-4.0-replicaset-noauth-nossl" + tags: ["replicaset", "local", "4.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "4.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-4.0-sharded-noauth-nossl" + tags: ["sharded", "local", "4.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "4.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" diff --git a/.evergreen/config/test/local-4.2.yml b/.evergreen/config/test/local-4.2.yml new file mode 100644 index 000000000..0a6390dec --- /dev/null +++ b/.evergreen/config/test/local-4.2.yml @@ -0,0 +1,34 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-4.2-standalone-noauth-nossl" + tags: ["standalone", "local", "4.2"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + MONGODB_VERSION: "4.2" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-4.2-replicaset-noauth-nossl" + tags: ["replicaset", "local", "4.2"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "4.2" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-4.2-sharded-noauth-nossl" + tags: ["sharded", "local", "4.2"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "4.2" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" diff --git a/.evergreen/config/test/local-4.4.yml b/.evergreen/config/test/local-4.4.yml new file mode 100644 index 000000000..f26fd4a2d --- /dev/null +++ b/.evergreen/config/test/local-4.4.yml @@ -0,0 +1,34 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-4.4-standalone-noauth-nossl" + tags: ["standalone", "local", "4.4"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + MONGODB_VERSION: "4.4" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-4.4-replicaset-noauth-nossl" + tags: ["replicaset", "local", "4.4"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "4.4" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-4.4-sharded-noauth-nossl" + tags: ["sharded", "local", "4.4"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "4.4" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" diff --git a/.evergreen/config/test/local-5.0.yml b/.evergreen/config/test/local-5.0.yml new file mode 100644 index 000000000..eeae55c3c --- /dev/null +++ b/.evergreen/config/test/local-5.0.yml @@ -0,0 +1,34 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-5.0-standalone-noauth-nossl" + tags: ["standalone", "local", "5.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + MONGODB_VERSION: "5.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-5.0-replicaset-noauth-nossl" + tags: ["replicaset", "local", "5.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "5.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-5.0-sharded-noauth-nossl" + tags: ["sharded", "local", "5.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "5.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" diff --git a/.evergreen/config/test/local-6.0.yml b/.evergreen/config/test/local-6.0.yml new file mode 100644 index 000000000..f38bcbbf9 --- /dev/null +++ b/.evergreen/config/test/local-6.0.yml @@ -0,0 +1,34 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-6.0-standalone-noauth-nossl" + tags: ["standalone", "local", "6.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + MONGODB_VERSION: "6.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-6.0-replicaset-noauth-nossl" + tags: ["replicaset", "local", "6.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "6.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-6.0-sharded-noauth-nossl" + tags: ["sharded", "local", "6.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "6.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" diff --git a/.evergreen/config/test/local-7.0.yml b/.evergreen/config/test/local-7.0.yml new file mode 100644 index 000000000..c0a0d3da6 --- /dev/null +++ b/.evergreen/config/test/local-7.0.yml @@ -0,0 +1,34 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-7.0-standalone-noauth-nossl" + tags: ["standalone", "local", "7.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + MONGODB_VERSION: "7.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-7.0-replicaset-noauth-nossl" + tags: ["replicaset", "local", "7.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "7.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-7.0-sharded-noauth-nossl" + tags: ["sharded", "local", "7.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "7.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" diff --git a/.evergreen/config/test/local-latest.yml b/.evergreen/config/test/local-latest.yml new file mode 100644 index 000000000..b9187211e --- /dev/null +++ b/.evergreen/config/test/local-latest.yml @@ -0,0 +1,34 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-latest-standalone-noauth-nossl" + tags: ["standalone", "local", "latest"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + MONGODB_VERSION: "latest" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-latest-replicaset-noauth-nossl" + tags: ["replicaset", "local", "latest"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "latest" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-latest-sharded-noauth-nossl" + tags: ["sharded", "local", "latest"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "latest" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" diff --git a/.evergreen/config/test/local-rapid.yml b/.evergreen/config/test/local-rapid.yml new file mode 100644 index 000000000..d12ac8667 --- /dev/null +++ b/.evergreen/config/test/local-rapid.yml @@ -0,0 +1,34 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-rapid-standalone-noauth-nossl" + tags: ["standalone", "local", "rapid"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + MONGODB_VERSION: "rapid" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-rapid-replicaset-noauth-nossl" + tags: ["replicaset", "local", "rapid"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "rapid" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + + - name: "test-mongodb-rapid-sharded-noauth-nossl" + tags: ["sharded", "local", "rapid"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "rapid" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" diff --git a/.evergreen/install-composer.sh b/.evergreen/install-composer.sh new file mode 100644 index 000000000..731a76b65 --- /dev/null +++ b/.evergreen/install-composer.sh @@ -0,0 +1,37 @@ +#!/bin/sh +set -o errexit # Exit the script with error if any of the commands fail + +PATH="$PHP_PATH/bin:$PATH" + +install_composer () +{ + EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" + php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" + ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" + + if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then + >&2 echo 'ERROR: Invalid installer checksum' + rm composer-setup.php + exit 1 + fi + + php composer-setup.php --quiet + rm composer-setup.php +} + +case "$DEPENDENCIES" in + lowest*) + COMPOSER_FLAGS="${COMPOSER_FLAGS} --prefer-lowest" + ;; + + *) + ;; +esac + +sudo cp ${PROJECT_DIRECTORY}/.evergreen/config/php.ini ${PHP_PATH}/lib/php.ini + +php --ri mongodb + +install_composer + +php composer.phar update $COMPOSER_FLAGS From 6921f7dd3aa526be80ebddd63b2a1f4df86618aa Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 27 Sep 2023 13:23:25 +0200 Subject: [PATCH 04/28] Build on all platforms --- .evergreen/config/build-task-groups.yml | 20 +++---- .evergreen/config/build-variants.yml | 76 +++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 10 deletions(-) diff --git a/.evergreen/config/build-task-groups.yml b/.evergreen/config/build-task-groups.yml index eb1078db8..6004902fe 100644 --- a/.evergreen/config/build-task-groups.yml +++ b/.evergreen/config/build-task-groups.yml @@ -22,13 +22,13 @@ task_groups: - ".build" # Builds all versions of PHP that support OpenSSL 3 (PHP 8.1+) -# - name: "build-php-openssl3" -# # Keep this number in sync with the number of PHP versions to allow for parallel builds -# # Subtract 2 versions as PHP 7.4 and 8.0 are not built with OpenSSL 3 -# max_hosts: 2 -# setup_task: *build_setup -# setup_task_can_fail_task: true -# setup_task_timeout_secs: 1800 -# teardown_task: *build_teardown -# tasks: -# - ".build !.php7.4 !.php8.0" + - name: "build-php-openssl3" + # Keep this number in sync with the number of PHP versions to allow for parallel builds + # Subtract 2 versions as PHP 7.4 and 8.0 are not built with OpenSSL 3 + max_hosts: 2 + setup_task: *build_setup + setup_task_can_fail_task: true + setup_task_timeout_secs: 1800 + teardown_task: *build_teardown + tasks: + - ".build !.php7.4 !.php8.0" diff --git a/.evergreen/config/build-variants.yml b/.evergreen/config/build-variants.yml index d1abcf800..189abbe1d 100644 --- a/.evergreen/config/build-variants.yml +++ b/.evergreen/config/build-variants.yml @@ -9,3 +9,79 @@ buildvariants: run_on: debian11-small tasks: - name: "build-all-php" + - name: build-debian10 + display_name: "Build: Debian 10" + tags: ["build", "debian", "x64"] + run_on: debian10-small + tasks: + - name: "build-all-php" + - name: build-debian92 + display_name: "Build: Debian 9.2" + tags: ["build", "debian", "x64"] + run_on: debian92-small + tasks: + - name: "build-all-php" + + # RHEL + - name: build-rhel90 + display_name: "Build: RHEL 9.0" + tags: ["build", "rhel", "x64"] + run_on: rhel90-small + tasks: + - name: "build-php-openssl3" + - name: build-rhel83-zseries + display_name: "Build: RHEL 8.3 Zseries" + tags: ["build", "rhel", "zseries"] + run_on: rhel83-zseries-small + tasks: + - name: "build-all-php" + - name: build-rhel82-arm64 + display_name: "Build: RHEL 8.2 ARM64" + tags: ["build", "rhel", "arm64"] + run_on: rhel82-arm64 + tasks: + - name: "build-all-php" + - name: build-rhel81-power8 + display_name: "Build: RHEL 8.1 Power8" + tags: ["build", "rhel", "power8"] + run_on: rhel81-power8-large + tasks: + - name: "build-all-php" + - name: build-rhel80 + display_name: "Build: RHEL 8.0" + tags: ["build", "rhel", "x64"] + run_on: rhel80-small + tasks: + - name: "build-all-php" + - name: build-rhel76 + display_name: "Build: RHEL 7.6" + tags: ["build", "rhel", "x64"] + run_on: rhel76-small + tasks: + - name: "build-all-php" + + # Ubuntu LTS + - name: build-ubuntu2204 + display_name: "Build: Ubuntu 22.04 x64" + tags: ["build", "ubuntu", "x64"] + run_on: ubuntu2204-small + tasks: + - name: "build-php-openssl3" + - name: build-ubuntu2204-arm64 + display_name: "Build: Ubuntu 22.04 ARM64" + tags: ["build", "ubuntu", "arm64"] + run_on: ubuntu2204-arm64-small + tasks: + - name: "build-php-openssl3" + - name: build-ubuntu2004 + display_name: "Build: Ubuntu 20.04 x64" + tags: ["build", "ubuntu", "x64"] + run_on: ubuntu2004-small + tasks: + - name: "build-all-php" + - name: build-ubuntu2004-arm64 + display_name: "Build: Ubuntu 20.04 ARM64" + tags: ["build", "ubuntu", "arm64"] + run_on: ubuntu2004-arm64-small + tasks: + - name: "build-all-php" From d95d44ee0ecc1a21cff2c224248d1328c23970ac Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 27 Sep 2023 13:23:39 +0200 Subject: [PATCH 05/28] Run tests on all MongoDB versions --- .evergreen/config/legacy-variants.yml | 13 ------------ .evergreen/config/test-variants.yml | 30 +++++++++++++-------------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/.evergreen/config/legacy-variants.yml b/.evergreen/config/legacy-variants.yml index 88b3a62bc..ef8d3f01f 100644 --- a/.evergreen/config/legacy-variants.yml +++ b/.evergreen/config/legacy-variants.yml @@ -261,19 +261,6 @@ buildvariants: - name: "test-replica_set" - name: "test-sharded_cluster" - # Test all topologies and MongoDB versions with latest-stable PHP and PHPC on Debian - - matrix_name: "test-mongodb-versions" - matrix_spec: { "os": ["debian92", "debian11"], "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "${os}, ${mongodb-versions}, ${php-edge-versions}, ${driver-versions}" - exclude_spec: - # Debian 9.2 only supports up to MongoDB 5.0 - - { "os": "debian92", "mongodb-versions": ["6.0", "7.0", "rapid", "latest"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4", "5.0"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - tasks: - - name: "test-standalone" - - name: "test-replica_set" - - name: "test-sharded_cluster" - # Test oldest-supported PHP, MongoDB, and driver versions with lowest dependencies on Debian - matrix_name: "test-oldest-supported" matrix_spec: { "os": "debian92", "mongodb-edge-versions": "oldest-supported", "php-edge-versions": "oldest-supported", "driver-versions": "oldest-supported", "dependencies": "lowest" } diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index bfe3fafc2..8b93e2198 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -17,18 +17,18 @@ buildvariants: - ".standalone .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".replicaset .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".sharded .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" -# - name: test-debian92-php82-local -# tags: ["test", "debian", "x64"] -# display_name: "Test: Debian 9.2, PHP 8.2" -# run_on: debian92-small -# expansions: -# FETCH_BUILD_VARIANT: "build-debian92" -# FETCH_BUILD_TASK: "build-php-8.2" -# depends_on: -# - variant: "build-debian92" -# name: "build-php-8.2" -# tasks: -# # Remember to add new major versions here as they are released -# - ".standalone .local !.6.0 !.7.0 !.rapid !.latest" -# - ".replicaset .local !.6.0 !.7.0 !.rapid !.latest" -# - ".sharded .local !.6.0 !.7.0 !.rapid !.latest" + - name: test-debian92-php82-local + tags: ["test", "debian", "x64"] + display_name: "Test: Debian 9.2, PHP 8.2" + run_on: debian92-small + expansions: + FETCH_BUILD_VARIANT: "build-debian92" + FETCH_BUILD_TASK: "build-php-8.2" + depends_on: + - variant: "build-debian92" + name: "build-php-8.2" + tasks: + # Remember to add new major versions here as they are released + - ".standalone .local !.6.0 !.7.0 !.rapid !.latest" + - ".replicaset .local !.6.0 !.7.0 !.rapid !.latest" + - ".sharded .local !.6.0 !.7.0 !.rapid !.latest" From 50612ae3a7fad322903d08ab7d5310493bc209b5 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 27 Sep 2023 13:24:42 +0200 Subject: [PATCH 06/28] Add remaining tests --- .evergreen/config/test-variants.yml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index 8b93e2198..291c1e4ca 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -32,3 +32,41 @@ buildvariants: - ".standalone .local !.6.0 !.7.0 !.rapid !.latest" - ".replicaset .local !.6.0 !.7.0 !.rapid !.latest" - ".sharded .local !.6.0 !.7.0 !.rapid !.latest" + + # Test remaining PHP versions with replica sets on Debian 11 with MongoDB 7.0 + - name: test-debian11-php81-local + tags: ["test", "debian", "x64"] + display_name: "Test: Debian 11, PHP 8.1" + run_on: debian11-small + expansions: + FETCH_BUILD_VARIANT: "build-debian11" + FETCH_BUILD_TASK: "build-php-8.1" + depends_on: + - variant: "build-debian11" + name: "build-php-8.1" + tasks: + - ".replicaset .local .7.0 .auth" + - name: test-debian11-php80-local + tags: ["test", "debian", "x64"] + display_name: "Test: Debian 11, PHP 8.0" + run_on: debian11-small + expansions: + FETCH_BUILD_VARIANT: "build-debian11" + FETCH_BUILD_TASK: "build-php-8.0" + depends_on: + - variant: "build-debian11" + name: "build-php-8.0" + tasks: + - ".replicaset .local .7.0 .auth" + - name: test-debian11-php74-local + tags: ["test", "debian", "x64"] + display_name: "Test: Debian 11, PHP 7.4" + run_on: debian11-small + expansions: + FETCH_BUILD_VARIANT: "build-debian11" + FETCH_BUILD_TASK: "build-php-7.4" + depends_on: + - variant: "build-debian11" + name: "build-php-7.4" + tasks: + - ".replicaset .local .7.0 .auth" From 92e59a5f62c238cd0a84f797bb8cb2d24ffd156b Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 27 Sep 2023 13:40:28 +0200 Subject: [PATCH 07/28] Build against latest extension branch --- .evergreen/config/build/_template-build-extension.yml | 2 ++ .evergreen/config/build/build-php-7.4.yml | 2 ++ .evergreen/config/build/build-php-8.0.yml | 2 ++ .evergreen/config/build/build-php-8.1.yml | 2 ++ .evergreen/config/build/build-php-8.2.yml | 2 ++ 5 files changed, 10 insertions(+) diff --git a/.evergreen/config/build/_template-build-extension.yml b/.evergreen/config/build/_template-build-extension.yml index a9618c91f..79ef239d1 100644 --- a/.evergreen/config/build/_template-build-extension.yml +++ b/.evergreen/config/build/_template-build-extension.yml @@ -6,4 +6,6 @@ tasks: vars: PHP_VERSION: "%phpVersion%" - func: "compile extension" + vars: + EXTENSION_BRANCH: "master" - func: "upload extension" diff --git a/.evergreen/config/build/build-php-7.4.yml b/.evergreen/config/build/build-php-7.4.yml index 1b0b920d7..adca65475 100644 --- a/.evergreen/config/build/build-php-7.4.yml +++ b/.evergreen/config/build/build-php-7.4.yml @@ -7,4 +7,6 @@ tasks: vars: PHP_VERSION: "7.4" - func: "compile extension" + vars: + EXTENSION_BRANCH: "master" - func: "upload extension" diff --git a/.evergreen/config/build/build-php-8.0.yml b/.evergreen/config/build/build-php-8.0.yml index ea3431e82..c2d7fe129 100644 --- a/.evergreen/config/build/build-php-8.0.yml +++ b/.evergreen/config/build/build-php-8.0.yml @@ -7,4 +7,6 @@ tasks: vars: PHP_VERSION: "8.0" - func: "compile extension" + vars: + EXTENSION_BRANCH: "master" - func: "upload extension" diff --git a/.evergreen/config/build/build-php-8.1.yml b/.evergreen/config/build/build-php-8.1.yml index 385665b7e..fba3ec8f0 100644 --- a/.evergreen/config/build/build-php-8.1.yml +++ b/.evergreen/config/build/build-php-8.1.yml @@ -7,4 +7,6 @@ tasks: vars: PHP_VERSION: "8.1" - func: "compile extension" + vars: + EXTENSION_BRANCH: "master" - func: "upload extension" diff --git a/.evergreen/config/build/build-php-8.2.yml b/.evergreen/config/build/build-php-8.2.yml index 00fccbe6f..4d7acef8f 100644 --- a/.evergreen/config/build/build-php-8.2.yml +++ b/.evergreen/config/build/build-php-8.2.yml @@ -7,4 +7,6 @@ tasks: vars: PHP_VERSION: "8.2" - func: "compile extension" + vars: + EXTENSION_BRANCH: "master" - func: "upload extension" From 7f70c10199e69f52bd87141175ecccad19bf787f Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 27 Sep 2023 13:41:33 +0200 Subject: [PATCH 08/28] Run no-auth tests --- .evergreen/config/test-variants.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index 291c1e4ca..c3ff2a4e0 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -45,7 +45,7 @@ buildvariants: - variant: "build-debian11" name: "build-php-8.1" tasks: - - ".replicaset .local .7.0 .auth" + - ".replicaset .local .7.0" - name: test-debian11-php80-local tags: ["test", "debian", "x64"] display_name: "Test: Debian 11, PHP 8.0" @@ -57,7 +57,7 @@ buildvariants: - variant: "build-debian11" name: "build-php-8.0" tasks: - - ".replicaset .local .7.0 .auth" + - ".replicaset .local .7.0" - name: test-debian11-php74-local tags: ["test", "debian", "x64"] display_name: "Test: Debian 11, PHP 7.4" @@ -69,4 +69,4 @@ buildvariants: - variant: "build-debian11" name: "build-php-7.4" tasks: - - ".replicaset .local .7.0 .auth" + - ".replicaset .local .7.0" From a98fad37e28153252b9233288a25d3fbf452f269 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 08:51:51 +0200 Subject: [PATCH 09/28] Set PHP_VERSION expansion in test variants --- .evergreen/config/test-variants.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index c3ff2a4e0..ab0eeb663 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -10,6 +10,7 @@ buildvariants: expansions: FETCH_BUILD_VARIANT: "build-debian11" FETCH_BUILD_TASK: "build-php-8.2" + PHP_VERSION: "8.2" depends_on: - variant: "build-debian11" name: "build-php-8.2" @@ -24,6 +25,7 @@ buildvariants: expansions: FETCH_BUILD_VARIANT: "build-debian92" FETCH_BUILD_TASK: "build-php-8.2" + PHP_VERSION: "8.2" depends_on: - variant: "build-debian92" name: "build-php-8.2" @@ -41,6 +43,7 @@ buildvariants: expansions: FETCH_BUILD_VARIANT: "build-debian11" FETCH_BUILD_TASK: "build-php-8.1" + PHP_VERSION: "8.1" depends_on: - variant: "build-debian11" name: "build-php-8.1" @@ -53,6 +56,7 @@ buildvariants: expansions: FETCH_BUILD_VARIANT: "build-debian11" FETCH_BUILD_TASK: "build-php-8.0" + PHP_VERSION: "8.0" depends_on: - variant: "build-debian11" name: "build-php-8.0" @@ -65,6 +69,7 @@ buildvariants: expansions: FETCH_BUILD_VARIANT: "build-debian11" FETCH_BUILD_TASK: "build-php-7.4" + PHP_VERSION: "7.4" depends_on: - variant: "build-debian11" name: "build-php-7.4" From 5741cc574eb3f05ba791d6b38f85f2fac5da4689 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 08:51:57 +0200 Subject: [PATCH 10/28] Remove sudo to fix RHEL builds --- .evergreen/compile-extension.sh | 2 +- .evergreen/install-composer.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/compile-extension.sh b/.evergreen/compile-extension.sh index 3f1c68aaf..4a890a629 100644 --- a/.evergreen/compile-extension.sh +++ b/.evergreen/compile-extension.sh @@ -34,7 +34,7 @@ install_extension () pecl install -f mongodb fi - sudo cp ${PROJECT_DIRECTORY}/.evergreen/config/php.ini ${PHP_PATH}/lib/php.ini + cp ${PROJECT_DIRECTORY}/.evergreen/config/php.ini ${PHP_PATH}/lib/php.ini php --ri mongodb } diff --git a/.evergreen/install-composer.sh b/.evergreen/install-composer.sh index 731a76b65..4c3e36acf 100644 --- a/.evergreen/install-composer.sh +++ b/.evergreen/install-composer.sh @@ -28,7 +28,7 @@ case "$DEPENDENCIES" in ;; esac -sudo cp ${PROJECT_DIRECTORY}/.evergreen/config/php.ini ${PHP_PATH}/lib/php.ini +cp ${PROJECT_DIRECTORY}/.evergreen/config/php.ini ${PHP_PATH}/lib/php.ini php --ri mongodb From 9ebdeb752bb567785d3c9669923682356cbcc30b Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 09:16:12 +0200 Subject: [PATCH 11/28] Clean up legacy variants to account for progress --- .evergreen/config/legacy-variants.yml | 175 -------------------------- 1 file changed, 175 deletions(-) diff --git a/.evergreen/config/legacy-variants.yml b/.evergreen/config/legacy-variants.yml index ef8d3f01f..fc7f0158c 100644 --- a/.evergreen/config/legacy-variants.yml +++ b/.evergreen/config/legacy-variants.yml @@ -21,18 +21,6 @@ axes: variables: PHP_VERSION: "7.4" - - id: php-edge-versions - display_name: PHP Version - values: - - id: "latest-stable" - display_name: "PHP 8.2" - variables: - PHP_VERSION: "8.2" - - id: "oldest-supported" - display_name: "PHP 7.4" - variables: - PHP_VERSION: "7.4" - - id: mongodb-versions display_name: MongoDB Version values: @@ -73,18 +61,6 @@ axes: variables: MONGODB_VERSION: "3.6" - - id: mongodb-edge-versions - display_name: MongoDB Version - values: - - id: "latest-stable" - display_name: "MongoDB 6.0" - variables: - MONGODB_VERSION: "6.0" - - id: "oldest-supported" - display_name: "MongoDB 3.6" - variables: - MONGODB_VERSION: "3.6" - - id: driver-versions display_name: Driver Version values: @@ -101,98 +77,6 @@ axes: variables: EXTENSION_BRANCH: "master" - - id: os - display_name: OS - values: - # Debian - - id: debian11 - display_name: "Debian 11" - run_on: debian11-small - - id: debian10 - display_name: "Debian 10" - run_on: debian10-small - - id: debian92 - display_name: "Debian 9.2" - run_on: debian92-small - - # RHEL - - id: rhel90 - display_name: "RHEL 9.0" - run_on: rhel90-small - - id: rhel80 - display_name: "RHEL 8.0" - run_on: rhel80-small - - # Ubuntu LTS - - id: ubuntu2204 - display_name: "Ubuntu 22.04 x64" - run_on: ubuntu2204-small - - id: ubuntu2204-arm64 - display_name: "Ubuntu 22.04 ARM64" - run_on: ubuntu2204-arm64-small - - id: ubuntu2004 - display_name: "Ubuntu 20.04 x64" - run_on: ubuntu2004-small - - id: ubuntu2004-arm64 - display_name: "Ubuntu 20.04 ARM64" - run_on: ubuntu2204-arm64-small - - - id: topology - display_name: Topology - values: - - id: standalone - display_name: Standalone - variables: - TOPOLOGY: "server" - - id: replicaset - display_name: Replica Set - variables: - TOPOLOGY: "replica_set" - - id: sharded-cluster - display_name: Sharded Cluster - variables: - TOPOLOGY: "sharded_cluster" - - - id: auth - display_name: Authentication - values: - - id: auth - display_name: Auth - variables: - AUTH: "auth" - - id: noauth - display_name: NoAuth - variables: - AUTH: "noauth" - - - id: ssl - display_name: SSL - values: - - id: ssl - display_name: SSL - variables: - SSL: "ssl" - - id: nossl - display_name: NoSSL - variables: - SSL: "nossl" - - - id: storage-engine - display_name: Storage - values: - - id: mmapv1 - display_name: MMAPv1 - variables: - STORAGE_ENGINE: "mmapv1" - - id: wiredtiger - display_name: WiredTiger - variables: - STORAGE_ENGINE: "wiredtiger" - - id: inmemory - display_name: InMemory - variables: - STORAGE_ENGINE: "inmemory" - - id: dependencies display_name: Dependencies values: @@ -201,66 +85,7 @@ axes: variables: DEPENDENCIES: "lowest" -task_groups: - - name: test_atlas_task_group - setup_group: - - func: "fetch source" - - func: "prepare resources" - - func: "fix absolute paths" - - func: "make files executable" - - func: "install dependencies" - - command: subprocess.exec - params: - working_dir: src - binary: bash - add_expansions_to_env: true - env: - MONGODB_VERSION: '7.0' - args: - - ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh - - command: expansions.update - params: - file: src/atlas-expansion.yml - teardown_group: - - command: subprocess.exec - params: - working_dir: src - binary: bash - add_expansions_to_env: true - args: - - ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh - - func: "upload test results" - - func: "cleanup" - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - test-atlas - buildvariants: - # Test all PHP versions with latest-stable MongoDB and PHPC on all platforms - - matrix_name: "test-php-versions" - matrix_spec: - os: - - debian11 - - debian10 - - rhel90 - - ubuntu2204 - - ubuntu2204-arm64 - - ubuntu2004 - mongodb-edge-versions: "latest-stable" - php-versions: "*" - driver-versions: "latest-stable" - display_name: "${os}, ${mongodb-edge-versions}, ${php-versions}, ${driver-versions}" - exclude_spec: - # Exclude "latest-stable" PHP version for Debian 11 (see: test-mongodb-versions matrix) - - { "os": "debian11", "mongodb-edge-versions": "latest-stable", "php-versions": "8.2", "driver-versions": "latest-stable" } - # Exclude PHP versions older than 8.1 on RHEL 9 and Ubuntu 22.04 (OpenSSL 3 is only supported on PHP 8.1+) - - { "os": ["rhel90", "ubuntu2204-arm64", "ubuntu2204"], "php-versions": ["7.4", "8.0"], "mongodb-edge-versions": "*", "driver-versions": "*" } - tasks: - - name: "test-standalone" - - name: "test-replica_set" - - name: "test-sharded_cluster" - # Test oldest-supported PHP, MongoDB, and driver versions with lowest dependencies on Debian - matrix_name: "test-oldest-supported" matrix_spec: { "os": "debian92", "mongodb-edge-versions": "oldest-supported", "php-edge-versions": "oldest-supported", "driver-versions": "oldest-supported", "dependencies": "lowest" } From f7855be41115f237931c4bd270964d64764a3b3a Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 09:16:29 +0200 Subject: [PATCH 12/28] Move Atlas Tests to new format --- .evergreen/config.yml | 3 ++- .evergreen/config/legacy-tasks.yml | 37 -------------------------- .evergreen/config/legacy-variants.yml | 6 ----- .evergreen/config/test-task-groups.yml | 37 ++++++++++++++++++++++++++ .evergreen/config/test-tasks.yml | 7 +++++ .evergreen/config/test-variants.yml | 15 +++++++++++ 6 files changed, 61 insertions(+), 44 deletions(-) create mode 100644 .evergreen/config/test-task-groups.yml create mode 100644 .evergreen/config/test-tasks.yml diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 73c82142f..bbb00f525 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -40,7 +40,8 @@ include: - filename: .evergreen/config/build-task-groups.yml - filename: .evergreen/config/build-variants.yml -# - filename: .evergreen/config/test-tasks.yml + - filename: .evergreen/config/test-tasks.yml + - filename: .evergreen/config/test-task-groups.yml - filename: .evergreen/config/test-variants.yml # Automatically generated files diff --git a/.evergreen/config/legacy-tasks.yml b/.evergreen/config/legacy-tasks.yml index 2d369b84c..755c35ea4 100644 --- a/.evergreen/config/legacy-tasks.yml +++ b/.evergreen/config/legacy-tasks.yml @@ -1,34 +1,4 @@ tasks: - - name: "test-standalone" - tags: ["standalone"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "server" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - - - name: "test-replica_set" - tags: ["replica_set"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "replica_set" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - - - name: "test-sharded_cluster" - tags: ["sharded_cluster"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "sharded_cluster" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - - name: "test-atlas-data-lake" commands: - func: "bootstrap mongohoused" @@ -121,10 +91,3 @@ tasks: client_side_encryption_aws_access_key_id: "" client_side_encryption_aws_secret_access_key: "" TESTS: "csfle-without-aws-creds" - - - name: "test-atlas" - commands: - - func: "start kms servers" - - func: "run tests" - vars: - TESTS: "atlas" diff --git a/.evergreen/config/legacy-variants.yml b/.evergreen/config/legacy-variants.yml index fc7f0158c..67e3da973 100644 --- a/.evergreen/config/legacy-variants.yml +++ b/.evergreen/config/legacy-variants.yml @@ -158,9 +158,3 @@ buildvariants: - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4", "5.0"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } tasks: - name: "test-without_aws_creds" - - - matrix_name: rhel8-test-atlas - matrix_spec: { "os": ["rhel80"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: Atlas Tests - tasks: - - test_atlas_task_group diff --git a/.evergreen/config/test-task-groups.yml b/.evergreen/config/test-task-groups.yml new file mode 100644 index 000000000..378b38c70 --- /dev/null +++ b/.evergreen/config/test-task-groups.yml @@ -0,0 +1,37 @@ +task_groups: + - name: test_atlas_task_group + setup_group: + - func: "fetch source" + - func: "prepare resources" + - func: "fix absolute paths" + - func: "make files executable" + - func: "install dependencies" + - func: "locate PHP binaries" + - func: "fetch extension" + - func: "install composer" + - command: subprocess.exec + params: + working_dir: src + binary: bash + add_expansions_to_env: true + env: + MONGODB_VERSION: '7.0' + args: + - ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh + - command: expansions.update + params: + file: src/atlas-expansion.yml + teardown_group: + - command: subprocess.exec + params: + working_dir: src + binary: bash + add_expansions_to_env: true + args: + - ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh + - func: "upload test results" + - func: "cleanup" + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + tasks: + - test-atlas diff --git a/.evergreen/config/test-tasks.yml b/.evergreen/config/test-tasks.yml new file mode 100644 index 000000000..9c431bb09 --- /dev/null +++ b/.evergreen/config/test-tasks.yml @@ -0,0 +1,7 @@ +tasks: + - name: "test-atlas" + commands: + - func: "start kms servers" + - func: "run tests" + vars: + TESTS: "atlas" diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index ab0eeb663..8cc5a5117 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -75,3 +75,18 @@ buildvariants: name: "build-php-7.4" tasks: - ".replicaset .local .7.0" + + # Test Atlas Tests on RHEL 8 + - name: test-rhel80-php82-atlas + tags: ["test", "debian", "x64"] + display_name: "Test: RHEL 8.0, PHP 8.2" + run_on: rhel80-small + expansions: + FETCH_BUILD_VARIANT: "build-rhel80" + FETCH_BUILD_TASK: "build-php-8.2" + PHP_VERSION: "8.2" + depends_on: + - variant: "build-rhel80" + name: "build-php-8.2" + tasks: + - test_atlas_task_group From ff20448e45be291b5d7bd692346118443c403b65 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 09:19:31 +0200 Subject: [PATCH 13/28] Move serverless tests to new format --- .evergreen/config/legacy-tasks.yml | 8 -------- .evergreen/config/legacy-variants.yml | 6 ------ .evergreen/config/test-tasks.yml | 8 ++++++++ .evergreen/config/test-variants.yml | 1 + 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.evergreen/config/legacy-tasks.yml b/.evergreen/config/legacy-tasks.yml index 755c35ea4..03e4414eb 100644 --- a/.evergreen/config/legacy-tasks.yml +++ b/.evergreen/config/legacy-tasks.yml @@ -31,14 +31,6 @@ tasks: vars: TESTS: "versioned-api" - - name: "test-serverless" - tags: ["serverless"] - commands: - - func: "create serverless instance" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run serverless tests" - - name: "test-loadBalanced" tags: ["loadbalanced"] commands: diff --git a/.evergreen/config/legacy-variants.yml b/.evergreen/config/legacy-variants.yml index 67e3da973..7c75c72e5 100644 --- a/.evergreen/config/legacy-variants.yml +++ b/.evergreen/config/legacy-variants.yml @@ -113,12 +113,6 @@ buildvariants: tasks: - .versioned-api - - matrix_name: "serverless" - matrix_spec: { "os": "debian11", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "Serverless" - tasks: - - .serverless - - matrix_name: "test-loadBalanced" matrix_spec: { "os": "debian11", "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } display_name: "Load balanced - ${mongodb-versions}" diff --git a/.evergreen/config/test-tasks.yml b/.evergreen/config/test-tasks.yml index 9c431bb09..64cf40423 100644 --- a/.evergreen/config/test-tasks.yml +++ b/.evergreen/config/test-tasks.yml @@ -5,3 +5,11 @@ tasks: - func: "run tests" vars: TESTS: "atlas" + + - name: "test-serverless" + tags: ["serverless"] + commands: + - func: "create serverless instance" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run serverless tests" diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index 8cc5a5117..98536ccbd 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -18,6 +18,7 @@ buildvariants: - ".standalone .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".replicaset .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".sharded .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" + - ".serverless" - name: test-debian92-php82-local tags: ["test", "debian", "x64"] display_name: "Test: Debian 9.2, PHP 8.2" From 966adc8a470d1f3bf77f939764110bea77dd51b8 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 09:23:08 +0200 Subject: [PATCH 14/28] Move more tests to new format --- .evergreen/config.yml | 10 +++++ .evergreen/config/generate-config.php | 4 +- .evergreen/config/legacy-tasks.yml | 45 ------------------- .evergreen/config/legacy-variants.yml | 18 -------- .../config/test/_template-load-balanced.yml | 17 +++++++ .../test/_template-require-api-version.yml | 29 ++++++++++++ .evergreen/config/test/load-balanced-5.0.yml | 18 ++++++++ .evergreen/config/test/load-balanced-6.0.yml | 18 ++++++++ .evergreen/config/test/load-balanced-7.0.yml | 18 ++++++++ .../config/test/load-balanced-latest.yml | 18 ++++++++ .../config/test/load-balanced-rapid.yml | 18 ++++++++ .../config/test/require-api-version-5.0.yml | 30 +++++++++++++ .../config/test/require-api-version-6.0.yml | 30 +++++++++++++ .../config/test/require-api-version-7.0.yml | 30 +++++++++++++ .../test/require-api-version-latest.yml | 30 +++++++++++++ .../config/test/require-api-version-rapid.yml | 30 +++++++++++++ 16 files changed, 298 insertions(+), 65 deletions(-) create mode 100644 .evergreen/config/test/_template-load-balanced.yml create mode 100644 .evergreen/config/test/_template-require-api-version.yml create mode 100644 .evergreen/config/test/load-balanced-5.0.yml create mode 100644 .evergreen/config/test/load-balanced-6.0.yml create mode 100644 .evergreen/config/test/load-balanced-7.0.yml create mode 100644 .evergreen/config/test/load-balanced-latest.yml create mode 100644 .evergreen/config/test/load-balanced-rapid.yml create mode 100644 .evergreen/config/test/require-api-version-5.0.yml create mode 100644 .evergreen/config/test/require-api-version-6.0.yml create mode 100644 .evergreen/config/test/require-api-version-7.0.yml create mode 100644 .evergreen/config/test/require-api-version-latest.yml create mode 100644 .evergreen/config/test/require-api-version-rapid.yml diff --git a/.evergreen/config.yml b/.evergreen/config.yml index bbb00f525..052a31d66 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -58,3 +58,13 @@ include: - filename: .evergreen/config/test/local-4.2.yml - filename: .evergreen/config/test/local-4.0.yml - filename: .evergreen/config/test/local-3.6.yml + - filename: .evergreen/config/test/load-balanced-latest.yml + - filename: .evergreen/config/test/load-balanced-rapid.yml + - filename: .evergreen/config/test/load-balanced-7.0.yml + - filename: .evergreen/config/test/load-balanced-6.0.yml + - filename: .evergreen/config/test/load-balanced-5.0.yml + - filename: .evergreen/config/test/require-api-version-latest.yml + - filename: .evergreen/config/test/require-api-version-rapid.yml + - filename: .evergreen/config/test/require-api-version-7.0.yml + - filename: .evergreen/config/test/require-api-version-6.0.yml + - filename: .evergreen/config/test/require-api-version-5.0.yml diff --git a/.evergreen/config/generate-config.php b/.evergreen/config/generate-config.php index 10102d079..2a18a333c 100644 --- a/.evergreen/config/generate-config.php +++ b/.evergreen/config/generate-config.php @@ -42,9 +42,9 @@ // Test tasks $allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-local.yml', 'local-%s', $localServerVersions); -//$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-load-balanced.yml', 'load-balanced-%s', $loadBalancedServerVersions); +$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-load-balanced.yml', 'load-balanced-%s', $loadBalancedServerVersions); +$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-require-api-version.yml', 'require-api-version-%s', $requireApiServerVersions); //$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-ocsp.yml', 'ocsp-%s', $ocspServerVersions); -//$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-require-api-version.yml', 'require-api-version-%s', $requireApiServerVersions); //$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-skip-crypt-shared.yml', 'skip-crypt-shared-%s', $skipCryptSharedServerVersions); echo "Generated config. Use the following list to import files:\n"; diff --git a/.evergreen/config/legacy-tasks.yml b/.evergreen/config/legacy-tasks.yml index 03e4414eb..f9cf7f12f 100644 --- a/.evergreen/config/legacy-tasks.yml +++ b/.evergreen/config/legacy-tasks.yml @@ -4,51 +4,6 @@ tasks: - func: "bootstrap mongohoused" - func: "run atlas data lake test" - - name: "test-requireApiVersion" - tags: ["versioned-api"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "server" - AUTH: "auth" - REQUIRE_API_VERSION: "yes" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - vars: - API_VERSION: "1" - - - name: "test-acceptApiVersion2" - tags: ["versioned-api"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "server" - ORCHESTRATION_FILE: "versioned-api-testing.json" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - vars: - TESTS: "versioned-api" - - - name: "test-loadBalanced" - tags: ["loadbalanced"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "sharded_cluster" - LOAD_BALANCER: "true" - SSL: "yes" - - func: "start load balancer" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - vars: - # Note: loadBalanced=true should already be appended to SINGLE_MONGOS_LB_URI - MONGODB_URI: "${SINGLE_MONGOS_LB_URI}" - SSL: "yes" - # Note: "stop load balancer" will be called from "post" - - name: "test-csfle-crypt_shared" commands: - func: "bootstrap mongo-orchestration" diff --git a/.evergreen/config/legacy-variants.yml b/.evergreen/config/legacy-variants.yml index 7c75c72e5..324ca4c0a 100644 --- a/.evergreen/config/legacy-variants.yml +++ b/.evergreen/config/legacy-variants.yml @@ -104,24 +104,6 @@ buildvariants: tasks: - name: "test-atlas-data-lake" - - matrix_name: "test-requireApiVersion" - matrix_spec: { "os": "debian11", "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "Versioned API - ${mongodb-versions}" - exclude_spec: - # Stable API is available from MongoDB 5.0+ - - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - tasks: - - .versioned-api - - - matrix_name: "test-loadBalanced" - matrix_spec: { "os": "debian11", "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "Load balanced - ${mongodb-versions}" - exclude_spec: - # Load balancer is available from MongoDB 5.0+ - - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - tasks: - - name: "test-loadBalanced" - # CSFLE tests (crypt_shared and mongocryptd) are tested on RHEL 8 as it's the only version that supports # 4.2 AND 6.0 (which is required for crypt_shared), as well as a somewhat relevant PHP version. # Newer MongoDB version may require adding different operating systems here diff --git a/.evergreen/config/test/_template-load-balanced.yml b/.evergreen/config/test/_template-load-balanced.yml new file mode 100644 index 000000000..fc7e4d1b9 --- /dev/null +++ b/.evergreen/config/test/_template-load-balanced.yml @@ -0,0 +1,17 @@ +tasks: + - name: "test-mongodb-%mongodbVersion%-loadbalanced" + tags: ["sharded", "local", "%mongodbVersion%", "loadbalanced"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "%mongodbVersion%" + LOAD_BALANCER: "true" + SSL: "yes" + - func: "start load balancer" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + MONGODB_URI: "${SINGLE_MONGOS_LB_URI}" + SSL: "yes" diff --git a/.evergreen/config/test/_template-require-api-version.yml b/.evergreen/config/test/_template-require-api-version.yml new file mode 100644 index 000000000..c567eceee --- /dev/null +++ b/.evergreen/config/test/_template-require-api-version.yml @@ -0,0 +1,29 @@ +tasks: + - name: "test-requireApiVersion-%mongodbVersion%" + tags: ["standalone", "local", "%mongodbVersion%", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + AUTH: "auth" + REQUIRE_API_VERSION: "yes" + MONGODB_VERSION: "%mongodbVersion%" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + API_VERSION: "1" + + - name: "test-acceptApiVersion2-%mongodbVersion%" + tags: ["standalone", "local", "%mongodbVersion%", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + ORCHESTRATION_FILE: "versioned-api-testing.json" + MONGODB_VERSION: "%mongodbVersion%" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "versioned-api" diff --git a/.evergreen/config/test/load-balanced-5.0.yml b/.evergreen/config/test/load-balanced-5.0.yml new file mode 100644 index 000000000..689f420f9 --- /dev/null +++ b/.evergreen/config/test/load-balanced-5.0.yml @@ -0,0 +1,18 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-5.0-loadbalanced" + tags: ["sharded", "local", "5.0", "loadbalanced"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "5.0" + LOAD_BALANCER: "true" + SSL: "yes" + - func: "start load balancer" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + MONGODB_URI: "${SINGLE_MONGOS_LB_URI}" + SSL: "yes" diff --git a/.evergreen/config/test/load-balanced-6.0.yml b/.evergreen/config/test/load-balanced-6.0.yml new file mode 100644 index 000000000..da82ed966 --- /dev/null +++ b/.evergreen/config/test/load-balanced-6.0.yml @@ -0,0 +1,18 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-6.0-loadbalanced" + tags: ["sharded", "local", "6.0", "loadbalanced"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "6.0" + LOAD_BALANCER: "true" + SSL: "yes" + - func: "start load balancer" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + MONGODB_URI: "${SINGLE_MONGOS_LB_URI}" + SSL: "yes" diff --git a/.evergreen/config/test/load-balanced-7.0.yml b/.evergreen/config/test/load-balanced-7.0.yml new file mode 100644 index 000000000..133105038 --- /dev/null +++ b/.evergreen/config/test/load-balanced-7.0.yml @@ -0,0 +1,18 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-7.0-loadbalanced" + tags: ["sharded", "local", "7.0", "loadbalanced"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "7.0" + LOAD_BALANCER: "true" + SSL: "yes" + - func: "start load balancer" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + MONGODB_URI: "${SINGLE_MONGOS_LB_URI}" + SSL: "yes" diff --git a/.evergreen/config/test/load-balanced-latest.yml b/.evergreen/config/test/load-balanced-latest.yml new file mode 100644 index 000000000..910541f4d --- /dev/null +++ b/.evergreen/config/test/load-balanced-latest.yml @@ -0,0 +1,18 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-latest-loadbalanced" + tags: ["sharded", "local", "latest", "loadbalanced"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "latest" + LOAD_BALANCER: "true" + SSL: "yes" + - func: "start load balancer" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + MONGODB_URI: "${SINGLE_MONGOS_LB_URI}" + SSL: "yes" diff --git a/.evergreen/config/test/load-balanced-rapid.yml b/.evergreen/config/test/load-balanced-rapid.yml new file mode 100644 index 000000000..01773ed93 --- /dev/null +++ b/.evergreen/config/test/load-balanced-rapid.yml @@ -0,0 +1,18 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-rapid-loadbalanced" + tags: ["sharded", "local", "rapid", "loadbalanced"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "sharded_cluster" + MONGODB_VERSION: "rapid" + LOAD_BALANCER: "true" + SSL: "yes" + - func: "start load balancer" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + MONGODB_URI: "${SINGLE_MONGOS_LB_URI}" + SSL: "yes" diff --git a/.evergreen/config/test/require-api-version-5.0.yml b/.evergreen/config/test/require-api-version-5.0.yml new file mode 100644 index 000000000..6911a8bc9 --- /dev/null +++ b/.evergreen/config/test/require-api-version-5.0.yml @@ -0,0 +1,30 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-requireApiVersion-5.0" + tags: ["standalone", "local", "5.0", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + AUTH: "auth" + REQUIRE_API_VERSION: "yes" + MONGODB_VERSION: "5.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + API_VERSION: "1" + + - name: "test-acceptApiVersion2-5.0" + tags: ["standalone", "local", "5.0", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + ORCHESTRATION_FILE: "versioned-api-testing.json" + MONGODB_VERSION: "5.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "versioned-api" diff --git a/.evergreen/config/test/require-api-version-6.0.yml b/.evergreen/config/test/require-api-version-6.0.yml new file mode 100644 index 000000000..6de646b96 --- /dev/null +++ b/.evergreen/config/test/require-api-version-6.0.yml @@ -0,0 +1,30 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-requireApiVersion-6.0" + tags: ["standalone", "local", "6.0", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + AUTH: "auth" + REQUIRE_API_VERSION: "yes" + MONGODB_VERSION: "6.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + API_VERSION: "1" + + - name: "test-acceptApiVersion2-6.0" + tags: ["standalone", "local", "6.0", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + ORCHESTRATION_FILE: "versioned-api-testing.json" + MONGODB_VERSION: "6.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "versioned-api" diff --git a/.evergreen/config/test/require-api-version-7.0.yml b/.evergreen/config/test/require-api-version-7.0.yml new file mode 100644 index 000000000..187eeaca1 --- /dev/null +++ b/.evergreen/config/test/require-api-version-7.0.yml @@ -0,0 +1,30 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-requireApiVersion-7.0" + tags: ["standalone", "local", "7.0", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + AUTH: "auth" + REQUIRE_API_VERSION: "yes" + MONGODB_VERSION: "7.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + API_VERSION: "1" + + - name: "test-acceptApiVersion2-7.0" + tags: ["standalone", "local", "7.0", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + ORCHESTRATION_FILE: "versioned-api-testing.json" + MONGODB_VERSION: "7.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "versioned-api" diff --git a/.evergreen/config/test/require-api-version-latest.yml b/.evergreen/config/test/require-api-version-latest.yml new file mode 100644 index 000000000..623ff5248 --- /dev/null +++ b/.evergreen/config/test/require-api-version-latest.yml @@ -0,0 +1,30 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-requireApiVersion-latest" + tags: ["standalone", "local", "latest", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + AUTH: "auth" + REQUIRE_API_VERSION: "yes" + MONGODB_VERSION: "latest" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + API_VERSION: "1" + + - name: "test-acceptApiVersion2-latest" + tags: ["standalone", "local", "latest", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + ORCHESTRATION_FILE: "versioned-api-testing.json" + MONGODB_VERSION: "latest" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "versioned-api" diff --git a/.evergreen/config/test/require-api-version-rapid.yml b/.evergreen/config/test/require-api-version-rapid.yml new file mode 100644 index 000000000..51e2772ee --- /dev/null +++ b/.evergreen/config/test/require-api-version-rapid.yml @@ -0,0 +1,30 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-requireApiVersion-rapid" + tags: ["standalone", "local", "rapid", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + AUTH: "auth" + REQUIRE_API_VERSION: "yes" + MONGODB_VERSION: "rapid" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + API_VERSION: "1" + + - name: "test-acceptApiVersion2-rapid" + tags: ["standalone", "local", "rapid", "versioned_api"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "server" + ORCHESTRATION_FILE: "versioned-api-testing.json" + MONGODB_VERSION: "rapid" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "versioned-api" From eef549c61cc3686131a8b75b520337adbd0118ea Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 09:36:56 +0200 Subject: [PATCH 15/28] Fix wrong output in test configuration --- tests/TestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 4ecfe8cda..f349b47b5 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -70,7 +70,7 @@ public static function printConfiguration(): void $configuration = [ '%uri%' => $uri, '%database%' => static::getDatabaseName(), - '%apiVersion%' => getenv('MONGODB_API_VERSION') ?: 'Not configured', + '%apiVersion%' => getenv('API_VERSION') ?: 'Not configured', '%cryptSharedAvailable%' => FunctionalTestCase::isCryptSharedLibAvailable() ? 'Available' : 'Not available', '%mongocryptdAvailable%' => FunctionalTestCase::isMongocryptdAvailable() ? 'Available' : 'Not available', ]; From 0ed6f889b028a538db195ef3e3e82012be105a90 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 09:58:08 +0200 Subject: [PATCH 16/28] Move CSFLE tests to new format --- .evergreen/config.yml | 7 ++++ .evergreen/config/generate-config.php | 14 +++----- .evergreen/config/legacy-tasks.yml | 35 ------------------ .evergreen/config/legacy-variants.yml | 31 ---------------- .evergreen/config/test-variants.yml | 13 +++---- .evergreen/config/test/_template-csfle.yml | 41 +++++++++++++++++++++ .evergreen/config/test/csfle-4.2.yml | 42 ++++++++++++++++++++++ .evergreen/config/test/csfle-4.4.yml | 42 ++++++++++++++++++++++ .evergreen/config/test/csfle-5.0.yml | 42 ++++++++++++++++++++++ .evergreen/config/test/csfle-6.0.yml | 42 ++++++++++++++++++++++ .evergreen/config/test/csfle-7.0.yml | 42 ++++++++++++++++++++++ .evergreen/config/test/csfle-latest.yml | 42 ++++++++++++++++++++++ .evergreen/config/test/csfle-rapid.yml | 42 ++++++++++++++++++++++ 13 files changed, 353 insertions(+), 82 deletions(-) create mode 100644 .evergreen/config/test/_template-csfle.yml create mode 100644 .evergreen/config/test/csfle-4.2.yml create mode 100644 .evergreen/config/test/csfle-4.4.yml create mode 100644 .evergreen/config/test/csfle-5.0.yml create mode 100644 .evergreen/config/test/csfle-6.0.yml create mode 100644 .evergreen/config/test/csfle-7.0.yml create mode 100644 .evergreen/config/test/csfle-latest.yml create mode 100644 .evergreen/config/test/csfle-rapid.yml diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 052a31d66..66beda22c 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -68,3 +68,10 @@ include: - filename: .evergreen/config/test/require-api-version-7.0.yml - filename: .evergreen/config/test/require-api-version-6.0.yml - filename: .evergreen/config/test/require-api-version-5.0.yml + - filename: .evergreen/config/test/csfle-latest.yml + - filename: .evergreen/config/test/csfle-rapid.yml + - filename: .evergreen/config/test/csfle-7.0.yml + - filename: .evergreen/config/test/csfle-6.0.yml + - filename: .evergreen/config/test/csfle-5.0.yml + - filename: .evergreen/config/test/csfle-4.4.yml + - filename: .evergreen/config/test/csfle-4.2.yml diff --git a/.evergreen/config/generate-config.php b/.evergreen/config/generate-config.php index 2a18a333c..ca538e4d6 100644 --- a/.evergreen/config/generate-config.php +++ b/.evergreen/config/generate-config.php @@ -19,20 +19,15 @@ // Load balanced supports MongoDB 5.0+ fn (string $version): bool => in_array($version, ['latest', 'rapid']) || version_compare($version, '5.0', '>='), ); -$ocspServerVersions = array_filter( - $supportedMongoDBVersions, - // OCSP supports MongoDB 4.4+ - fn (string $version): bool => in_array($version, ['latest', 'rapid']) || version_compare($version, '4.4', '>='), -); $requireApiServerVersions = array_filter( $supportedMongoDBVersions, // requireApiVersion supports MongoDB 5.0+ fn (string $version): bool => in_array($version, ['latest', 'rapid']) || version_compare($version, '5.0', '>='), ); -$skipCryptSharedServerVersions = array_filter( +$csfleServerVersions = array_filter( $supportedMongoDBVersions, - // crypt_shared is available starting with MongoDB 6.0 - fn (string $version): bool => in_array($version, ['latest', 'rapid']) || version_compare($version, '6.0', '>='), + // Test CSFLE on MongoDB 4.2+ + fn (string $version): bool => in_array($version, ['latest', 'rapid']) || version_compare($version, '4.2', '>='), ); $allFiles = []; @@ -44,8 +39,7 @@ $allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-local.yml', 'local-%s', $localServerVersions); $allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-load-balanced.yml', 'load-balanced-%s', $loadBalancedServerVersions); $allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-require-api-version.yml', 'require-api-version-%s', $requireApiServerVersions); -//$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-ocsp.yml', 'ocsp-%s', $ocspServerVersions); -//$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-skip-crypt-shared.yml', 'skip-crypt-shared-%s', $skipCryptSharedServerVersions); +$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-csfle.yml', 'csfle-%s', $csfleServerVersions); echo "Generated config. Use the following list to import files:\n"; echo implode("\n", array_map('getImportConfig', array_merge(...$allFiles))) . "\n"; diff --git a/.evergreen/config/legacy-tasks.yml b/.evergreen/config/legacy-tasks.yml index f9cf7f12f..c5929ce42 100644 --- a/.evergreen/config/legacy-tasks.yml +++ b/.evergreen/config/legacy-tasks.yml @@ -3,38 +3,3 @@ tasks: commands: - func: "bootstrap mongohoused" - func: "run atlas data lake test" - - - name: "test-csfle-crypt_shared" - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "replica_set" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - vars: - TESTS: "csfle" - - - name: "test-csfle-mongocryptd" - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "replica_set" - SKIP_CRYPT_SHARED: "yes" - - func: "start kms servers" - - func: "set aws temp creds" - - func: "run tests" - vars: - TESTS: "csfle" - - - name: "test-without_aws_creds" - commands: - - func: "bootstrap mongo-orchestration" - vars: - TOPOLOGY: "replica_set" - - func: "start kms servers" - - func: "run tests" - vars: - client_side_encryption_aws_access_key_id: "" - client_side_encryption_aws_secret_access_key: "" - TESTS: "csfle-without-aws-creds" diff --git a/.evergreen/config/legacy-variants.yml b/.evergreen/config/legacy-variants.yml index 324ca4c0a..c16bbf732 100644 --- a/.evergreen/config/legacy-variants.yml +++ b/.evergreen/config/legacy-variants.yml @@ -103,34 +103,3 @@ buildvariants: VARIANT: debian11 # Referenced by ADL build script for downloading MQLRun tasks: - name: "test-atlas-data-lake" - - # CSFLE tests (crypt_shared and mongocryptd) are tested on RHEL 8 as it's the only version that supports - # 4.2 AND 6.0 (which is required for crypt_shared), as well as a somewhat relevant PHP version. - # Newer MongoDB version may require adding different operating systems here - - matrix_name: "test-csfle-crypt_shared" - matrix_spec: { "os": "rhel80", "mongodb-versions": "*", "php-versions": "8.0", "driver-versions": "latest-stable" } - display_name: "CSFLE crypt_shared - ${mongodb-versions}" - exclude_spec: - # MongoDB < 4.2 does not need to be tested. - - { "os": "rhel80", "mongodb-versions": ["3.6", "4.0"], "php-versions": "8.0", "driver-versions": "latest-stable" } - tasks: - - name: "test-csfle-crypt_shared" - - matrix_name: "test-csfle-mongocryptd" - matrix_spec: { "os": "rhel80", "mongodb-versions": "*", "php-versions": "8.0", "driver-versions": "latest-stable" } - display_name: "CSFLE mongocryptd - ${mongodb-versions}" - exclude_spec: - # MongoDB < 4.2 does not need to be tested. - - { "os": "rhel80", "mongodb-versions": ["3.6", "4.0"], "php-versions": "8.0", "driver-versions": "latest-stable" } - tasks: - - name: "test-csfle-mongocryptd" - - # Run CSFLE tests without AWS credentials (for "On-demand AWS Credentials" prose test) - - matrix_name: "test-csfle-without_aws_creds" - matrix_spec: { "os": ["debian92", "debian11"], "mongodb-versions": "*", "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "CSFLE without_aws_creds - ${mongodb-versions}" - exclude_spec: - # CSFLE is available from MongoDB 4.2+ and Debian 9.2 only supports up to MongoDB 5.0 - - { "os": "debian92", "mongodb-versions": ["3.6", "4.0", "6.0", "rapid", "latest"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - - { "os": "debian11", "mongodb-versions": ["3.6", "4.0", "4.2", "4.4", "5.0"], "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - tasks: - - name: "test-without_aws_creds" diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index 98536ccbd..696877166 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -16,7 +16,7 @@ buildvariants: name: "build-php-8.2" tasks: - ".standalone .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - - ".replicaset .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" + - ".replicaset .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".sharded .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".serverless" - name: test-debian92-php82-local @@ -33,7 +33,7 @@ buildvariants: tasks: # Remember to add new major versions here as they are released - ".standalone .local !.6.0 !.7.0 !.rapid !.latest" - - ".replicaset .local !.6.0 !.7.0 !.rapid !.latest" + - ".replicaset .local !.csfle !.6.0 !.7.0 !.rapid !.latest" - ".sharded .local !.6.0 !.7.0 !.rapid !.latest" # Test remaining PHP versions with replica sets on Debian 11 with MongoDB 7.0 @@ -49,7 +49,7 @@ buildvariants: - variant: "build-debian11" name: "build-php-8.1" tasks: - - ".replicaset .local .7.0" + - ".replicaset .local .7.0 !.csfle" - name: test-debian11-php80-local tags: ["test", "debian", "x64"] display_name: "Test: Debian 11, PHP 8.0" @@ -62,7 +62,7 @@ buildvariants: - variant: "build-debian11" name: "build-php-8.0" tasks: - - ".replicaset .local .7.0" + - ".replicaset .local .7.0 !.csfle" - name: test-debian11-php74-local tags: ["test", "debian", "x64"] display_name: "Test: Debian 11, PHP 7.4" @@ -75,7 +75,7 @@ buildvariants: - variant: "build-debian11" name: "build-php-7.4" tasks: - - ".replicaset .local .7.0" + - ".replicaset .local .7.0 !.csfle" # Test Atlas Tests on RHEL 8 - name: test-rhel80-php82-atlas @@ -90,4 +90,5 @@ buildvariants: - variant: "build-rhel80" name: "build-php-8.2" tasks: - - test_atlas_task_group + - "test_atlas_task_group" + - ".csfle" diff --git a/.evergreen/config/test/_template-csfle.yml b/.evergreen/config/test/_template-csfle.yml new file mode 100644 index 000000000..871266b4a --- /dev/null +++ b/.evergreen/config/test/_template-csfle.yml @@ -0,0 +1,41 @@ +tasks: + - name: "test-mongodb-%mongodbVersion%-crypt-shared" + tags: ["replicaset", "local", "%mongodbVersion%", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "%mongodbVersion%" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-%mongodbVersion%-mongocryptd" + tags: ["replicaset", "local", "%mongodbVersion%", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + SKIP_CRYPT_SHARED: "yes" + MONGODB_VERSION: "%mongodbVersion%" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-%mongodbVersion%-replicaset-no-aws-creds" + tags: ["replicaset", "local", "%mongodbVersion%"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "%mongodbVersion%" + - func: "start kms servers" + - func: "run tests" + vars: + client_side_encryption_aws_access_key_id: "" + client_side_encryption_aws_secret_access_key: "" + TESTS: "csfle-without-aws-creds" diff --git a/.evergreen/config/test/csfle-4.2.yml b/.evergreen/config/test/csfle-4.2.yml new file mode 100644 index 000000000..a699a294e --- /dev/null +++ b/.evergreen/config/test/csfle-4.2.yml @@ -0,0 +1,42 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-4.2-crypt-shared" + tags: ["replicaset", "local", "4.2", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "4.2" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-4.2-mongocryptd" + tags: ["replicaset", "local", "4.2", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + SKIP_CRYPT_SHARED: "yes" + MONGODB_VERSION: "4.2" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-4.2-replicaset-no-aws-creds" + tags: ["replicaset", "local", "4.2"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "4.2" + - func: "start kms servers" + - func: "run tests" + vars: + client_side_encryption_aws_access_key_id: "" + client_side_encryption_aws_secret_access_key: "" + TESTS: "csfle-without-aws-creds" diff --git a/.evergreen/config/test/csfle-4.4.yml b/.evergreen/config/test/csfle-4.4.yml new file mode 100644 index 000000000..f2591b9c9 --- /dev/null +++ b/.evergreen/config/test/csfle-4.4.yml @@ -0,0 +1,42 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-4.4-crypt-shared" + tags: ["replicaset", "local", "4.4", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "4.4" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-4.4-mongocryptd" + tags: ["replicaset", "local", "4.4", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + SKIP_CRYPT_SHARED: "yes" + MONGODB_VERSION: "4.4" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-4.4-replicaset-no-aws-creds" + tags: ["replicaset", "local", "4.4"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "4.4" + - func: "start kms servers" + - func: "run tests" + vars: + client_side_encryption_aws_access_key_id: "" + client_side_encryption_aws_secret_access_key: "" + TESTS: "csfle-without-aws-creds" diff --git a/.evergreen/config/test/csfle-5.0.yml b/.evergreen/config/test/csfle-5.0.yml new file mode 100644 index 000000000..948473855 --- /dev/null +++ b/.evergreen/config/test/csfle-5.0.yml @@ -0,0 +1,42 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-5.0-crypt-shared" + tags: ["replicaset", "local", "5.0", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "5.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-5.0-mongocryptd" + tags: ["replicaset", "local", "5.0", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + SKIP_CRYPT_SHARED: "yes" + MONGODB_VERSION: "5.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-5.0-replicaset-no-aws-creds" + tags: ["replicaset", "local", "5.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "5.0" + - func: "start kms servers" + - func: "run tests" + vars: + client_side_encryption_aws_access_key_id: "" + client_side_encryption_aws_secret_access_key: "" + TESTS: "csfle-without-aws-creds" diff --git a/.evergreen/config/test/csfle-6.0.yml b/.evergreen/config/test/csfle-6.0.yml new file mode 100644 index 000000000..3ce696c6f --- /dev/null +++ b/.evergreen/config/test/csfle-6.0.yml @@ -0,0 +1,42 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-6.0-crypt-shared" + tags: ["replicaset", "local", "6.0", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "6.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-6.0-mongocryptd" + tags: ["replicaset", "local", "6.0", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + SKIP_CRYPT_SHARED: "yes" + MONGODB_VERSION: "6.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-6.0-replicaset-no-aws-creds" + tags: ["replicaset", "local", "6.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "6.0" + - func: "start kms servers" + - func: "run tests" + vars: + client_side_encryption_aws_access_key_id: "" + client_side_encryption_aws_secret_access_key: "" + TESTS: "csfle-without-aws-creds" diff --git a/.evergreen/config/test/csfle-7.0.yml b/.evergreen/config/test/csfle-7.0.yml new file mode 100644 index 000000000..5e5e99b72 --- /dev/null +++ b/.evergreen/config/test/csfle-7.0.yml @@ -0,0 +1,42 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-7.0-crypt-shared" + tags: ["replicaset", "local", "7.0", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "7.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-7.0-mongocryptd" + tags: ["replicaset", "local", "7.0", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + SKIP_CRYPT_SHARED: "yes" + MONGODB_VERSION: "7.0" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-7.0-replicaset-no-aws-creds" + tags: ["replicaset", "local", "7.0"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "7.0" + - func: "start kms servers" + - func: "run tests" + vars: + client_side_encryption_aws_access_key_id: "" + client_side_encryption_aws_secret_access_key: "" + TESTS: "csfle-without-aws-creds" diff --git a/.evergreen/config/test/csfle-latest.yml b/.evergreen/config/test/csfle-latest.yml new file mode 100644 index 000000000..74ab53bf7 --- /dev/null +++ b/.evergreen/config/test/csfle-latest.yml @@ -0,0 +1,42 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-latest-crypt-shared" + tags: ["replicaset", "local", "latest", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "latest" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-latest-mongocryptd" + tags: ["replicaset", "local", "latest", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + SKIP_CRYPT_SHARED: "yes" + MONGODB_VERSION: "latest" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-latest-replicaset-no-aws-creds" + tags: ["replicaset", "local", "latest"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "latest" + - func: "start kms servers" + - func: "run tests" + vars: + client_side_encryption_aws_access_key_id: "" + client_side_encryption_aws_secret_access_key: "" + TESTS: "csfle-without-aws-creds" diff --git a/.evergreen/config/test/csfle-rapid.yml b/.evergreen/config/test/csfle-rapid.yml new file mode 100644 index 000000000..1a62a138d --- /dev/null +++ b/.evergreen/config/test/csfle-rapid.yml @@ -0,0 +1,42 @@ +# This file is generated automatically - please edit the corresponding template file! +tasks: + - name: "test-mongodb-rapid-crypt-shared" + tags: ["replicaset", "local", "rapid", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "rapid" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-rapid-mongocryptd" + tags: ["replicaset", "local", "rapid", "csfle"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + SKIP_CRYPT_SHARED: "yes" + MONGODB_VERSION: "rapid" + - func: "start kms servers" + - func: "set aws temp creds" + - func: "run tests" + vars: + TESTS: "csfle" + + - name: "test-mongodb-rapid-replicaset-no-aws-creds" + tags: ["replicaset", "local", "rapid"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + TOPOLOGY: "replica_set" + MONGODB_VERSION: "rapid" + - func: "start kms servers" + - func: "run tests" + vars: + client_side_encryption_aws_access_key_id: "" + client_side_encryption_aws_secret_access_key: "" + TESTS: "csfle-without-aws-creds" From 7b50a9495b57e6f895de3b9a8c86e18b4fa79a39 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 10:06:35 +0200 Subject: [PATCH 17/28] Move ADL tests to new format --- .evergreen/config/legacy-tasks.yml | 5 ----- .evergreen/config/legacy-variants.yml | 9 --------- .evergreen/config/test-tasks.yml | 5 +++++ .evergreen/config/test-variants.yml | 2 ++ 4 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 .evergreen/config/legacy-tasks.yml diff --git a/.evergreen/config/legacy-tasks.yml b/.evergreen/config/legacy-tasks.yml deleted file mode 100644 index c5929ce42..000000000 --- a/.evergreen/config/legacy-tasks.yml +++ /dev/null @@ -1,5 +0,0 @@ -tasks: - - name: "test-atlas-data-lake" - commands: - - func: "bootstrap mongohoused" - - func: "run atlas data lake test" diff --git a/.evergreen/config/legacy-variants.yml b/.evergreen/config/legacy-variants.yml index c16bbf732..f0232a3cf 100644 --- a/.evergreen/config/legacy-variants.yml +++ b/.evergreen/config/legacy-variants.yml @@ -94,12 +94,3 @@ buildvariants: - name: "test-standalone" - name: "test-replica_set" - name: "test-sharded_cluster" - - - matrix_name: "atlas-data-lake-test" - matrix_spec: { "php-edge-versions": "latest-stable", "driver-versions": "latest-stable" } - display_name: "Atlas Data Lake" - run_on: debian11 - expansions: - VARIANT: debian11 # Referenced by ADL build script for downloading MQLRun - tasks: - - name: "test-atlas-data-lake" diff --git a/.evergreen/config/test-tasks.yml b/.evergreen/config/test-tasks.yml index 64cf40423..b708ec9cf 100644 --- a/.evergreen/config/test-tasks.yml +++ b/.evergreen/config/test-tasks.yml @@ -13,3 +13,8 @@ tasks: - func: "start kms servers" - func: "set aws temp creds" - func: "run serverless tests" + + - name: "test-atlas-data-lake" + commands: + - func: "bootstrap mongohoused" + - func: "run atlas data lake test" diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index 696877166..2b65c79c9 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -11,6 +11,7 @@ buildvariants: FETCH_BUILD_VARIANT: "build-debian11" FETCH_BUILD_TASK: "build-php-8.2" PHP_VERSION: "8.2" + VARIANT: debian11 # Referenced by ADL build script for downloading MQLRun depends_on: - variant: "build-debian11" name: "build-php-8.2" @@ -19,6 +20,7 @@ buildvariants: - ".replicaset .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".sharded .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".serverless" + - "test-atlas-data-lake" - name: test-debian92-php82-local tags: ["test", "debian", "x64"] display_name: "Test: Debian 9.2, PHP 8.2" From 7c828d2b565b64e3cd2c9a90e09873848c54b294 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 10:19:18 +0200 Subject: [PATCH 18/28] Move lowest dependency tests to new format --- .../build/_template-build-extension.yml | 34 ++++++- .evergreen/config/build/build-php-7.4.yml | 32 +++++++ .evergreen/config/build/build-php-8.0.yml | 32 +++++++ .evergreen/config/build/build-php-8.1.yml | 32 +++++++ .evergreen/config/build/build-php-8.2.yml | 32 +++++++ .evergreen/config/legacy-variants.yml | 96 ------------------- .evergreen/config/test-variants.yml | 20 +++- 7 files changed, 180 insertions(+), 98 deletions(-) delete mode 100644 .evergreen/config/legacy-variants.yml diff --git a/.evergreen/config/build/_template-build-extension.yml b/.evergreen/config/build/_template-build-extension.yml index 79ef239d1..9785cfa57 100644 --- a/.evergreen/config/build/_template-build-extension.yml +++ b/.evergreen/config/build/_template-build-extension.yml @@ -1,11 +1,43 @@ tasks: - name: "build-php-%phpVersion%" - tags: ["build", "php%phpVersion%"] + tags: ["build", "php%phpVersion%", "stable"] commands: - func: "locate PHP binaries" vars: PHP_VERSION: "%phpVersion%" - func: "compile extension" + # TODO: Remove this variable once PHPC 1.17.0 is released vars: EXTENSION_BRANCH: "master" - func: "upload extension" +# TODO: Re-enable these tasks once PHPC 1.17.0 is released +# - name: "build-php-%phpVersion%-lowest" +# tags: ["build", "php%phpVersion%", "lowest"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "%phpVersion%" +# - func: "compile extension" +# vars: +# EXTENSION_VERSION: "1.17.0" +# - func: "upload extension" +# - name: "build-php-%phpVersion%-next-stable" +# tags: ["build", "php%phpVersion%", "next-stable"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "%phpVersion%" +# - func: "compile extension" +# vars: +# EXTENSION_BRANCH: "v1.17" +# - 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" diff --git a/.evergreen/config/build/build-php-7.4.yml b/.evergreen/config/build/build-php-7.4.yml index adca65475..117327f96 100644 --- a/.evergreen/config/build/build-php-7.4.yml +++ b/.evergreen/config/build/build-php-7.4.yml @@ -7,6 +7,38 @@ tasks: vars: PHP_VERSION: "7.4" - func: "compile extension" + # TODO: Remove this variable once PHPC 1.17.0 is released vars: EXTENSION_BRANCH: "master" - func: "upload extension" +# TODO: Re-enable these tasks once PHPC 1.17.0 is released +# - name: "build-php-7.4-lowest" +# tags: ["build", "php7.4", "lowest"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "7.4" +# - func: "compile extension" +# vars: +# EXTENSION_VERSION: "1.17.0" +# - func: "upload extension" +# - name: "build-php-7.4-next-stable" +# tags: ["build", "php7.4", "next-stable"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "7.4" +# - func: "compile extension" +# vars: +# EXTENSION_BRANCH: "v1.17" +# - func: "upload extension" +# - name: "build-php-7.4-next-minor" +# tags: ["build", "php7.4", "next-minor"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "7.4" +# - func: "compile extension" +# vars: +# EXTENSION_BRANCH: "master" +# - func: "upload extension" diff --git a/.evergreen/config/build/build-php-8.0.yml b/.evergreen/config/build/build-php-8.0.yml index c2d7fe129..fdd7bcfc2 100644 --- a/.evergreen/config/build/build-php-8.0.yml +++ b/.evergreen/config/build/build-php-8.0.yml @@ -7,6 +7,38 @@ tasks: vars: PHP_VERSION: "8.0" - func: "compile extension" + # TODO: Remove this variable once PHPC 1.17.0 is released vars: EXTENSION_BRANCH: "master" - func: "upload extension" +# TODO: Re-enable these tasks once PHPC 1.17.0 is released +# - name: "build-php-8.0-lowest" +# tags: ["build", "php8.0", "lowest"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "8.0" +# - func: "compile extension" +# vars: +# EXTENSION_VERSION: "1.17.0" +# - func: "upload extension" +# - name: "build-php-8.0-next-stable" +# tags: ["build", "php8.0", "next-stable"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "8.0" +# - func: "compile extension" +# vars: +# EXTENSION_BRANCH: "v1.17" +# - func: "upload extension" +# - name: "build-php-8.0-next-minor" +# tags: ["build", "php8.0", "next-minor"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "8.0" +# - func: "compile extension" +# vars: +# EXTENSION_BRANCH: "master" +# - func: "upload extension" diff --git a/.evergreen/config/build/build-php-8.1.yml b/.evergreen/config/build/build-php-8.1.yml index fba3ec8f0..8eb8712b8 100644 --- a/.evergreen/config/build/build-php-8.1.yml +++ b/.evergreen/config/build/build-php-8.1.yml @@ -7,6 +7,38 @@ tasks: vars: PHP_VERSION: "8.1" - func: "compile extension" + # TODO: Remove this variable once PHPC 1.17.0 is released vars: EXTENSION_BRANCH: "master" - func: "upload extension" +# TODO: Re-enable these tasks once PHPC 1.17.0 is released +# - name: "build-php-8.1-lowest" +# tags: ["build", "php8.1", "lowest"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "8.1" +# - func: "compile extension" +# vars: +# EXTENSION_VERSION: "1.17.0" +# - func: "upload extension" +# - name: "build-php-8.1-next-stable" +# tags: ["build", "php8.1", "next-stable"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "8.1" +# - func: "compile extension" +# vars: +# EXTENSION_BRANCH: "v1.17" +# - 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" diff --git a/.evergreen/config/build/build-php-8.2.yml b/.evergreen/config/build/build-php-8.2.yml index 4d7acef8f..ce7fa64a5 100644 --- a/.evergreen/config/build/build-php-8.2.yml +++ b/.evergreen/config/build/build-php-8.2.yml @@ -7,6 +7,38 @@ tasks: vars: PHP_VERSION: "8.2" - func: "compile extension" + # TODO: Remove this variable once PHPC 1.17.0 is released vars: EXTENSION_BRANCH: "master" - func: "upload extension" +# TODO: Re-enable these tasks once PHPC 1.17.0 is released +# - name: "build-php-8.2-lowest" +# tags: ["build", "php8.2", "lowest"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "8.2" +# - func: "compile extension" +# vars: +# EXTENSION_VERSION: "1.17.0" +# - func: "upload extension" +# - name: "build-php-8.2-next-stable" +# tags: ["build", "php8.2", "next-stable"] +# commands: +# - func: "locate PHP binaries" +# vars: +# PHP_VERSION: "8.2" +# - func: "compile extension" +# vars: +# EXTENSION_BRANCH: "v1.17" +# - 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" diff --git a/.evergreen/config/legacy-variants.yml b/.evergreen/config/legacy-variants.yml deleted file mode 100644 index f0232a3cf..000000000 --- a/.evergreen/config/legacy-variants.yml +++ /dev/null @@ -1,96 +0,0 @@ -axes: - # Note: install-dependencies.sh will search for the latest minor version - # matching the PHP_VERSION constant - - id: php-versions - display_name: PHP Version - values: - - id: "8.2" - display_name: "PHP 8.2" - variables: - PHP_VERSION: "8.2" - - id: "8.1" - display_name: "PHP 8.1" - variables: - PHP_VERSION: "8.1" - - id: "8.0" - display_name: "PHP 8.0" - variables: - PHP_VERSION: "8.0" - - id: "7.4" - display_name: "PHP 7.4" - variables: - PHP_VERSION: "7.4" - - - id: mongodb-versions - display_name: MongoDB Version - values: - - id: "latest" - display_name: "MongoDB latest" - variables: - MONGODB_VERSION: "latest" - - id: "rapid" - display_name: "MongoDB rapid" - variables: - MONGODB_VERSION: "rapid" - - id: "7.0" - display_name: "MongoDB 7.0" - variables: - MONGODB_VERSION: "7.0" - - id: "6.0" - display_name: "MongoDB 6.0" - variables: - MONGODB_VERSION: "6.0" - - id: "5.0" - display_name: "MongoDB 5.0" - variables: - MONGODB_VERSION: "5.0" - - id: "4.4" - display_name: "MongoDB 4.4" - variables: - MONGODB_VERSION: "4.4" - - id: "4.2" - display_name: "MongoDB 4.2" - variables: - MONGODB_VERSION: "4.2" - - id: "4.0" - display_name: "MongoDB 4.0" - variables: - MONGODB_VERSION: "4.0" - - id: "3.6" - display_name: "MongoDB 3.6" - variables: - MONGODB_VERSION: "3.6" - - - id: driver-versions - display_name: Driver Version - values: - - id: "oldest-supported" - display_name: "PHPC 1.17.0" - variables: - EXTENSION_BRANCH: "master" - - id: "latest-stable" - display_name: "PHPC (1.17.x)" - variables: - EXTENSION_BRANCH: "master" - - id: "latest-dev" - display_name: "PHPC (1.17-dev)" - variables: - EXTENSION_BRANCH: "master" - - - id: dependencies - display_name: Dependencies - values: - - id: lowest - display_name: Lowest - variables: - DEPENDENCIES: "lowest" - -buildvariants: - # Test oldest-supported PHP, MongoDB, and driver versions with lowest dependencies on Debian - - matrix_name: "test-oldest-supported" - matrix_spec: { "os": "debian92", "mongodb-edge-versions": "oldest-supported", "php-edge-versions": "oldest-supported", "driver-versions": "oldest-supported", "dependencies": "lowest" } - display_name: "Lowest Dependencies: ${os}, ${mongodb-edge-versions}, ${php-edge-versions}, ${driver-versions}" - tasks: - - name: "test-standalone" - - name: "test-replica_set" - - name: "test-sharded_cluster" diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index 2b65c79c9..0b19ffa60 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -79,7 +79,25 @@ buildvariants: tasks: - ".replicaset .local .7.0 !.csfle" - # Test Atlas Tests on RHEL 8 + # Test with lowest PHP, PHPC, MongoDB, and dependency versions + - name: test-debian92-php74-local-lowest + tags: ["test", "debian", "x64"] + display_name: "Test: Debian 9.2, PHP 7.4, Lowest Dependencies" + run_on: debian92-small + expansions: + FETCH_BUILD_VARIANT: "build-debian92" + # TODO: Change to build-php-7.4-lowest once PHPC 1.17.0 is released + FETCH_BUILD_TASK: "build-php-7.4" + PHP_VERSION: "7.4" + DEPENDENCIES: "lowest" + depends_on: + - variant: "build-debian92" + # TODO: Change to build-php-7.4-lowest once PHPC 1.17.0 is released + name: "build-php-7.4" + tasks: + - ".replicaset .local .3.6 !.csfle" + + # Test Atlas and CSFLE on RHEL 8 - name: test-rhel80-php82-atlas tags: ["test", "debian", "x64"] display_name: "Test: RHEL 8.0, PHP 8.2" From 39d1f174d9fa99438ed3403344818cbfd8c90c83 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 10:22:56 +0200 Subject: [PATCH 19/28] Define aliases for PR builds --- .evergreen/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 66beda22c..071635949 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -33,6 +33,12 @@ post: &test_teardown - func: "stop mongo-orchestration" - func: "cleanup" +# Define aliases for patch builds and PR builds. These only apply if no aliases are defined in project settings +github_pr_aliases: + # Run tests on debian, only testing local replicasets + - variant: "test-.*" + task: "test-mongodb-.*-replicaset" + # Include files that contain various tasks, task groups, and build variant definitions include: - filename: .evergreen/config/functions.yml From e213255cfb0a68190b9f06fb592579934bf8a110 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 28 Sep 2023 10:26:56 +0200 Subject: [PATCH 20/28] Prevent generated build files from showing diffs in pull requests --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitattributes b/.gitattributes index 370c9e0d7..e6785c9c1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,3 +14,9 @@ phpunit.evergreen.xml export-ignore phpunit.xml.dist export-ignore psalm.xml.dist export-ignore psalm-baseline.xml export-ignore + +# Prevent generated build files from showing diffs in pull requests +.evergreen/config/build/*.yml linguist-generated=true +.evergreen/config/build/_template*.yml linguist-generated=false +.evergreen/config/test/*.yml linguist-generated=true +.evergreen/config/test/_template*.yml linguist-generated=false From 310ed92acc1654eed061753c8ef83348b556ccb3 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 13 Oct 2023 10:42:10 +0200 Subject: [PATCH 21/28] Apply recent changes from PHPC config This moves templates and generated files to separate folders and changes the loadbalanced tests to use its own topology instead of "sharded". --- .evergreen/config.yml | 67 +++++++++---------- .evergreen/config/generate-config.php | 39 +++++++---- .../{ => generated}/build/build-php-7.4.yml | 4 +- .../{ => generated}/build/build-php-8.0.yml | 4 +- .../{ => generated}/build/build-php-8.1.yml | 4 +- .../{ => generated}/build/build-php-8.2.yml | 4 +- .../config/{ => generated}/test/csfle-4.2.yml | 2 +- .../config/{ => generated}/test/csfle-4.4.yml | 2 +- .../config/{ => generated}/test/csfle-5.0.yml | 2 +- .../config/{ => generated}/test/csfle-6.0.yml | 2 +- .../config/{ => generated}/test/csfle-7.0.yml | 2 +- .../{ => generated}/test/csfle-latest.yml | 2 +- .../{ => generated}/test/csfle-rapid.yml | 2 +- .../test/load-balanced-5.0.yml | 4 +- .../test/load-balanced-6.0.yml | 4 +- .../test/load-balanced-7.0.yml | 4 +- .../test/load-balanced-latest.yml | 4 +- .../test/load-balanced-rapid.yml | 4 +- .../config/{ => generated}/test/local-3.6.yml | 2 +- .../config/{ => generated}/test/local-4.0.yml | 2 +- .../config/{ => generated}/test/local-4.2.yml | 2 +- .../config/{ => generated}/test/local-4.4.yml | 2 +- .../config/{ => generated}/test/local-5.0.yml | 2 +- .../config/{ => generated}/test/local-6.0.yml | 2 +- .../config/{ => generated}/test/local-7.0.yml | 2 +- .../{ => generated}/test/local-latest.yml | 2 +- .../{ => generated}/test/local-rapid.yml | 2 +- .../test/require-api-version-5.0.yml | 2 +- .../test/require-api-version-6.0.yml | 2 +- .../test/require-api-version-7.0.yml | 2 +- .../test/require-api-version-latest.yml | 2 +- .../test/require-api-version-rapid.yml | 2 +- .../build/build-extension.yml} | 0 .../test/csfle.yml} | 0 .../test/load-balanced.yml} | 2 +- .../test/local.yml} | 0 .../test/require-api-version.yml} | 0 .evergreen/config/test-variants.yml | 2 + .gitattributes | 5 +- 39 files changed, 102 insertions(+), 91 deletions(-) rename .evergreen/config/{ => generated}/build/build-php-7.4.yml (88%) rename .evergreen/config/{ => generated}/build/build-php-8.0.yml (88%) rename .evergreen/config/{ => generated}/build/build-php-8.1.yml (88%) rename .evergreen/config/{ => generated}/build/build-php-8.2.yml (88%) rename .evergreen/config/{ => generated}/test/csfle-4.2.yml (92%) rename .evergreen/config/{ => generated}/test/csfle-4.4.yml (92%) rename .evergreen/config/{ => generated}/test/csfle-5.0.yml (92%) rename .evergreen/config/{ => generated}/test/csfle-6.0.yml (92%) rename .evergreen/config/{ => generated}/test/csfle-7.0.yml (92%) rename .evergreen/config/{ => generated}/test/csfle-latest.yml (92%) rename .evergreen/config/{ => generated}/test/csfle-rapid.yml (92%) rename .evergreen/config/{ => generated}/test/load-balanced-5.0.yml (74%) rename .evergreen/config/{ => generated}/test/load-balanced-6.0.yml (74%) rename .evergreen/config/{ => generated}/test/load-balanced-7.0.yml (74%) rename .evergreen/config/{ => generated}/test/load-balanced-latest.yml (74%) rename .evergreen/config/{ => generated}/test/load-balanced-rapid.yml (74%) rename .evergreen/config/{ => generated}/test/local-3.6.yml (90%) rename .evergreen/config/{ => generated}/test/local-4.0.yml (90%) rename .evergreen/config/{ => generated}/test/local-4.2.yml (90%) rename .evergreen/config/{ => generated}/test/local-4.4.yml (90%) rename .evergreen/config/{ => generated}/test/local-5.0.yml (90%) rename .evergreen/config/{ => generated}/test/local-6.0.yml (90%) rename .evergreen/config/{ => generated}/test/local-7.0.yml (90%) rename .evergreen/config/{ => generated}/test/local-latest.yml (90%) rename .evergreen/config/{ => generated}/test/local-rapid.yml (90%) rename .evergreen/config/{ => generated}/test/require-api-version-5.0.yml (87%) rename .evergreen/config/{ => generated}/test/require-api-version-6.0.yml (87%) rename .evergreen/config/{ => generated}/test/require-api-version-7.0.yml (87%) rename .evergreen/config/{ => generated}/test/require-api-version-latest.yml (88%) rename .evergreen/config/{ => generated}/test/require-api-version-rapid.yml (87%) rename .evergreen/config/{build/_template-build-extension.yml => templates/build/build-extension.yml} (100%) rename .evergreen/config/{test/_template-csfle.yml => templates/test/csfle.yml} (100%) rename .evergreen/config/{test/_template-load-balanced.yml => templates/test/load-balanced.yml} (87%) rename .evergreen/config/{test/_template-local.yml => templates/test/local.yml} (100%) rename .evergreen/config/{test/_template-require-api-version.yml => templates/test/require-api-version.yml} (100%) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 071635949..56cee44ec 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -9,10 +9,9 @@ command_type: system # Fail builds when pre tasks fail. pre_error_fails_task: true -# Protect ourselves against rogue test case that runs forever -# Good rule of thumb: the average length a task takes, times 5, which roughly accounts for variable system performance -# for various build variants -exec_timeout_secs: 1800 +# Protect ourselves against rogue test case that runs forever. Tasks are killed after 10 minutes, which shouldn't occur +# under normal circumstances. +exec_timeout_secs: 600 # These pre and post rules apply to all tasks not part of a task group, which should only ever be tests against local # MongoDB instances. All other tasks that require special preparation should be run from within a task group @@ -51,33 +50,33 @@ include: - filename: .evergreen/config/test-variants.yml # Automatically generated files - - filename: .evergreen/config/build/build-php-8.2.yml - - filename: .evergreen/config/build/build-php-8.1.yml - - filename: .evergreen/config/build/build-php-8.0.yml - - filename: .evergreen/config/build/build-php-7.4.yml - - filename: .evergreen/config/test/local-latest.yml - - filename: .evergreen/config/test/local-rapid.yml - - filename: .evergreen/config/test/local-7.0.yml - - filename: .evergreen/config/test/local-6.0.yml - - filename: .evergreen/config/test/local-5.0.yml - - filename: .evergreen/config/test/local-4.4.yml - - filename: .evergreen/config/test/local-4.2.yml - - filename: .evergreen/config/test/local-4.0.yml - - filename: .evergreen/config/test/local-3.6.yml - - filename: .evergreen/config/test/load-balanced-latest.yml - - filename: .evergreen/config/test/load-balanced-rapid.yml - - filename: .evergreen/config/test/load-balanced-7.0.yml - - filename: .evergreen/config/test/load-balanced-6.0.yml - - filename: .evergreen/config/test/load-balanced-5.0.yml - - filename: .evergreen/config/test/require-api-version-latest.yml - - filename: .evergreen/config/test/require-api-version-rapid.yml - - filename: .evergreen/config/test/require-api-version-7.0.yml - - filename: .evergreen/config/test/require-api-version-6.0.yml - - filename: .evergreen/config/test/require-api-version-5.0.yml - - filename: .evergreen/config/test/csfle-latest.yml - - filename: .evergreen/config/test/csfle-rapid.yml - - filename: .evergreen/config/test/csfle-7.0.yml - - filename: .evergreen/config/test/csfle-6.0.yml - - filename: .evergreen/config/test/csfle-5.0.yml - - filename: .evergreen/config/test/csfle-4.4.yml - - filename: .evergreen/config/test/csfle-4.2.yml + - filename: .evergreen/config/generated/build/build-php-8.2.yml + - filename: .evergreen/config/generated/build/build-php-8.1.yml + - filename: .evergreen/config/generated/build/build-php-8.0.yml + - filename: .evergreen/config/generated/build/build-php-7.4.yml + - filename: .evergreen/config/generated/test/local-latest.yml + - filename: .evergreen/config/generated/test/local-rapid.yml + - filename: .evergreen/config/generated/test/local-7.0.yml + - filename: .evergreen/config/generated/test/local-6.0.yml + - filename: .evergreen/config/generated/test/local-5.0.yml + - filename: .evergreen/config/generated/test/local-4.4.yml + - filename: .evergreen/config/generated/test/local-4.2.yml + - filename: .evergreen/config/generated/test/local-4.0.yml + - filename: .evergreen/config/generated/test/local-3.6.yml + - filename: .evergreen/config/generated/test/load-balanced-latest.yml + - filename: .evergreen/config/generated/test/load-balanced-rapid.yml + - filename: .evergreen/config/generated/test/load-balanced-7.0.yml + - filename: .evergreen/config/generated/test/load-balanced-6.0.yml + - filename: .evergreen/config/generated/test/load-balanced-5.0.yml + - filename: .evergreen/config/generated/test/require-api-version-latest.yml + - filename: .evergreen/config/generated/test/require-api-version-rapid.yml + - filename: .evergreen/config/generated/test/require-api-version-7.0.yml + - filename: .evergreen/config/generated/test/require-api-version-6.0.yml + - filename: .evergreen/config/generated/test/require-api-version-5.0.yml + - filename: .evergreen/config/generated/test/csfle-latest.yml + - filename: .evergreen/config/generated/test/csfle-rapid.yml + - filename: .evergreen/config/generated/test/csfle-7.0.yml + - filename: .evergreen/config/generated/test/csfle-6.0.yml + - filename: .evergreen/config/generated/test/csfle-5.0.yml + - filename: .evergreen/config/generated/test/csfle-4.4.yml + - filename: .evergreen/config/generated/test/csfle-4.2.yml diff --git a/.evergreen/config/generate-config.php b/.evergreen/config/generate-config.php index ca538e4d6..d1a6c866b 100644 --- a/.evergreen/config/generate-config.php +++ b/.evergreen/config/generate-config.php @@ -2,13 +2,23 @@ $version]; @@ -72,4 +86,3 @@ function generateConfigs( return $files; } - diff --git a/.evergreen/config/build/build-php-7.4.yml b/.evergreen/config/generated/build/build-php-7.4.yml similarity index 88% rename from .evergreen/config/build/build-php-7.4.yml rename to .evergreen/config/generated/build/build-php-7.4.yml index 117327f96..c536ec27b 100644 --- a/.evergreen/config/build/build-php-7.4.yml +++ b/.evergreen/config/generated/build/build-php-7.4.yml @@ -1,7 +1,7 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/build/build-extension.yml" template file instead. tasks: - name: "build-php-7.4" - tags: ["build", "php7.4"] + tags: ["build", "php7.4", "stable"] commands: - func: "locate PHP binaries" vars: diff --git a/.evergreen/config/build/build-php-8.0.yml b/.evergreen/config/generated/build/build-php-8.0.yml similarity index 88% rename from .evergreen/config/build/build-php-8.0.yml rename to .evergreen/config/generated/build/build-php-8.0.yml index fdd7bcfc2..c34b722ec 100644 --- a/.evergreen/config/build/build-php-8.0.yml +++ b/.evergreen/config/generated/build/build-php-8.0.yml @@ -1,7 +1,7 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/build/build-extension.yml" template file instead. tasks: - name: "build-php-8.0" - tags: ["build", "php8.0"] + tags: ["build", "php8.0", "stable"] commands: - func: "locate PHP binaries" vars: diff --git a/.evergreen/config/build/build-php-8.1.yml b/.evergreen/config/generated/build/build-php-8.1.yml similarity index 88% rename from .evergreen/config/build/build-php-8.1.yml rename to .evergreen/config/generated/build/build-php-8.1.yml index 8eb8712b8..912f0b5c1 100644 --- a/.evergreen/config/build/build-php-8.1.yml +++ b/.evergreen/config/generated/build/build-php-8.1.yml @@ -1,7 +1,7 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/build/build-extension.yml" template file instead. tasks: - name: "build-php-8.1" - tags: ["build", "php8.1"] + tags: ["build", "php8.1", "stable"] commands: - func: "locate PHP binaries" vars: diff --git a/.evergreen/config/build/build-php-8.2.yml b/.evergreen/config/generated/build/build-php-8.2.yml similarity index 88% rename from .evergreen/config/build/build-php-8.2.yml rename to .evergreen/config/generated/build/build-php-8.2.yml index ce7fa64a5..af7223515 100644 --- a/.evergreen/config/build/build-php-8.2.yml +++ b/.evergreen/config/generated/build/build-php-8.2.yml @@ -1,7 +1,7 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/build/build-extension.yml" template file instead. tasks: - name: "build-php-8.2" - tags: ["build", "php8.2"] + tags: ["build", "php8.2", "stable"] commands: - func: "locate PHP binaries" vars: diff --git a/.evergreen/config/test/csfle-4.2.yml b/.evergreen/config/generated/test/csfle-4.2.yml similarity index 92% rename from .evergreen/config/test/csfle-4.2.yml rename to .evergreen/config/generated/test/csfle-4.2.yml index a699a294e..a310b7fc9 100644 --- a/.evergreen/config/test/csfle-4.2.yml +++ b/.evergreen/config/generated/test/csfle-4.2.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/csfle.yml" template file instead. tasks: - name: "test-mongodb-4.2-crypt-shared" tags: ["replicaset", "local", "4.2", "csfle"] diff --git a/.evergreen/config/test/csfle-4.4.yml b/.evergreen/config/generated/test/csfle-4.4.yml similarity index 92% rename from .evergreen/config/test/csfle-4.4.yml rename to .evergreen/config/generated/test/csfle-4.4.yml index f2591b9c9..291414239 100644 --- a/.evergreen/config/test/csfle-4.4.yml +++ b/.evergreen/config/generated/test/csfle-4.4.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/csfle.yml" template file instead. tasks: - name: "test-mongodb-4.4-crypt-shared" tags: ["replicaset", "local", "4.4", "csfle"] diff --git a/.evergreen/config/test/csfle-5.0.yml b/.evergreen/config/generated/test/csfle-5.0.yml similarity index 92% rename from .evergreen/config/test/csfle-5.0.yml rename to .evergreen/config/generated/test/csfle-5.0.yml index 948473855..ed7bdc6fd 100644 --- a/.evergreen/config/test/csfle-5.0.yml +++ b/.evergreen/config/generated/test/csfle-5.0.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/csfle.yml" template file instead. tasks: - name: "test-mongodb-5.0-crypt-shared" tags: ["replicaset", "local", "5.0", "csfle"] diff --git a/.evergreen/config/test/csfle-6.0.yml b/.evergreen/config/generated/test/csfle-6.0.yml similarity index 92% rename from .evergreen/config/test/csfle-6.0.yml rename to .evergreen/config/generated/test/csfle-6.0.yml index 3ce696c6f..7e8315bb4 100644 --- a/.evergreen/config/test/csfle-6.0.yml +++ b/.evergreen/config/generated/test/csfle-6.0.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/csfle.yml" template file instead. tasks: - name: "test-mongodb-6.0-crypt-shared" tags: ["replicaset", "local", "6.0", "csfle"] diff --git a/.evergreen/config/test/csfle-7.0.yml b/.evergreen/config/generated/test/csfle-7.0.yml similarity index 92% rename from .evergreen/config/test/csfle-7.0.yml rename to .evergreen/config/generated/test/csfle-7.0.yml index 5e5e99b72..f40a9436a 100644 --- a/.evergreen/config/test/csfle-7.0.yml +++ b/.evergreen/config/generated/test/csfle-7.0.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/csfle.yml" template file instead. tasks: - name: "test-mongodb-7.0-crypt-shared" tags: ["replicaset", "local", "7.0", "csfle"] diff --git a/.evergreen/config/test/csfle-latest.yml b/.evergreen/config/generated/test/csfle-latest.yml similarity index 92% rename from .evergreen/config/test/csfle-latest.yml rename to .evergreen/config/generated/test/csfle-latest.yml index 74ab53bf7..2c2110f22 100644 --- a/.evergreen/config/test/csfle-latest.yml +++ b/.evergreen/config/generated/test/csfle-latest.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/csfle.yml" template file instead. tasks: - name: "test-mongodb-latest-crypt-shared" tags: ["replicaset", "local", "latest", "csfle"] diff --git a/.evergreen/config/test/csfle-rapid.yml b/.evergreen/config/generated/test/csfle-rapid.yml similarity index 92% rename from .evergreen/config/test/csfle-rapid.yml rename to .evergreen/config/generated/test/csfle-rapid.yml index 1a62a138d..18656e6c4 100644 --- a/.evergreen/config/test/csfle-rapid.yml +++ b/.evergreen/config/generated/test/csfle-rapid.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/csfle.yml" template file instead. tasks: - name: "test-mongodb-rapid-crypt-shared" tags: ["replicaset", "local", "rapid", "csfle"] diff --git a/.evergreen/config/test/load-balanced-5.0.yml b/.evergreen/config/generated/test/load-balanced-5.0.yml similarity index 74% rename from .evergreen/config/test/load-balanced-5.0.yml rename to .evergreen/config/generated/test/load-balanced-5.0.yml index 689f420f9..298fd1d9b 100644 --- a/.evergreen/config/test/load-balanced-5.0.yml +++ b/.evergreen/config/generated/test/load-balanced-5.0.yml @@ -1,7 +1,7 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/load-balanced.yml" template file instead. tasks: - name: "test-mongodb-5.0-loadbalanced" - tags: ["sharded", "local", "5.0", "loadbalanced"] + tags: ["loadbalanced", "local", "5.0"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/test/load-balanced-6.0.yml b/.evergreen/config/generated/test/load-balanced-6.0.yml similarity index 74% rename from .evergreen/config/test/load-balanced-6.0.yml rename to .evergreen/config/generated/test/load-balanced-6.0.yml index da82ed966..08dc85242 100644 --- a/.evergreen/config/test/load-balanced-6.0.yml +++ b/.evergreen/config/generated/test/load-balanced-6.0.yml @@ -1,7 +1,7 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/load-balanced.yml" template file instead. tasks: - name: "test-mongodb-6.0-loadbalanced" - tags: ["sharded", "local", "6.0", "loadbalanced"] + tags: ["loadbalanced", "local", "6.0"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/test/load-balanced-7.0.yml b/.evergreen/config/generated/test/load-balanced-7.0.yml similarity index 74% rename from .evergreen/config/test/load-balanced-7.0.yml rename to .evergreen/config/generated/test/load-balanced-7.0.yml index 133105038..cfe28ac40 100644 --- a/.evergreen/config/test/load-balanced-7.0.yml +++ b/.evergreen/config/generated/test/load-balanced-7.0.yml @@ -1,7 +1,7 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/load-balanced.yml" template file instead. tasks: - name: "test-mongodb-7.0-loadbalanced" - tags: ["sharded", "local", "7.0", "loadbalanced"] + tags: ["loadbalanced", "local", "7.0"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/test/load-balanced-latest.yml b/.evergreen/config/generated/test/load-balanced-latest.yml similarity index 74% rename from .evergreen/config/test/load-balanced-latest.yml rename to .evergreen/config/generated/test/load-balanced-latest.yml index 910541f4d..16b197357 100644 --- a/.evergreen/config/test/load-balanced-latest.yml +++ b/.evergreen/config/generated/test/load-balanced-latest.yml @@ -1,7 +1,7 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/load-balanced.yml" template file instead. tasks: - name: "test-mongodb-latest-loadbalanced" - tags: ["sharded", "local", "latest", "loadbalanced"] + tags: ["loadbalanced", "local", "latest"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/test/load-balanced-rapid.yml b/.evergreen/config/generated/test/load-balanced-rapid.yml similarity index 74% rename from .evergreen/config/test/load-balanced-rapid.yml rename to .evergreen/config/generated/test/load-balanced-rapid.yml index 01773ed93..adc8dc096 100644 --- a/.evergreen/config/test/load-balanced-rapid.yml +++ b/.evergreen/config/generated/test/load-balanced-rapid.yml @@ -1,7 +1,7 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/load-balanced.yml" template file instead. tasks: - name: "test-mongodb-rapid-loadbalanced" - tags: ["sharded", "local", "rapid", "loadbalanced"] + tags: ["loadbalanced", "local", "rapid"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/test/local-3.6.yml b/.evergreen/config/generated/test/local-3.6.yml similarity index 90% rename from .evergreen/config/test/local-3.6.yml rename to .evergreen/config/generated/test/local-3.6.yml index 0c3fb9e4d..377240fc8 100644 --- a/.evergreen/config/test/local-3.6.yml +++ b/.evergreen/config/generated/test/local-3.6.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/local.yml" template file instead. tasks: - name: "test-mongodb-3.6-standalone-noauth-nossl" tags: ["standalone", "local", "3.6"] diff --git a/.evergreen/config/test/local-4.0.yml b/.evergreen/config/generated/test/local-4.0.yml similarity index 90% rename from .evergreen/config/test/local-4.0.yml rename to .evergreen/config/generated/test/local-4.0.yml index 3f817ccd7..6a12e4d68 100644 --- a/.evergreen/config/test/local-4.0.yml +++ b/.evergreen/config/generated/test/local-4.0.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/local.yml" template file instead. tasks: - name: "test-mongodb-4.0-standalone-noauth-nossl" tags: ["standalone", "local", "4.0"] diff --git a/.evergreen/config/test/local-4.2.yml b/.evergreen/config/generated/test/local-4.2.yml similarity index 90% rename from .evergreen/config/test/local-4.2.yml rename to .evergreen/config/generated/test/local-4.2.yml index 0a6390dec..56e6fd013 100644 --- a/.evergreen/config/test/local-4.2.yml +++ b/.evergreen/config/generated/test/local-4.2.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/local.yml" template file instead. tasks: - name: "test-mongodb-4.2-standalone-noauth-nossl" tags: ["standalone", "local", "4.2"] diff --git a/.evergreen/config/test/local-4.4.yml b/.evergreen/config/generated/test/local-4.4.yml similarity index 90% rename from .evergreen/config/test/local-4.4.yml rename to .evergreen/config/generated/test/local-4.4.yml index f26fd4a2d..5b5c31bdc 100644 --- a/.evergreen/config/test/local-4.4.yml +++ b/.evergreen/config/generated/test/local-4.4.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/local.yml" template file instead. tasks: - name: "test-mongodb-4.4-standalone-noauth-nossl" tags: ["standalone", "local", "4.4"] diff --git a/.evergreen/config/test/local-5.0.yml b/.evergreen/config/generated/test/local-5.0.yml similarity index 90% rename from .evergreen/config/test/local-5.0.yml rename to .evergreen/config/generated/test/local-5.0.yml index eeae55c3c..4dfbe6ae2 100644 --- a/.evergreen/config/test/local-5.0.yml +++ b/.evergreen/config/generated/test/local-5.0.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/local.yml" template file instead. tasks: - name: "test-mongodb-5.0-standalone-noauth-nossl" tags: ["standalone", "local", "5.0"] diff --git a/.evergreen/config/test/local-6.0.yml b/.evergreen/config/generated/test/local-6.0.yml similarity index 90% rename from .evergreen/config/test/local-6.0.yml rename to .evergreen/config/generated/test/local-6.0.yml index f38bcbbf9..f9ce1e68c 100644 --- a/.evergreen/config/test/local-6.0.yml +++ b/.evergreen/config/generated/test/local-6.0.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/local.yml" template file instead. tasks: - name: "test-mongodb-6.0-standalone-noauth-nossl" tags: ["standalone", "local", "6.0"] diff --git a/.evergreen/config/test/local-7.0.yml b/.evergreen/config/generated/test/local-7.0.yml similarity index 90% rename from .evergreen/config/test/local-7.0.yml rename to .evergreen/config/generated/test/local-7.0.yml index c0a0d3da6..77a5c9696 100644 --- a/.evergreen/config/test/local-7.0.yml +++ b/.evergreen/config/generated/test/local-7.0.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/local.yml" template file instead. tasks: - name: "test-mongodb-7.0-standalone-noauth-nossl" tags: ["standalone", "local", "7.0"] diff --git a/.evergreen/config/test/local-latest.yml b/.evergreen/config/generated/test/local-latest.yml similarity index 90% rename from .evergreen/config/test/local-latest.yml rename to .evergreen/config/generated/test/local-latest.yml index b9187211e..be2b0611e 100644 --- a/.evergreen/config/test/local-latest.yml +++ b/.evergreen/config/generated/test/local-latest.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/local.yml" template file instead. tasks: - name: "test-mongodb-latest-standalone-noauth-nossl" tags: ["standalone", "local", "latest"] diff --git a/.evergreen/config/test/local-rapid.yml b/.evergreen/config/generated/test/local-rapid.yml similarity index 90% rename from .evergreen/config/test/local-rapid.yml rename to .evergreen/config/generated/test/local-rapid.yml index d12ac8667..339e1ff3a 100644 --- a/.evergreen/config/test/local-rapid.yml +++ b/.evergreen/config/generated/test/local-rapid.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/local.yml" template file instead. tasks: - name: "test-mongodb-rapid-standalone-noauth-nossl" tags: ["standalone", "local", "rapid"] diff --git a/.evergreen/config/test/require-api-version-5.0.yml b/.evergreen/config/generated/test/require-api-version-5.0.yml similarity index 87% rename from .evergreen/config/test/require-api-version-5.0.yml rename to .evergreen/config/generated/test/require-api-version-5.0.yml index 6911a8bc9..0a2a20fd2 100644 --- a/.evergreen/config/test/require-api-version-5.0.yml +++ b/.evergreen/config/generated/test/require-api-version-5.0.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/require-api-version.yml" template file instead. tasks: - name: "test-requireApiVersion-5.0" tags: ["standalone", "local", "5.0", "versioned_api"] diff --git a/.evergreen/config/test/require-api-version-6.0.yml b/.evergreen/config/generated/test/require-api-version-6.0.yml similarity index 87% rename from .evergreen/config/test/require-api-version-6.0.yml rename to .evergreen/config/generated/test/require-api-version-6.0.yml index 6de646b96..8af0b8c1a 100644 --- a/.evergreen/config/test/require-api-version-6.0.yml +++ b/.evergreen/config/generated/test/require-api-version-6.0.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/require-api-version.yml" template file instead. tasks: - name: "test-requireApiVersion-6.0" tags: ["standalone", "local", "6.0", "versioned_api"] diff --git a/.evergreen/config/test/require-api-version-7.0.yml b/.evergreen/config/generated/test/require-api-version-7.0.yml similarity index 87% rename from .evergreen/config/test/require-api-version-7.0.yml rename to .evergreen/config/generated/test/require-api-version-7.0.yml index 187eeaca1..74e747b7a 100644 --- a/.evergreen/config/test/require-api-version-7.0.yml +++ b/.evergreen/config/generated/test/require-api-version-7.0.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/require-api-version.yml" template file instead. tasks: - name: "test-requireApiVersion-7.0" tags: ["standalone", "local", "7.0", "versioned_api"] diff --git a/.evergreen/config/test/require-api-version-latest.yml b/.evergreen/config/generated/test/require-api-version-latest.yml similarity index 88% rename from .evergreen/config/test/require-api-version-latest.yml rename to .evergreen/config/generated/test/require-api-version-latest.yml index 623ff5248..d41d54db7 100644 --- a/.evergreen/config/test/require-api-version-latest.yml +++ b/.evergreen/config/generated/test/require-api-version-latest.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/require-api-version.yml" template file instead. tasks: - name: "test-requireApiVersion-latest" tags: ["standalone", "local", "latest", "versioned_api"] diff --git a/.evergreen/config/test/require-api-version-rapid.yml b/.evergreen/config/generated/test/require-api-version-rapid.yml similarity index 87% rename from .evergreen/config/test/require-api-version-rapid.yml rename to .evergreen/config/generated/test/require-api-version-rapid.yml index 51e2772ee..bd9015299 100644 --- a/.evergreen/config/test/require-api-version-rapid.yml +++ b/.evergreen/config/generated/test/require-api-version-rapid.yml @@ -1,4 +1,4 @@ -# This file is generated automatically - please edit the corresponding template file! +# This file is generated automatically - please edit the "templates/test/require-api-version.yml" template file instead. tasks: - name: "test-requireApiVersion-rapid" tags: ["standalone", "local", "rapid", "versioned_api"] diff --git a/.evergreen/config/build/_template-build-extension.yml b/.evergreen/config/templates/build/build-extension.yml similarity index 100% rename from .evergreen/config/build/_template-build-extension.yml rename to .evergreen/config/templates/build/build-extension.yml diff --git a/.evergreen/config/test/_template-csfle.yml b/.evergreen/config/templates/test/csfle.yml similarity index 100% rename from .evergreen/config/test/_template-csfle.yml rename to .evergreen/config/templates/test/csfle.yml diff --git a/.evergreen/config/test/_template-load-balanced.yml b/.evergreen/config/templates/test/load-balanced.yml similarity index 87% rename from .evergreen/config/test/_template-load-balanced.yml rename to .evergreen/config/templates/test/load-balanced.yml index fc7e4d1b9..ca36912ad 100644 --- a/.evergreen/config/test/_template-load-balanced.yml +++ b/.evergreen/config/templates/test/load-balanced.yml @@ -1,6 +1,6 @@ tasks: - name: "test-mongodb-%mongodbVersion%-loadbalanced" - tags: ["sharded", "local", "%mongodbVersion%", "loadbalanced"] + tags: ["loadbalanced", "local", "%mongodbVersion%"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/test/_template-local.yml b/.evergreen/config/templates/test/local.yml similarity index 100% rename from .evergreen/config/test/_template-local.yml rename to .evergreen/config/templates/test/local.yml diff --git a/.evergreen/config/test/_template-require-api-version.yml b/.evergreen/config/templates/test/require-api-version.yml similarity index 100% rename from .evergreen/config/test/_template-require-api-version.yml rename to .evergreen/config/templates/test/require-api-version.yml diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index 0b19ffa60..a7246029e 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -19,6 +19,7 @@ buildvariants: - ".standalone .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".replicaset .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".sharded .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" + - ".loadbalanced .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".serverless" - "test-atlas-data-lake" - name: test-debian92-php82-local @@ -37,6 +38,7 @@ buildvariants: - ".standalone .local !.6.0 !.7.0 !.rapid !.latest" - ".replicaset .local !.csfle !.6.0 !.7.0 !.rapid !.latest" - ".sharded .local !.6.0 !.7.0 !.rapid !.latest" + - ".loadbalanced .local !.6.0 !.7.0 !.rapid !.latest" # Test remaining PHP versions with replica sets on Debian 11 with MongoDB 7.0 - name: test-debian11-php81-local diff --git a/.gitattributes b/.gitattributes index e6785c9c1..6a04e7492 100644 --- a/.gitattributes +++ b/.gitattributes @@ -16,7 +16,4 @@ psalm.xml.dist export-ignore psalm-baseline.xml export-ignore # Prevent generated build files from showing diffs in pull requests -.evergreen/config/build/*.yml linguist-generated=true -.evergreen/config/build/_template*.yml linguist-generated=false -.evergreen/config/test/*.yml linguist-generated=true -.evergreen/config/test/_template*.yml linguist-generated=false +.evergreen/config/generated/** linguist-generated=true From ed81f9c96566356ae90cd4b74db429e84565cb7b Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 17 Oct 2023 09:18:34 +0200 Subject: [PATCH 22/28] Remove unused YAML tags --- .evergreen/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 56cee44ec..afbeaab99 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -15,7 +15,7 @@ exec_timeout_secs: 600 # These pre and post rules apply to all tasks not part of a task group, which should only ever be tests against local # MongoDB instances. All other tasks that require special preparation should be run from within a task group -pre: &test_setup +pre: - func: "fetch source" - func: "prepare resources" - func: "fix absolute paths" @@ -24,7 +24,7 @@ pre: &test_setup - func: "locate PHP binaries" - func: "fetch extension" - func: "install composer" -post: &test_teardown +post: - func: "upload mo artifacts" - func: "upload test results" - func: "delete serverless instance" From 8fa6723b16d90dd471ca4188dc0309692de8e972 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 17 Oct 2023 09:19:01 +0200 Subject: [PATCH 23/28] Supply makeflags for pecl install --- .evergreen/compile-extension.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/compile-extension.sh b/.evergreen/compile-extension.sh index 4a890a629..1d8010994 100644 --- a/.evergreen/compile-extension.sh +++ b/.evergreen/compile-extension.sh @@ -28,10 +28,10 @@ install_extension () cd ${PROJECT_DIRECTORY} elif [ "${EXTENSION_VERSION}" != "" ]; then echo "Installing driver version ${EXTENSION_VERSION} from PECL" - pecl install -f mongodb-${EXTENSION_VERSION} + MAKEFLAGS=-j20 pecl install -f mongodb-${EXTENSION_VERSION} else echo "Installing latest driver version from PECL" - pecl install -f mongodb + MAKEFLAGS=-j20 pecl install -f mongodb fi cp ${PROJECT_DIRECTORY}/.evergreen/config/php.ini ${PHP_PATH}/lib/php.ini From e5f2de9ddca754a6f083bfbfa4a32d73f6e59b4a Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 17 Oct 2023 09:23:28 +0200 Subject: [PATCH 24/28] Remove irrelevant functions --- .evergreen/config.yml | 2 - .evergreen/config/build-task-groups.yml | 2 - .evergreen/config/functions.yml | 85 ------------------------- .evergreen/config/test-task-groups.yml | 1 - 4 files changed, 90 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index afbeaab99..bc92d4798 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -19,13 +19,11 @@ pre: - func: "fetch source" - func: "prepare resources" - func: "fix absolute paths" - - func: "make files executable" - func: "install dependencies" - func: "locate PHP binaries" - func: "fetch extension" - func: "install composer" post: - - func: "upload mo artifacts" - func: "upload test results" - func: "delete serverless instance" - func: "stop load balancer" diff --git a/.evergreen/config/build-task-groups.yml b/.evergreen/config/build-task-groups.yml index 6004902fe..892548181 100644 --- a/.evergreen/config/build-task-groups.yml +++ b/.evergreen/config/build-task-groups.yml @@ -3,10 +3,8 @@ variables: - func: "fetch source" - func: "prepare resources" - func: "fix absolute paths" - - func: "make files executable" - func: "install dependencies" build_teardown: &build_teardown - - func: "upload working dir" - func: "cleanup" task_groups: diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 43ede0be3..35c52047f 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -126,70 +126,6 @@ functions: fi echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config - "upload mo artifacts": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - find $MONGO_ORCHESTRATION_HOME -name \*.log | xargs tar czf mongodb-logs.tar.gz - - command: s3.put - params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} - local_file: mongodb-logs.tar.gz - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-logs.tar.gz - bucket: mciuploads - permissions: public-read - content_type: ${content_type|application/x-gzip} - display_name: "mongodb-logs.tar.gz" - - command: s3.put - params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} - local_file: ${DRIVERS_TOOLS}/.evergreen/orchestration/server.log - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-orchestration.log - bucket: mciuploads - permissions: public-read - content_type: ${content_type|text/plain} - display_name: "orchestration.log" - - "upload working dir": - - command: archive.targz_pack - params: - target: "working-dir.tar.gz" - source_dir: ${PROJECT_DIRECTORY}/ - include: - - "./**" - - command: s3.put - params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} - local_file: working-dir.tar.gz - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-working-dir.tar.gz - bucket: mciuploads - permissions: public-read - content_type: ${content_type|application/x-gzip} - display_name: "working-dir.tar.gz" - - command: archive.targz_pack - params: - target: "drivers-dir.tar.gz" - source_dir: ${DRIVERS_TOOLS} - include: - - "./**" - exclude_files: - # Windows cannot read the mongod *.lock files because they are locked. - - "*.lock" - - command: s3.put - params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} - local_file: drivers-dir.tar.gz - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-drivers-dir.tar.gz - bucket: mciuploads - permissions: public-read - content_type: ${content_type|application/x-gzip} - display_name: "drivers-dir.tar.gz" - "upload test results": - command: attach.xunit_results params: @@ -400,27 +336,6 @@ functions: perl -p -i -e "s|ABSOLUTE_PATH_REPLACEMENT_TOKEN|${DRIVERS_TOOLS}|g" $filename done - "windows fix": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do - cat $i | tr -d '\r' > $i.new - mv $i.new $i - done - # Copy client certificate because symlinks do not work on Windows. - cp ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem - - "make files executable": - - command: shell.exec - params: - script: | - ${PREPARE_SHELL} - for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do - chmod +x $i - done - "install dependencies": - command: shell.exec params: diff --git a/.evergreen/config/test-task-groups.yml b/.evergreen/config/test-task-groups.yml index 378b38c70..fd5d1af26 100644 --- a/.evergreen/config/test-task-groups.yml +++ b/.evergreen/config/test-task-groups.yml @@ -4,7 +4,6 @@ task_groups: - func: "fetch source" - func: "prepare resources" - func: "fix absolute paths" - - func: "make files executable" - func: "install dependencies" - func: "locate PHP binaries" - func: "fetch extension" From 545964d9a8242408e1a2eea1111faf3fc77a575d Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 17 Oct 2023 09:25:22 +0200 Subject: [PATCH 25/28] Clean up variables when running scripts --- .evergreen/config/functions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 35c52047f..4df8d3edf 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -344,7 +344,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} EXTENSION_VERSION=${EXTENSION_VERSION} EXTENSION_REPO=${EXTENSION_REPO} EXTENSION_BRANCH=${EXTENSION_BRANCH} DEPENDENCIES=${DEPENDENCIES} sh $file || echo "$file not available, skipping" + [ -f "$file" ] && sh $file || echo "$file not available, skipping" "install composer": - command: shell.exec @@ -355,7 +355,7 @@ functions: ${PREPARE_SHELL} file="${PROJECT_DIRECTORY}/.evergreen/install-composer.sh" # Don't use ${file} syntax here because evergreen treats it as an empty expansion. - [ -f "$file" ] && PHP_VERSION=${PHP_VERSION} EXTENSION_VERSION=${EXTENSION_VERSION} EXTENSION_REPO=${EXTENSION_REPO} EXTENSION_BRANCH=${EXTENSION_BRANCH} DEPENDENCIES=${DEPENDENCIES} sh $file || echo "$file not available, skipping" + [ -f "$file" ] && DEPENDENCIES=${DEPENDENCIES} sh $file || echo "$file not available, skipping" "start load balancer": - command: shell.exec From 776834d21d8bd31118e52b7a9f97a86aa898f605 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 17 Oct 2023 09:26:06 +0200 Subject: [PATCH 26/28] Skip CSFLE tests for all topologies --- .evergreen/config/test-variants.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.evergreen/config/test-variants.yml b/.evergreen/config/test-variants.yml index a7246029e..bc7d8f1e5 100644 --- a/.evergreen/config/test-variants.yml +++ b/.evergreen/config/test-variants.yml @@ -16,10 +16,10 @@ buildvariants: - variant: "build-debian11" name: "build-php-8.2" tasks: - - ".standalone .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" + - ".standalone .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".replicaset .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - - ".sharded .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - - ".loadbalanced .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" + - ".sharded .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" + - ".loadbalanced .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0" - ".serverless" - "test-atlas-data-lake" - name: test-debian92-php82-local @@ -35,10 +35,10 @@ buildvariants: name: "build-php-8.2" tasks: # Remember to add new major versions here as they are released - - ".standalone .local !.6.0 !.7.0 !.rapid !.latest" + - ".standalone .local !.csfle !.6.0 !.7.0 !.rapid !.latest" - ".replicaset .local !.csfle !.6.0 !.7.0 !.rapid !.latest" - - ".sharded .local !.6.0 !.7.0 !.rapid !.latest" - - ".loadbalanced .local !.6.0 !.7.0 !.rapid !.latest" + - ".sharded .local !.csfle !.6.0 !.7.0 !.rapid !.latest" + - ".loadbalanced .local !.csfle !.6.0 !.7.0 !.rapid !.latest" # Test remaining PHP versions with replica sets on Debian 11 with MongoDB 7.0 - name: test-debian11-php81-local From f30131b1a337b721a16d1eb00db8e0047224becb Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 17 Oct 2023 09:27:00 +0200 Subject: [PATCH 27/28] Document environment variables for install-composer.sh --- .evergreen/install-composer.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.evergreen/install-composer.sh b/.evergreen/install-composer.sh index 4c3e36acf..08f383e96 100644 --- a/.evergreen/install-composer.sh +++ b/.evergreen/install-composer.sh @@ -1,6 +1,10 @@ #!/bin/sh set -o errexit # Exit the script with error if any of the commands fail +# Supported environment variables +DEPENDENCIES=${DEPENDENCIES:-} # Specify "lowest" to prefer lowest dependencies +COMPOSER_FLAGS="${COMPOSER_FLAGS:-}" # Optional, additional Composer flags + PATH="$PHP_PATH/bin:$PATH" install_composer () From f96762a5bc85aba5f2e92e33799d48386ec95c83 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 17 Oct 2023 09:38:42 +0200 Subject: [PATCH 28/28] Add missing CSFLE tag to no-aws-creds tests --- .evergreen/config/generated/test/csfle-4.2.yml | 4 ++-- .evergreen/config/generated/test/csfle-4.4.yml | 4 ++-- .evergreen/config/generated/test/csfle-5.0.yml | 4 ++-- .evergreen/config/generated/test/csfle-6.0.yml | 4 ++-- .evergreen/config/generated/test/csfle-7.0.yml | 4 ++-- .evergreen/config/generated/test/csfle-latest.yml | 4 ++-- .evergreen/config/generated/test/csfle-rapid.yml | 4 ++-- .evergreen/config/templates/test/csfle.yml | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.evergreen/config/generated/test/csfle-4.2.yml b/.evergreen/config/generated/test/csfle-4.2.yml index a310b7fc9..dda70b6c1 100644 --- a/.evergreen/config/generated/test/csfle-4.2.yml +++ b/.evergreen/config/generated/test/csfle-4.2.yml @@ -27,8 +27,8 @@ tasks: vars: TESTS: "csfle" - - name: "test-mongodb-4.2-replicaset-no-aws-creds" - tags: ["replicaset", "local", "4.2"] + - name: "test-mongodb-4.2-no-aws-creds" + tags: ["replicaset", "local", "4.2", "csfle"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/generated/test/csfle-4.4.yml b/.evergreen/config/generated/test/csfle-4.4.yml index 291414239..ba58c8f0b 100644 --- a/.evergreen/config/generated/test/csfle-4.4.yml +++ b/.evergreen/config/generated/test/csfle-4.4.yml @@ -27,8 +27,8 @@ tasks: vars: TESTS: "csfle" - - name: "test-mongodb-4.4-replicaset-no-aws-creds" - tags: ["replicaset", "local", "4.4"] + - name: "test-mongodb-4.4-no-aws-creds" + tags: ["replicaset", "local", "4.4", "csfle"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/generated/test/csfle-5.0.yml b/.evergreen/config/generated/test/csfle-5.0.yml index ed7bdc6fd..8088b15ef 100644 --- a/.evergreen/config/generated/test/csfle-5.0.yml +++ b/.evergreen/config/generated/test/csfle-5.0.yml @@ -27,8 +27,8 @@ tasks: vars: TESTS: "csfle" - - name: "test-mongodb-5.0-replicaset-no-aws-creds" - tags: ["replicaset", "local", "5.0"] + - name: "test-mongodb-5.0-no-aws-creds" + tags: ["replicaset", "local", "5.0", "csfle"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/generated/test/csfle-6.0.yml b/.evergreen/config/generated/test/csfle-6.0.yml index 7e8315bb4..799aa62aa 100644 --- a/.evergreen/config/generated/test/csfle-6.0.yml +++ b/.evergreen/config/generated/test/csfle-6.0.yml @@ -27,8 +27,8 @@ tasks: vars: TESTS: "csfle" - - name: "test-mongodb-6.0-replicaset-no-aws-creds" - tags: ["replicaset", "local", "6.0"] + - name: "test-mongodb-6.0-no-aws-creds" + tags: ["replicaset", "local", "6.0", "csfle"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/generated/test/csfle-7.0.yml b/.evergreen/config/generated/test/csfle-7.0.yml index f40a9436a..c34d0f7e2 100644 --- a/.evergreen/config/generated/test/csfle-7.0.yml +++ b/.evergreen/config/generated/test/csfle-7.0.yml @@ -27,8 +27,8 @@ tasks: vars: TESTS: "csfle" - - name: "test-mongodb-7.0-replicaset-no-aws-creds" - tags: ["replicaset", "local", "7.0"] + - name: "test-mongodb-7.0-no-aws-creds" + tags: ["replicaset", "local", "7.0", "csfle"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/generated/test/csfle-latest.yml b/.evergreen/config/generated/test/csfle-latest.yml index 2c2110f22..aaea2ff51 100644 --- a/.evergreen/config/generated/test/csfle-latest.yml +++ b/.evergreen/config/generated/test/csfle-latest.yml @@ -27,8 +27,8 @@ tasks: vars: TESTS: "csfle" - - name: "test-mongodb-latest-replicaset-no-aws-creds" - tags: ["replicaset", "local", "latest"] + - name: "test-mongodb-latest-no-aws-creds" + tags: ["replicaset", "local", "latest", "csfle"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/generated/test/csfle-rapid.yml b/.evergreen/config/generated/test/csfle-rapid.yml index 18656e6c4..9be8bb7c4 100644 --- a/.evergreen/config/generated/test/csfle-rapid.yml +++ b/.evergreen/config/generated/test/csfle-rapid.yml @@ -27,8 +27,8 @@ tasks: vars: TESTS: "csfle" - - name: "test-mongodb-rapid-replicaset-no-aws-creds" - tags: ["replicaset", "local", "rapid"] + - name: "test-mongodb-rapid-no-aws-creds" + tags: ["replicaset", "local", "rapid", "csfle"] commands: - func: "bootstrap mongo-orchestration" vars: diff --git a/.evergreen/config/templates/test/csfle.yml b/.evergreen/config/templates/test/csfle.yml index 871266b4a..b256c4d24 100644 --- a/.evergreen/config/templates/test/csfle.yml +++ b/.evergreen/config/templates/test/csfle.yml @@ -26,8 +26,8 @@ tasks: vars: TESTS: "csfle" - - name: "test-mongodb-%mongodbVersion%-replicaset-no-aws-creds" - tags: ["replicaset", "local", "%mongodbVersion%"] + - name: "test-mongodb-%mongodbVersion%-no-aws-creds" + tags: ["replicaset", "local", "%mongodbVersion%", "csfle"] commands: - func: "bootstrap mongo-orchestration" vars: