-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PYTHON-4721 - Create individualized scripts for all shell.exec comman…
…ds (#1997) Co-authored-by: Jib <[email protected]>
- Loading branch information
Showing
40 changed files
with
683 additions
and
430 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -o xtrace | ||
mkdir out_dir | ||
# shellcheck disable=SC2156 | ||
find "$MONGO_ORCHESTRATION_HOME" -name \*.log -exec sh -c 'x="{}"; mv $x $PWD/out_dir/$(basename $(dirname $x))_$(basename $x)' \; | ||
tar zcvf mongodb-logs.tar.gz -C out_dir/ . | ||
rm -rf out_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
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:-noauth} \ | ||
SSL=${SSL:-nossl} \ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
# Download all the task coverage files. | ||
aws s3 cp --recursive s3://"$1"/coverage/"$2"/"$3"/coverage/ coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/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 | ||
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 - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
set -o xtrace | ||
PYTHON_BINARY=${PYTHON_BINARY} bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh doctest:test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
MONGODB_URI=${MONGODB_URI} bash "${DRIVERS_TOOLS}"/.evergreen/run-load-balancer.sh start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
set -o xtrace | ||
export PYTHON_BINARY=${PYTHON_BINARY} | ||
bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh test:test-mockupdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
PROJECT_DIRECTORY=${PROJECT_DIRECTORY} | ||
bash "${PROJECT_DIRECTORY}"/.evergreen/run-perf-tests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# Disable xtrace | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash -eu | ||
|
||
# Example use: bash run-with-env.sh run-tests.sh {args...} | ||
|
||
# Parameter expansion to get just the current directory's name | ||
if [ "${PWD##*/}" == "src" ]; then | ||
. .evergreen/scripts/env.sh | ||
if [ -f ".evergreen/scripts/test-env.sh" ]; then | ||
. .evergreen/scripts/test-env.sh | ||
fi | ||
else | ||
. src/.evergreen/scripts/env.sh | ||
if [ -f "src/.evergreen/scripts/test-env.sh" ]; then | ||
. src/.evergreen/scripts/test-env.sh | ||
fi | ||
fi | ||
|
||
set -eu | ||
|
||
# shellcheck source=/dev/null | ||
. "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
if [ -n "${test_encryption}" ]; then | ||
./.evergreen/hatch.sh encryption:setup | ||
fi |
Oops, something went wrong.