Skip to content

Evergreen clean up and migration to use AWS secrets manager #1728

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,486 changes: 1,763 additions & 1,723 deletions .evergreen/.evg.yml

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions .evergreen/git-archive.sh

This file was deleted.

32 changes: 32 additions & 0 deletions .evergreen/gradle-cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail

############################################
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "Enable caching"
echo "org.gradle.caching=true" >> gradle.properties
echo "kotlin.caching.enabled=true" >> gradle.properties

echo "Compiling JVM drivers"
./gradlew -version
./gradlew classes --parallel

# Copy the Gradle dependency cache to the gradle read only dependency cache directory.
if [ -n "$GRADLE_RO_DEP_CACHE" ];then
echo "Copying Gradle dependency cache to $GRADLE_RO_DEP_CACHE"
mkdir -p $GRADLE_RO_DEP_CACHE

# https://docs.gradle.org/current/userguide/dependency_caching.html#sec:cache-copy
# Gradle suggests removing the "*.lock" files and the `gc.properties` file for saving/restoring cache
cp -r $HOME/.gradle/caches/modules-2 "$GRADLE_RO_DEP_CACHE"
find "$GRADLE_RO_DEP_CACHE" -name "*.lock" -type f | xargs rm -f
find "$GRADLE_RO_DEP_CACHE" -name "gc.properties" -type f | xargs rm -f

echo "Copied Gradle dependency cache to $GRADLE_RO_DEP_CACHE"
fi
19 changes: 0 additions & 19 deletions .evergreen/javaConfig.bash

This file was deleted.

2 changes: 1 addition & 1 deletion .evergreen/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -o errexit # Exit the script with error if any of the commands fail
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

RELEASE=${RELEASE:false}

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-atlas-data-lake-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -o errexit # Exit the script with error if any of the commands fail
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "Running Atlas Data Lake driver tests"

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-atlas-search-index-management-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -o errexit
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")"
source "${RELATIVE_DIR_PATH}/javaConfig.bash"
source "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "Running Atlas Search tests"
./gradlew -version
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-atlas-search-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -o errexit
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")"
source "${RELATIVE_DIR_PATH}/javaConfig.bash"
source "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "Running Atlas Search tests"
./gradlew -version
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-connectivity-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -o errexit
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "Running connectivity tests with Java ${JAVA_VERSION}"

Expand Down
7 changes: 4 additions & 3 deletions .evergreen/run-csfle-aws-from-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ set -o errexit # Exit the script with error if any of the commands fail
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "Running CSFLE AWS from environment tests"

./gradlew -version
Expand All @@ -21,12 +22,12 @@ export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}

./gradlew --stacktrace --info -Dorg.mongodb.test.uri=${MONGODB_URI} \
--no-build-cache driver-sync:cleanTest driver-sync:test --tests ClientSideEncryptionAwsCredentialFromEnvironmentTest
driver-sync:cleanTest driver-sync:test --tests ClientSideEncryptionAwsCredentialFromEnvironmentTest
first=$?
echo $first

./gradlew --stacktrace --info -Dorg.mongodb.test.uri=${MONGODB_URI} \
--no-build-cache driver-reactive-streams:cleanTest driver-reactive-streams:test --tests ClientSideEncryptionAwsCredentialFromEnvironmentTest
driver-reactive-streams:cleanTest driver-reactive-streams:test --tests ClientSideEncryptionAwsCredentialFromEnvironmentTest
second=$?
echo $second

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-csfle-tests-with-mongocryptd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set -o errexit # Exit the script with error if any of the commands fail
MONGODB_URI=${MONGODB_URI:-}

RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

############################################
# Functions #
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-deployed-lambda-aws-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail

RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

# compiled outside of lambda workflow. Note "SkipBuild: True" in template.yaml
./gradlew -version
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-graalvm-native-image-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
set -o errexit

readonly RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")"
source "${RELATIVE_DIR_PATH}/javaConfig.bash"
source "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "MONGODB_URI: ${MONGODB_URI}"
echo "JAVA_HOME: ${JAVA_HOME}"
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-gssapi-auth-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set -o errexit # Exit the script with error if any of the commands fail
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"
echo "Running GSSAPI authentication tests with login context name '${LOGIN_CONTEXT_NAME}'"

echo ${KEYTAB_BASE64} | base64 -d > ${PROJECT_DIRECTORY}/.evergreen/drivers.keytab
Expand Down
7 changes: 4 additions & 3 deletions .evergreen/run-kms-tls-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@ set -o errexit # Exit the script with error if any of the commands fail
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"
echo "Running KMS TLS tests"

