Skip to content

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

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Aug 31, 2022

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

@jmikola jmikola requested a review from alcaeus August 31, 2022 15:58
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.
SKIP_CRYPT_SHARED=${SKIP_CRYPT_SHARED} \
SSL=${SSL} \
TESTS=${TESTS} \
sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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.

@jmikola jmikola merged commit fa7dd55 into mongodb:v1.14 Sep 7, 2022
@jmikola jmikola deleted the 1.14-phpc-2135 branch September 7, 2022 15:28
@jmikola jmikola removed the request for review from alcaeus September 8, 2022 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant