Skip to content

Commit 746c65d

Browse files
committed
Merge branch 'v1.17'
* v1.17: PHPC-2356: Remove explicit env variables (#1514) Upgrade to latest libmongoc and libmongocrypt versions (#1509)
2 parents 3db1260 + d4170f7 commit 746c65d

File tree

12 files changed

+69
-37
lines changed

12 files changed

+69
-37
lines changed

.evergreen/atlas-uris.txt.enc

-2.33 KB
Binary file not shown.

.evergreen/config/functions.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,19 @@ functions:
167167
"bootstrap mongo-orchestration":
168168
- command: shell.exec
169169
params:
170+
include_expansions_in_env:
171+
- MONGODB_VERSION
172+
- TOPOLOGY
173+
- AUTH
174+
- SSL
175+
- STORAGE_ENGINE
176+
- LOAD_BALANCER
177+
- REQUIRE_API_VERSION
178+
- ORCHESTRATION_FILE
170179
script: |
171180
${PREPARE_SHELL}
172-
SKIP_LEGACY_SHELL=true MONGODB_VERSION=${MONGODB_VERSION} TOPOLOGY=${TOPOLOGY} AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} LOAD_BALANCER=${LOAD_BALANCER} REQUIRE_API_VERSION=${REQUIRE_API_VERSION} ORCHESTRATION_FILE=${ORCHESTRATION_FILE} sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
181+
SKIP_LEGACY_SHELL=true \
182+
sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
173183
# run-orchestration generates expansion file with MONGODB_URI and CRYPT_SHARED_LIB_PATH
174184
- command: expansions.update
175185
params:
@@ -185,28 +195,32 @@ functions:
185195
"run OCSP responder":
186196
- command: shell.exec
187197
params:
198+
include_expansions_in_env:
199+
- TEST_COLUMN
200+
- CERT_TYPE
201+
- USE_DELEGATE
188202
shell: bash
189203
script: |
190204
${PREPARE_SHELL}
191-
TEST_COLUMN=${TEST_COLUMN} \
192-
CERT_TYPE=${CERT_TYPE} \
193-
USE_DELEGATE=${USE_DELEGATE} \
194205
${PROJECT_DIRECTORY}/.evergreen/run-ocsp-responder.sh
195206
196207
"run tests":
197208
- command: shell.exec
198209
type: test
199210
params:
211+
include_expansions_in_env:
212+
- API_VERSION
213+
- ATLAS_CONNECTIVITY_URIS
214+
- CRYPT_SHARED_LIB_PATH
215+
- MONGODB_URI
216+
- APPEND_URI
217+
- SKIP_CRYPT_SHARED
218+
- SSL
219+
- SSL_DIR
220+
- TESTS
200221
working_dir: "src"
201222
script: |
202223
${PREPARE_SHELL}
203-
API_VERSION=${API_VERSION} \
204-
CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \
205-
MONGODB_URI="${MONGODB_URI}${APPEND_URI}" \
206-
SKIP_CRYPT_SHARED=${SKIP_CRYPT_SHARED} \
207-
SSL=${SSL} \
208-
SSL_DIR=${SSL_DIR} \
209-
TESTS=${TESTS} \
210224
sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
211225
212226
"cleanup":
@@ -242,12 +256,6 @@ functions:
242256
# Don't use ${file} syntax here because evergreen treats it as an empty expansion.
243257
[ -f "$file" ] && sh $file || echo "$file not available, skipping"
244258
245-
"decrypt atlas URI list":
246-
- command: shell.exec
247-
params:
248-
script: |
249-
openssl aes-256-cbc -S "${encrypted_uris_salt}" -K "${encrypted_uris_key}" -iv "${encrypted_uris_iv}" -in ${PROJECT_DIRECTORY}/.evergreen/atlas-uris.txt.enc -out ${PROJECT_DIRECTORY}/.evergreen/atlas-uris.txt -d
250-
251259
"start load balancer":
252260
- command: shell.exec
253261
params:

.evergreen/config/test-tasks.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ tasks:
22
- name: "test-atlas-connectivity"
33
tags: ["atlas", "nodb"]
44
commands:
5-
- func: "decrypt atlas URI list"
65
- func: "run tests"
76
vars:
87
TESTS: "tests/atlas.phpt"

.evergreen/run-tests.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -o errexit # Exit the script with error if any of the commands fail
55
API_VERSION=${API_VERSION:-} # Optional API_VERSION environment variable for run-tests.php
66
CRYPT_SHARED_LIB_PATH="${CRYPT_SHARED_LIB_PATH:-}" # Optional path to crypt_shared library
77
MONGODB_URI=${MONGODB_URI:-} # Connection string (including credentials and topology info)
8+
APPEND_URI=${APPEND_URI:-} # Additional URI options to append to the URI. Used in OCSP tests
89
SKIP_CRYPT_SHARED="${SKIP_CRYPT_SHARED:-no}" # Specify "yes" to ignore CRYPT_SHARED_LIB_PATH. Defaults to "no"
910
SSL=${SSL:-no} # Specify "yes" to enable SSL. Defaults to "no"
1011
SSL_DIR=${SSL_DIR-} # Optional SSL_DIR environment variable for run-tests.php
@@ -15,6 +16,9 @@ OS=$(uname -s | tr '[:upper:]' '[:lower:]')
1516