cp ${JAVA_HOME}/lib/security/cacerts mongo-truststore
${JAVA_HOME}/bin/keytool -importcert -trustcacerts -file ${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem -keystore mongo-truststore -storepass changeit -storetype JKS -noprompt

export GRADLE_EXTRA_VARS="-Pssl.enabled=true -Pssl.trustStoreType=jks -Pssl.trustStore=`pwd`/mongo-truststore -Pssl.trustStorePassword=changeit"
export KMS_TLS_ERROR_TYPE=${KMS_TLS_ERROR_TYPE}

./gradlew -version

./gradlew --stacktrace --info ${GRADLE_EXTRA_VARS} -Dorg.mongodb.test.uri=${MONGODB_URI} \
-Dorg.mongodb.test.kms.tls.error.type=${KMS_TLS_ERROR_TYPE} \
--no-build-cache driver-sync:cleanTest driver-sync:test --tests ClientSideEncryptionKmsTlsTest
driver-sync:cleanTest driver-sync:test --tests ClientSideEncryptionKmsTlsTest
first=$?
echo $first

./gradlew --stacktrace --info ${GRADLE_EXTRA_VARS} -Dorg.mongodb.test.uri=${MONGODB_URI} \
-Dorg.mongodb.test.kms.tls.error.type=${KMS_TLS_ERROR_TYPE} \
--no-build-cache driver-reactive-streams:cleanTest driver-reactive-streams:test --tests ClientSideEncryptionKmsTlsTest
driver-reactive-streams:cleanTest driver-reactive-streams:test --tests ClientSideEncryptionKmsTlsTest
second=$?
echo $second

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-kotlin-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TOPOLOGY=${TOPOLOGY:-standalone}
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"


if [ "$SSL" != "nossl" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-load-balancer-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MONGODB_URI=${MONGODB_URI:-}
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

if [ "$SSL" != "nossl" ]; then
# We generate the keystore and truststore on every run with the certs in the drivers-tools repo
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-mongodb-aws-ecs-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fi
cd src

RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

./gradlew -version

Expand Down
4 changes: 2 additions & 2 deletions .evergreen/run-mongodb-aws-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -o errexit # Exit the script with error if any of the commands fail
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "Running MONGODB-AWS authentication tests"

Expand All @@ -28,4 +28,4 @@ echo "Running tests with Java ${JAVA_VERSION}"
# to run cleanTest to ensure that the test actually executes each run
./gradlew -PjavaVersion="${JAVA_VERSION}" -Dorg.mongodb.test.uri="${MONGODB_URI}" \
-Dorg.mongodb.test.aws.credential.provider="${AWS_CREDENTIAL_PROVIDER}" \
--stacktrace --debug --info --no-build-cache driver-core:cleanTest driver-core:test --tests AwsAuthenticationSpecification
--stacktrace --debug --info driver-core:cleanTest driver-core:test --tests AwsAuthenticationSpecification
4 changes: 2 additions & 2 deletions .evergreen/run-mongodb-oidc-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ $OIDC_ENV == "test" ]; then
source ${DRIVERS_TOOLS}/.evergreen/auth_oidc/secrets-export.sh
# java will not need to be installed, but we need to config
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
source "${RELATIVE_DIR_PATH}/javaConfig.bash"
source "${RELATIVE_DIR_PATH}/setup-env.bash"
elif [ $OIDC_ENV == "azure" ]; then
source ./env.sh
elif [ $OIDC_ENV == "gcp" ]; then
Expand Down Expand Up @@ -50,6 +50,6 @@ REPLACEMENT="mongodb://$OIDC_ADMIN_USER:$OIDC_ADMIN_PWD@"
ADMIN_URI=${MONGODB_URI/$TO_REPLACE/$REPLACEMENT}

./gradlew -Dorg.mongodb.test.uri="$ADMIN_URI" \
--stacktrace --debug --info --no-build-cache driver-core:cleanTest \
--stacktrace --debug --info driver-core:cleanTest \
driver-sync:test --tests OidcAuthenticationProseTests --tests UnifiedAuthTest \
driver-reactive-streams:test --tests OidcAuthenticationAsyncProseTests \
2 changes: 1 addition & 1 deletion .evergreen/run-ocsp-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -o errexit # Exit the script with error if any of the commands fail
OCSP_MUST_STAPLE=${OCSP_MUST_STAPLE:-}
OCSP_TLS_SHOULD_SUCCEED=${OCSP_TLS_SHOULD_SUCCEED:-}
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

############################################
# Functions #
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-perf-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tar xf single_and_multi_document.tgz
cd ..

RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

export TEST_PATH="${PROJECT_DIRECTORY}/driver-performance-test-data/"
export OUTPUT_FILE="${PROJECT_DIRECTORY}/results.json"
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-plain-auth-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -o errexit # Exit the script with error if any of the commands fail
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "Running PLAIN authentication tests"

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-reactive-streams-tck-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o errexit # Exit the script with error if any of the commands fail
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "Running Reactive Streams TCK tests with Java ${JAVA_VERSION}"

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-scala-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TOPOLOGY=${TOPOLOGY:-standalone}
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"


if [ "$SSL" != "nossl" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-serverless-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -o errexit # Exit the script with error if any of the commands fail
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

echo "Running serverless tests with Java ${JAVA_VERSION}"

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-socket-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COMPRESSOR=${COMPRESSOR:-}
# Main Program #
############################################
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

SOCKET_REGEX='(.*)localhost:([0-9]+)?(.*)'
while [[ $MONGODB_URI =~ $SOCKET_REGEX ]]; do
Expand Down
4 changes: 2 additions & 2 deletions .evergreen/run-socks5-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [ "Windows_NT" == "$OS" ]; then
fi

RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

############################################
# Functions #
Expand Down Expand Up @@ -84,4 +84,4 @@ echo "Running Socks5 tests with Java ${JAVA_VERSION} over $SSL for $TOPOLOGY and
provision_ssl
./gradlew -version
run_socks5_proxy
run_socks5_prose_tests
run_socks5_prose_tests
2 changes: 1 addition & 1 deletion .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if [ "${SSL}" = "ssl" ] && [ "${STREAM_TYPE}" = "netty" ] && [ "${NETTY_SSL_PROV
fi

RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"
. "${RELATIVE_DIR_PATH}/javaConfig.bash"
. "${RELATIVE_DIR_PATH}/setup-env.bash"

############################################
# Functions #
Expand Down
Loading