-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-4721 - Create individualized scripts for all shell.exec commands #1997
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 14 commits
14d26bc
56fafb8
71de21f
f957a69
94db687
051e733
ea5dff8
b10bd37
a9b1c07
c017581
6ce1f86
ec3c2c4
312266f
1b1abc8
b395f01
7bda294
3ef0084
8176e6c
c3bcada
a49e630
4a9ddf9
fbc5a0b
fe40a95
40a9984
01704ba
57acb85
13c6e83
707452b
7617ac6
3ff9a41
2a3cc4c
4a83e54
9d2212f
9949ac9
fb15895
6f74878
ae446f6
5f0b429
3a3b542
d7f79ca
b8cd932
717c7c0
f7ad42d
68c9d29
637a6cc
ed73e72
18d82e0
b4695c1
7654361
ebab2b6
82dcf30
d5de764
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
. src/.evergreen/scripts/env.sh | ||
set -o xtrace | ||
mkdir out_dir | ||
find "$MONGO_ORCHESTRATION_HOME" -name \*.log -exec sh -c 'x=$1; mv $x $PWD/out_dir/$(basename $(dirname $x))_$(basename $x)' shell {} \; | ||
tar zcvf mongodb-logs.tar.gz -C out_dir/ . | ||
rm -rf out_dir |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
. src/.evergreen/scripts/env.sh | ||
set -o xtrace | ||
|
||
# Enable core dumps if enabled on the machine | ||
# Copied from https://github.com/mongodb/mongo/blob/master/etc/evergreen.yml | ||
if [ -f /proc/self/coredump_filter ]; then | ||
# Set the shell process (and its children processes) to dump ELF headers (bit 4), | ||
# anonymous shared mappings (bit 1), and anonymous private mappings (bit 0). | ||
echo 0x13 >/proc/self/coredump_filter | ||
|
||
if [ -f /sbin/sysctl ]; then | ||
# Check that the core pattern is set explicitly on our distro image instead | ||
# of being the OS's default value. This ensures that coredump names are consistent | ||
# across distros and can be picked up by Evergreen. | ||
core_pattern=$(/sbin/sysctl -n "kernel.core_pattern") | ||
if [ "$core_pattern" = "dump_%e.%p.core" ]; then | ||
echo "Enabling coredumps" | ||
ulimit -c unlimited | ||
fi | ||
fi | ||
fi | ||
|
||
if [ "$(uname -s)" = "Darwin" ]; then | ||
core_pattern_mac=$(/usr/sbin/sysctl -n "kern.corefile") | ||
if [ "$core_pattern_mac" = "dump_%N.%P.core" ]; then | ||
echo "Enabling coredumps" | ||
ulimit -c unlimited | ||
fi | ||
fi | ||
|
||
if [ -n "${skip_crypt_shared}" ]; then | ||
export SKIP_CRYPT_SHARED=1 | ||
fi | ||
|
||
MONGODB_VERSION=${VERSION} \ | ||
TOPOLOGY=${TOPOLOGY} \ | ||
AUTH=${AUTH} \ | ||
SSL=${SSL} \ | ||
STORAGE_ENGINE=${STORAGE_ENGINE} \ | ||
DISABLE_TEST_COMMANDS=${DISABLE_TEST_COMMANDS} \ | ||
ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \ | ||
REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \ | ||
LOAD_BALANCER=${LOAD_BALANCER} \ | ||
bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh | ||
# run-orchestration generates expansion file with the MONGODB_URI for the cluster |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
. .evergreen/scripts/env.sh | ||
set -x | ||
export BASE_SHA="$1" | ||
export HEAD_SHA="$2" | ||
bash .evergreen/run-import-time-test.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
. .evergreen/scripts/env.sh | ||
if [ -f "$DRIVERS_TOOLS"/.evergreen/csfle/secrets-export.sh ]; then | ||
. .evergreen/hatch.sh encryption:teardown | ||
fi | ||
rm -rf "${DRIVERS_TOOLS}" || true | ||
rm -f ./secrets-export.sh || true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set +x | ||
. src/.evergreen/scripts/env.sh | ||
# Download all the task coverage files. | ||
aws s3 cp --recursive s3://"$1"/coverage/"$2"/"$3"/coverage/ coverage/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set +x | ||
. src/.evergreen/scripts/env.sh | ||
# shellcheck disable=SC2044 | ||
for filename in $(find $DRIVERS_TOOLS -name \*.json); do | ||
perl -p -i -e "s|ABSOLUTE_PATH_REPLACEMENT_TOKEN|$DRIVERS_TOOLS|g" $filename | ||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
set +x | ||
. src/.evergreen/scripts/env.sh | ||
echo '{"results": [{ "status": "FAIL", "test_file": "Build", "log_raw": "No test-results.json found was created" } ]}' >$PROJECT_DIRECTORY/test-results.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
. .evergreen/scripts/env.sh | ||
set -o xtrace | ||
file="$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh" | ||
# Don't use ${file} syntax here because evergreen treats it as an empty expansion. | ||
[ -f "$file" ] && bash $file || echo "$file not available, skipping" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set +x | ||
. src/.evergreen/scripts/env.sh | ||
# shellcheck disable=SC2044 | ||
for i in $(find "$DRIVERS_TOOLS"/.evergreen "$PROJECT_DIRECTORY"/.evergreen -name \*.sh); do | ||
chmod +x "$i" | ||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
. src/.evergreen/scripts/env.sh | ||
set -o xtrace | ||
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 $DRIVERS_TOOLS | ||
fi | ||
echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" >$MONGO_ORCHESTRATION_HOME/orchestration.config | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
. .evergreen/scripts/env.sh | ||
# Disable xtrace for security reasons (just in case it was accidentally set). | ||
set +x | ||
set -o errexit | ||
bash "${DRIVERS_TOOLS}"/.evergreen/auth_aws/setup_secrets.sh drivers/atlas_connect | ||
TEST_ATLAS=1 bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh test:test-eg |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# shellcheck disable=SC2154 | ||
if [ "${skip_ECS_auth_test}" = "true" ]; then | ||
echo "This platform does not support the ECS auth test, skipping..." | ||
exit 0 | ||
fi | ||
. .evergreen/scripts/env.sh | ||
set -ex | ||
cd $DRIVERS_TOOLS/.evergreen/auth_aws | ||
. ./activate-authawsvenv.sh | ||
. aws_setup.sh ecs | ||
export MONGODB_BINARIES="$MONGODB_BINARIES" | ||
export PROJECT_DIRECTORY="$PROJECT_DIRECTORY" | ||
python aws_tester.py ecs | ||
cd - |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
. .evergreen/scripts/env.sh | ||
set -o xtrace | ||
PYTHON_BINARY=${PYTHON_BINARY} bash ${PROJECT_DIRECTORY}/.evergreen/hatch.sh doctest:test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
# Disable xtrace for security reasons (just in case it was accidentally set). | ||
set +x | ||
bash ${DRIVERS_TOOLS}/.evergreen/auth_aws/setup_secrets.sh drivers/enterprise_auth | ||
TEST_ENTERPRISE_AUTH=1 AUTH=auth bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh test:test-eg |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
. .evergreen/scripts/env.sh | ||
export PYTHON_BINARY=/opt/mongodbtoolchain/v4/bin/python3 | ||
export LIBMONGOCRYPT_URL=https://s3.amazonaws.com/mciuploads/libmongocrypt/debian11/master/latest/libmongocrypt.tar.gz | ||
SKIP_SERVERS=1 bash ./.evergreen/setup-encryption.sh | ||
SUCCESS=false TEST_FLE_GCP_AUTO=1 ./.evergreen/hatch.sh test:test-eg |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
set -o xtrace | ||
. ${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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
. src/.evergreen/scripts/env.sh | ||
MONGODB_URI=${MONGODB_URI} bash "${DRIVERS_TOOLS}"/.evergreen/run-load-balancer.sh start |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
. .evergreen/scripts/env.sh | ||
set -o xtrace | ||
export PYTHON_BINARY=${PYTHON_BINARY} | ||
bash ${PROJECT_DIRECTORY}/.evergreen/hatch.sh test:test-mockupdb |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
blink1073 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
. .evergreen/scripts/env.sh | ||
|
||
TEST_OCSP=1 \ | ||
PYTHON_BINARY="${PYTHON_BINARY}" \ | ||
CA_FILE="${DRIVERS_TOOLS}/.evergreen/ocsp/${OCSP_ALGORITHM}/ca.pem" \ | ||
OCSP_TLS_SHOULD_SUCCEED="${OCSP_TLS_SHOULD_SUCCEED}" \ | ||
bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh test:test-eg | ||
bash "${DRIVERS_TOOLS}"/.evergreen/ocsp/teardown.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
. .evergreen/scripts/env.sh | ||
PROJECT_DIRECTORY=${PROJECT_DIRECTORY} | ||
bash "${PROJECT_DIRECTORY}"/.evergreen/run-perf-tests.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
. .evergreen/scripts/env.sh | ||
if [ -n "${test_encryption}" ]; then | ||
./.evergreen/hatch.sh encryption:setup & | ||
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. We might need to break this out the way we handle it in the go driver, as a separate background command: https://github.com/mongodb/mongo-go-driver/blob/cf0348c9a63f6e4086e2c62aa62e70a9d3b3a986/.evergreen/config.yml#L508 |
||
fi | ||
|
||
set +x | ||
if [ -n "${MONGODB_STARTED}" ]; then | ||
export PYMONGO_MUST_CONNECT=true | ||
fi | ||
if [ -n "${DISABLE_TEST_COMMANDS}" ]; then | ||
export PYMONGO_DISABLE_TEST_COMMANDS=1 | ||
fi | ||
if [ -n "${test_encryption}" ]; then | ||
# Disable xtrace (just in case it was accidentally set). | ||
set +x | ||
bash "${DRIVERS_TOOLS}"/.evergreen/csfle/await-servers.sh | ||
export TEST_ENCRYPTION=1 | ||
if [ -n "${test_encryption_pyopenssl}" ]; then | ||
export TEST_ENCRYPTION_PYOPENSSL=1 | ||
fi | ||
fi | ||
if [ -n "${test_crypt_shared}" ]; then | ||
export TEST_CRYPT_SHARED=1 | ||
export CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} | ||
fi | ||
if [ -n "${test_pyopenssl}" ]; then | ||
export TEST_PYOPENSSL=1 | ||
fi | ||
if [ -n "${SETDEFAULTENCODING}" ]; then | ||
export SETDEFAULTENCODING="${SETDEFAULTENCODING}" | ||
fi | ||
if [ -n "${test_loadbalancer}" ]; then | ||
export TEST_LOADBALANCER=1 | ||
export SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI}" | ||
export MULTI_MONGOS_LB_URI="${MULTI_MONGOS_LB_URI}" | ||
fi | ||
if [ -n "${test_serverless}" ]; then | ||
export TEST_SERVERLESS=1 | ||
fi | ||
if [ -n "${TEST_INDEX_MANAGEMENT}" ]; then | ||
export TEST_INDEX_MANAGEMENT=1 | ||
fi | ||
if [ -n "${SKIP_CSOT_TESTS}" ]; then | ||
export SKIP_CSOT_TESTS=1 | ||
fi | ||
|
||
GREEN_FRAMEWORK=${GREEN_FRAMEWORK} \ | ||
PYTHON_BINARY=${PYTHON_BINARY} \ | ||
NO_EXT=${NO_EXT} \ | ||
COVERAGE=${COVERAGE} \ | ||
COMPRESSORS=${COMPRESSORS} \ | ||
AUTH=${AUTH} \ | ||
SSL=${SSL} \ | ||
TEST_DATA_LAKE=${TEST_DATA_LAKE} \ | ||
TEST_SUITES=${TEST_SUITES} \ | ||
MONGODB_API_VERSION=${MONGODB_API_VERSION} \ | ||
SKIP_HATCH=${SKIP_HATCH} \ | ||
bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh test:test-eg |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
cd "${DRIVERS_TOOLS}"/.evergreen || exit | ||
DRIVERS_TOOLS=${DRIVERS_TOOLS} | ||
bash "${DRIVERS_TOOLS}"/.evergreen/run-load-balancer.sh stop |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
blink1073 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
. src/.evergreen/scripts/env.sh | ||
|
||
cd "${DRIVERS_TOOLS}/.evergreen/auth_aws" || exit | ||
if [ -f "./aws_e2e_setup.json" ]; then | ||
. ./activate-authawsvenv.sh | ||
python ./lib/aws_assign_instance_profile.py | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Remove all Docker images | ||
DOCKER=$(command -v docker) || true | ||
if [ -n "$DOCKER" ]; then | ||
docker rmi -f "$(docker images -a -q)" &> /dev/null || true | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
aws s3 cp htmlcov/ s3://"$1"/coverage/"$2"/"$3"/htmlcov/ --recursive --acl public-read --region us-east-1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set +x | ||
. src/.evergreen/scripts/env.sh | ||
# shellcheck disable=SC2044 | ||
for i in $(find "$DRIVERS_TOOLS"/.evergreen "$PROJECT_DIRECTORY"/.evergreen -name \*.sh); do | ||
< "$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 |
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.
We can make the call to https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/setup.sh in this file.