Skip to content
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

GODRIVER-3367 Use subprocess.exec for Evergreen functions #1847

Merged
merged 28 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
20d345c
GODRIVER-3367 Use subprocess.exec for Evergreen functions
blink1073 Oct 3, 2024
58595ca
update more funcs
blink1073 Oct 3, 2024
fd4bc37
fixups
blink1073 Oct 3, 2024
5f27c26
more cleanup
blink1073 Oct 3, 2024
8ab946b
fix crypt_shared handling
blink1073 Oct 3, 2024
9f5ff3e
fix crypt_shared handling
blink1073 Oct 3, 2024
28e1976
fix crypt_shared handling and docker test
blink1073 Oct 3, 2024
0e96899
Revert "fix crypt_shared handling and docker test"
blink1073 Oct 3, 2024
46d40ad
Revert "Revert "fix crypt_shared handling and docker test""
blink1073 Oct 3, 2024
1f6161d
fix docker
blink1073 Oct 3, 2024
07de58c
fix handling of crypt shared
blink1073 Oct 3, 2024
fa5efd3
another docker fix
blink1073 Oct 3, 2024
9925d30
another docker fix
blink1073 Oct 3, 2024
4e51908
another docker fix
blink1073 Oct 3, 2024
adc90c5
another docker fix
blink1073 Oct 3, 2024
8039013
test docker
blink1073 Oct 3, 2024
532c3ee
fix docker
blink1073 Oct 3, 2024
8dad031
fix message
blink1073 Oct 4, 2024
69cc136
remove unused variable
blink1073 Oct 4, 2024
d6d72ab
use alias for run-task
blink1073 Oct 5, 2024
793769e
try top level aliases
blink1073 Oct 5, 2024
c8f152d
clean up alias
blink1073 Oct 5, 2024
38aa59f
update alias
blink1073 Oct 7, 2024
42c6c84
fix alias
blink1073 Oct 7, 2024
a320a38
fix handling of go path
blink1073 Oct 7, 2024
c023244
try goroot
blink1073 Oct 7, 2024
8814262
try goroot
blink1073 Oct 7, 2024
e9094c5
Merge branch 'master' of github.com:mongodb/mongo-go-driver into GODR…
blink1073 Oct 8, 2024
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
515 changes: 216 additions & 299 deletions .evergreen/config.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .evergreen/setup-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export GOPATH="$GOPATH"
export GOCACHE="$GOCACHE"
export DRIVERS_TOOLS="$DRIVERS_TOOLS"
export PROJECT_DIRECTORY="$PROJECT_DIRECTORY"
export MONGODB_BINARIES="$MONGODB_BINARIES"
export PATH="$PATH"
EOT

Expand Down
4 changes: 3 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ tasks:
status:
- test -d install || test -d /cygdrive/c/libmongocrypt/bin

run-docker: bash etc/run_docker.sh
run-docker: bash etc/run_docker.sh {{.CLI_ARGS}}

run-fuzz: bash etc/run-fuzz.sh

cherry-picker: bash etc/cherry-picker.sh

pr-task: bash etc/pr-task.sh

# Lint with various GOOS and GOARCH tasks to catch static analysis failures that may only affect
# specific operating systems or architectures. For example, staticcheck will only check for 64-bit
# alignment of atomically accessed variables on 32-bit architectures (see
Expand Down
2 changes: 1 addition & 1 deletion etc/docker_entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export PATH="$MONGODB_BINARIES:$HOME/go/bin:$PATH"
task setup-test

# Run the test.
task evg-test
task $TASKFILE_TARGET
10 changes: 6 additions & 4 deletions etc/golangci-lint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -ex

# Keep this in sync with go version used in static-analysis Evergreen build variant.
GO_VERSION=1.22.8
GOLANGCI_LINT_VERSION=1.60.1

Expand All @@ -10,12 +11,13 @@ export GOOS=
GOARCH_ORIG=${GOARCH:-}
export GOARCH=

# Keep this in sync with go version used in static-analysis Evergreen build variant.
go install golang.org/dl/go$GO_VERSION@latest
go$GO_VERSION download
PATH="$(go$GO_VERSION env GOROOT)/bin:$PATH"
go${GO_VERSION} download
GOROOT="$(go${GO_VERSION} env GOROOT)"
PATH="$GOROOT/bin:$PATH"
export PATH
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION
export GOROOT
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v${GOLANGCI_LINT_VERSION}

export GOOS=$GOOS_ORIG
export GOARCH=$GOARCH_ORIG
Expand Down
30 changes: 30 additions & 0 deletions etc/pr-task.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -eu

VARLIST=(
PR_TASK
COMMIT
DRIVERS_TOOLS
)

# Ensure that all variables required to run the test are set, otherwise throw
# an error.
for VARNAME in "${VARLIST[@]}"; do
[[ -z "${!VARNAME:-}" ]] && echo "ERROR: $VARNAME not set" && exit 1;
done

case $PR_TASK in
apply-labels)
CONFIG=$(pwd)/.github/labeler.yml
SCRIPT="${DRIVERS_TOOLS}/.evergreen/github_app/apply-labels.sh"
bash $SCRIPT -l $CONFIG -h $COMMIT -o "mongodb" -n "mongo-go-driver"
;;
assign-reviewer)
CONFIG=$(pwd)/.github/reviewers.txt
SCRIPT="${DRIVERS_TOOLS}/.evergreen/github_app/assign-reviewer.sh"
bash $SCRIPT -p $CONFIG -h $COMMIT -o "mongodb" -n "mongo-go-driver"
;;
backport-pr)
bash ${DRIVERS_TOOLS}/.evergreen/github_app/backport-pr.sh mongodb mongo-go-driver $COMMIT
;;
esac
10 changes: 10 additions & 0 deletions etc/run-mongodb-aws-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ set -o errexit # Exit the script with error if any of the commands fail

echo "Running MONGODB-AWS authentication tests"

if [ "$1" == "ec2" ] && [ "${SKIP_EC2_AUTH_TEST:-}" == "true" ]; then
echo "This platform does not support the EC2 auth test, skipping..."
exit 0
fi

if [ "$1" == "web-identity" ] && [ "${SKIP_WEB_IDENTITY_AUTH_TEST:-}" == "true" ]; then
echo "This platform does not support the web identity auth test, skipping..."
exit 0
fi

# Handle credentials and environment setup.
. $DRIVERS_TOOLS/.evergreen/auth_aws/aws_setup.sh $1

Expand Down
23 changes: 21 additions & 2 deletions etc/setup-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ case ${1:-} in
atlas-connect)
. $DRIVERS_TOOLS/.evergreen/secrets_handling/setup-secrets.sh drivers/atlas_connect
;;
load-balancer)
# Verify that the required LB URI expansions are set to ensure that the test runner can correctly connect to
# the LBs.
if [ -z "${SINGLE_MONGOS_LB_URI}" ]; then
echo "SINGLE_MONGOS_LB_URI must be set for testing against LBs"
exit 1
fi
if [ -z "${MULTI_MONGOS_LB_URI}" ]; then
echo "MULTI_MONGOS_LB_URI must be set for testing against LBs"
exit 1
fi
MONGODB_URI="${SINGLE_MONGOS_LB_URI}"
LOAD_BALANCER="true"
;;
esac

# Handle encryption.
Expand All @@ -51,8 +65,8 @@ if [[ "${GO_BUILD_TAGS}" =~ cse ]]; then
LD_LIBRARY_PATH=$(pwd)/install/libmongocrypt/lib64

if [ "$(uname -s)" = "Darwin" ]; then
PKG_CONFIG_PATH=$(pwd)/install/libmongocrypt/lib/pkgconfig
DYLD_FALLBACK_LIBRARY_PATH=$(pwd)/install/libmongocrypt/lib
PKG_CONFIG_PATH=$(pwd)/install/libmongocrypt/lib/pkgconfig
DYLD_FALLBACK_LIBRARY_PATH=$(pwd)/install/libmongocrypt/lib
fi

if [ "${SKIP_CRYPT_SHARED_LIB:-''}" = "true" ]; then
Expand Down Expand Up @@ -116,6 +130,11 @@ if [ -n "${SERVERLESS:-}" ]; then
echo "SERVERLESS_ATLAS_PASSWORD=$SERVERLESS_ATLAS_PASSWORD" >> .test.env
fi

if [ -n "${LOAD_BALANCER:-}" ];then
echo "SINGLE_MONGOS_LB_URI=${SINGLE_MONGOS_LB_URI}" >> .test.env
echo "MULTI_MONGOS_LB_URI=${MULTI_MONGOS_LB_URI}" >> .test.env
fi

# Add secrets to the test file.
if [ -f "secrets-export.sh" ]; then
while read p; do
Expand Down
Loading