-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-2135: Test with consistent version of crypt_shared #1353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
#!/bin/sh | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
# Supported/used environment variables: | ||
# SSL Set to "yes" to enable SSL. Defaults to "nossl" | ||
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info) | ||
# TESTS Optional TESTS environment variable for run-tests.php | ||
# API_VERSION Optional API_VERSION environment variable for run-tests.php | ||
|
||
SSL=${SSL:-nossl} | ||
MONGODB_URI=${MONGODB_URI:-} | ||
TESTS=${TESTS:-} | ||
API_VERSION=${API_VERSION:-} | ||
# Supported environment variables | ||
API_VERSION=${API_VERSION:-} # Optional API_VERSION environment variable for run-tests.php | ||
CRYPT_SHARED_LIB_PATH="${CRYPT_SHARED_LIB_PATH:-}" # Optional path to crypt_shared library | ||
MONGODB_URI=${MONGODB_URI:-} # Connection string (including credentials and topology info) | ||
SKIP_CRYPT_SHARED="${SKIP_CRYPT_SHARED:-no}" # Specify "yes" to ignore CRYPT_SHARED_LIB_PATH. Defaults to "no" | ||
SSL=${SSL:-no} # Specify "yes" to enable SSL. Defaults to "no" | ||
SSL_DIR=${SSL_DIR-} # Optional SSL_DIR environment variable for run-tests.php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is technically redundant since |
||
TESTS=${TESTS:-} # Optional TESTS environment variable for run-tests.php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is another change intended to minimize future diffs as we add/remove params. |
||
|
||
OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
[ -z "$MARCH" ] && MARCH=$(uname -m | tr '[:upper:]' '[:lower:]') | ||
|
@@ -28,12 +26,23 @@ if [ "$SSL" = "yes" ]; then | |
fi | ||
fi | ||
|
||
if [ "${SKIP_CRYPT_SHARED}" = "yes" ]; then | ||
CRYPT_SHARED_LIB_PATH="" | ||
echo "crypt_shared library is skipped" | ||
elif [ -z "${CRYPT_SHARED_LIB_PATH}" ]; then | ||
echo "crypt_shared library path is empty" | ||
else | ||
echo "crypt_shared library will be loaded from path: $CRYPT_SHARED_LIB_PATH" | ||
fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was adapted from the related changes in GODRIVER-2492. |
||
|
||
echo "Running tests with URI: $MONGODB_URI" | ||
|
||
# Run the tests, and store the results in a junit result file | ||
case "$OS" in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't recall when this |
||
*) | ||
API_VERSION="${API_VERSION}" TEST_PHP_JUNIT="${PROJECT_DIRECTORY}/test-results.xml" TEST_PHP_ARGS="-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" make test TESTS=$TESTS | ||
;; | ||
esac | ||
|
||
API_VERSION="${API_VERSION}" \ | ||
CRYPT_SHARED_LIB_PATH="${CRYPT_SHARED_LIB_PATH}" \ | ||
MONGODB_URI="${MONGODB_URI}" \ | ||
SSL_DIR="${SSL_DIR}" \ | ||
TEST_PHP_JUNIT="${PROJECT_DIRECTORY}/test-results.xml" \ | ||
TEST_PHP_ARGS="-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" \ | ||
TESTS="$TESTS" \ | ||
make test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize this is a larger diff than required, but it should minimize future diffs if we introduce or otherwise change vars to
run-tests.sh
down the line. Alternatively, we could useexport
for everything and avoid the backslashes (as is already the case for$SSL_DIR
), but being explicit here lets us more easily match up with the supported vars documented inrun-tests.sh
.