1617
export REPORT_EXIT_STATUS=1
1718

19+
# Append test-specific URI options
20+
MONGODB_URI=${MONGODB_URI}${APPEND_URI}
21+
1822
# Determine if MONGODB_URI already has a query string
1923
SUFFIX=$(echo "$MONGODB_URI" | grep -Eo "\?(.*)" | cat)
2024

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ php.ini
5252
!.github/
5353
!tests/utils/*.php
5454
!.evergreen
55-
.evergreen/atlas-uris.txt
5655

5756

5857
!scripts

config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,15 @@ if test "$PHP_MONGODB" != "no"; then
293293
])
294294

295295
if test "$PHP_MONGODB_CLIENT_SIDE_ENCRYPTION" != "no"; then
296-
PKG_CHECK_MODULES([PHP_MONGODB_MONGOCRYPT], [libmongocrypt >= 1.8.2], [
296+
PKG_CHECK_MODULES([PHP_MONGODB_MONGOCRYPT], [libmongocrypt >= 1.8.4], [
297297
PHP_MONGODB_MONGOCRYPT_VERSION=`$PKG_CONFIG libmongocrypt --modversion`
298298
PHP_MONGODB_MONGOCRYPT_VERSION_STRING="System ($PHP_MONGODB_MONGOCRYPT_VERSION)"
299299
300300
PHP_MONGODB_CFLAGS="$PHP_MONGODB_CFLAGS $PHP_MONGODB_MONGOCRYPT_CFLAGS"
301301
PHP_EVAL_LIBLINE($PHP_MONGODB_MONGOCRYPT_LIBS, MONGODB_SHARED_LIBADD)
302302
AC_DEFINE(HAVE_SYSTEM_LIBMONGOCRYPT, 1, [Use system libmongocrypt])
303303
],[
304-
AC_MSG_ERROR(Could not find system library for libmongocrypt >= 1.8.2)
304+
AC_MSG_ERROR(Could not find system library for libmongocrypt >= 1.8.4)
305305
])
306306
fi
307307
fi

src/LIBMONGOCRYPT_VERSION_CURRENT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8.2
1+
1.8.4

src/LIBMONGOC_VERSION_CURRENT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.25.2
1+
1.25.4

tests/atlas.phpt

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
--TEST--
22
Atlas Connectivity Tests
33
--SKIPIF--
4-
<?php
5-
if (!file_exists('.evergreen/atlas-uris.txt')) { echo "skip Atlas URIs not found\n"; }
6-
if (filesize('.evergreen/atlas-uris.txt') < 10) { echo "skip Atlas URI file empty\n"; }
7-
if (getenv('TESTS') !== 'tests/atlas.phpt') { echo "skip Atlas tests not wanted\n"; }
8-
?>
4+
<?php require __DIR__ . "/utils/basic-skipif.inc"; ?>
5+
<?php skip_if_no_atlas_connectivity_urls(); ?>
6+
<?php if (getenv('TESTS') !== 'tests/atlas.phpt') { die('skip Atlas tests not wanted'); } ?>
97
--FILE--
108
<?php
11-
$urls = explode("\n", file_get_contents('.evergreen/atlas-uris.txt'));
9+
require_once __DIR__ . "/utils/basic.inc";
1210

1311
$command = new \MongoDB\Driver\Command(['ping' => 1]);
1412
$query = new \MongoDB\Driver\Query([]);
1513

16-
foreach ($urls as $url) {
17-
$url = trim($url);
18-
19-
if ($url == '') {
20-
continue;
21-
}
22-
14+
foreach (getAtlasConnectivityUrls() as $url) {
2315
if (strpos($url, '#') === 0) {
2416
echo trim(substr($url, 1)), "\n";
2517
continue;

tests/utils/skipif.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,3 +494,10 @@ function skip_if_no_crypt_shared()
494494
exit('skip crypt_shared is not available');
495495
}
496496
}
497+
498+
function skip_if_no_atlas_connectivity_urls()
499+
{
500+
if (getAtlasConnectivityUrls() === []) {
501+
exit('skip No Atlas URIs found');
502+
}
503+
}

tests/utils/tools.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,3 +847,26 @@ function failGetMore(Manager $manager)
847847

848848
throw new Exception("Trying to configure a getMore fail point for a server version ($version) that doesn't support it");
849849
}
850+
851+
function getAtlasConnectivityUrls(): array
852+
{
853+
$atlasUriString = getenv('ATLAS_CONNECTIVITY_URIS') ?: '';
854+
if (!$atlasUriString) {
855+
return [];
856+
}
857+
858+
$rawUrls = explode("\n", $atlasUriString);
859+
860+
$urls = [];
861+
foreach ($rawUrls as $url) {
862+
$url = trim($url);
863+
864+
if ($url == '') {
865+
continue;
866+
}
867+
868+
$urls[] = $url;
869+
}
870+
871+
return $urls;
872+
}

0 commit comments

Comments
 (0)