-
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
Conversation
f1d8646
to
3113630
Compare
Use the crypt_shared library provisioned by download-mongodb.sh and add an additional task to disable the library and fall back to mongocryptd. This also revises how we pass environment variables into run-tests.sh and the test suite. Everything is now explicitly passed instead of relying on export attributes from a parent context.
3113630
to
2d1927c
Compare
SKIP_CRYPT_SHARED=${SKIP_CRYPT_SHARED} \ | ||
SSL=${SSL} \ | ||
TESTS=${TESTS} \ | ||
sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh |
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 use export
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 in run-tests.sh
.
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" | ||
TESTS=${TESTS:-} # Optional TESTS environment variable for run-tests.php |
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.
This is another change intended to minimize future diffs as we add/remove params.
else | ||
CRYPT_SHARED_LIB_PATH="${CRYPT_SHARED_LIB_PATH}" | ||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
This was adapted from the related changes in GODRIVER-2492.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically redundant since $SSL_DIR
is exported by $PREPARE_SHELL
in the Evergreen config, but I appreciated that this lines up with the documented env vars in basic.inc
and CONTRIBUTING.md
.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
I don't recall when this case
construct was actually used for OS-specific behavior, but it currently serves no purpose.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Although make
does allow env vars to be specified after the command, I opted to put everything up front so we have everything on its own line as was done in the Evergreen task definition.
https://jira.mongodb.org/browse/PHPC-2135
This PR also includes quite a bit of shell script cleanup based on my conversation with @rcsanchez97 in #driver-devs.
Full patch build: https://spruce.mongodb.com/version/630faa1d0305b97199243780/tasks