Skip to content

Commit

Permalink
Merge branch 'v1' into godriver2962-remove-op-setters-2
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdale authored Sep 16, 2023
2 parents 2d5120b + 59f7519 commit 934fba2
Show file tree
Hide file tree
Showing 47 changed files with 1,828 additions and 377 deletions.
126 changes: 54 additions & 72 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ functions:
export UPLOAD_BUCKET="$UPLOAD_BUCKET"
export PROJECT="$PROJECT"
export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
export PKG_CONFIG_PATH=$(pwd)/install/libmongocrypt/lib/pkgconfig:$(pwd)/install/mongo-c-driver/lib/pkgconfig
export LD_LIBRARY_PATH=$(pwd)/install/libmongocrypt/lib
export PKG_CONFIG_PATH=$(pwd)/install/libmongocrypt/lib64/pkgconfig:$(pwd)/install/mongo-c-driver/lib/pkgconfig
export LD_LIBRARY_PATH=$(pwd)/install/libmongocrypt/lib64
export PATH="$PATH"
EOT
# See what we variables we've set.
Expand Down Expand Up @@ -245,6 +245,7 @@ functions:
params:
shell: "bash"
script: |
set -x
${PREPARE_SHELL}
MONGODB_VERSION=${VERSION} \
Expand Down Expand Up @@ -437,37 +438,18 @@ functions:
make -s evg-test-enterprise-auth
run-atlas-test:
- command: ec2.assume_role
params:
role_arn: "${aws_test_secrets_role}"
- command: shell.exec
type: test
params:
shell: "bash"
working_dir: src/go.mongodb.org/mongo-driver
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
script: |
# DO NOT ECHO WITH XTRACE
if [ "Windows_NT" = "$OS" ]; then
export GOPATH=$(cygpath -w $(dirname $(dirname $(dirname `pwd`))))
export GOCACHE=$(cygpath -w "$(pwd)/.cache")
else
export GOPATH=$(dirname $(dirname $(dirname `pwd`)))
export GOCACHE="$(pwd)/.cache"
fi;
export GOPATH="$GOPATH"
export GOROOT="${GO_DIST}"
export GOCACHE="$GOCACHE"
export PATH="${GCC_PATH}:${GO_DIST}/bin:$PATH"
export ATLAS_FREE="${atlas_free_tier_uri}"
export ATLAS_REPLSET="${atlas_replica_set_uri}"
export ATLAS_SHARD="${atlas_sharded_uri}"
export ATLAS_TLS11="${atlas_tls_v11_uri}"
export ATLAS_TLS12="${atlas_tls_v12_uri}"
export ATLAS_FREE_SRV="${atlas_free_tier_uri_srv}"
export ATLAS_REPLSET_SRV="${atlas_replica_set_uri_srv}"
export ATLAS_SHARD_SRV="${atlas_sharded_uri_srv}"
export ATLAS_TLS11_SRV="${atlas_tls_v11_uri_srv}"
export ATLAS_TLS12_SRV="${atlas_tls_v12_uri_srv}"
export ATLAS_SERVERLESS="${atlas_serverless_uri}"
export ATLAS_SERVERLESS_SRV="${atlas_serverless_uri_srv}"
make -s evg-test-atlas
${PREPARE_SHELL}
bash etc/run-atlas-test.sh
run-ocsp-test:
- command: shell.exec
Expand Down Expand Up @@ -2101,7 +2083,7 @@ tasks:
export GCPKMS_PROJECT=${GCPKMS_PROJECT}
export GCPKMS_ZONE=${GCPKMS_ZONE}
export GCPKMS_INSTANCENAME=${GCPKMS_INSTANCENAME}
tar czf testgcpkms.tgz ./testkms ./install/libmongocrypt/lib/libmongocrypt.*
tar czf testgcpkms.tgz ./testkms ./install/libmongocrypt/lib64/libmongocrypt.*
GCPKMS_SRC=testgcpkms.tgz GCPKMS_DST=$GCPKMS_INSTANCENAME: $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/copy-file.sh
echo "Copying files ... end"
Expand All @@ -2120,7 +2102,7 @@ tasks:
export GCPKMS_PROJECT=${GCPKMS_PROJECT}
export GCPKMS_ZONE=${GCPKMS_ZONE}
export GCPKMS_INSTANCENAME=${GCPKMS_INSTANCENAME}
GCPKMS_CMD="LD_LIBRARY_PATH=./install/libmongocrypt/lib MONGODB_URI='mongodb://localhost:27017' PROVIDER='gcp' ./testkms" $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh
GCPKMS_CMD="LD_LIBRARY_PATH=./install/libmongocrypt/lib64 MONGODB_URI='mongodb://localhost:27017' PROVIDER='gcp' ./testkms" $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh
- name: "testgcpkms-fail-task"
# testgcpkms-fail-task runs in a non-GCE environment.
Expand All @@ -2138,7 +2120,7 @@ tasks:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
make build-kms-test
echo "Building build-kms-test ... end"
LD_LIBRARY_PATH=./install/libmongocrypt/lib \
LD_LIBRARY_PATH=./install/libmongocrypt/lib64 \
MONGODB_URI='mongodb://localhost:27017/' \
EXPECT_ERROR='unable to retrieve GCP credentials' \
PROVIDER='gcp' \
Expand All @@ -2162,7 +2144,7 @@ tasks:
export AWS_ACCESS_KEY_ID="${cse_aws_access_key_id}"
export AWS_SECRET_ACCESS_KEY="${cse_aws_secret_access_key}"
LD_LIBRARY_PATH=./install/libmongocrypt/lib \
LD_LIBRARY_PATH=./install/libmongocrypt/lib64 \
MONGODB_URI='${atlas_free_tier_uri}' \
PROVIDER='aws' \
./testkms
Expand All @@ -2184,9 +2166,9 @@ tasks:
make build-kms-test
echo "Building build-kms-test ... end"
LD_LIBRARY_PATH=./install/libmongocrypt/lib \
LD_LIBRARY_PATH=./install/libmongocrypt/lib64 \
MONGODB_URI='${atlas_free_tier_uri}' \
EXPECT_ERROR='unable to retrieve aws credentials' \
EXPECT_ERROR='status=400' \
PROVIDER='aws' \
./testkms
Expand All @@ -2210,7 +2192,7 @@ tasks:
export AZUREKMS_VMNAME=${AZUREKMS_VMNAME}
echo '${testazurekms_privatekey}' > /tmp/testazurekms.prikey
export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms.prikey
tar czf testazurekms.tgz ./testkms ./install/libmongocrypt/lib/libmongocrypt.*
tar czf testazurekms.tgz ./testkms ./install/libmongocrypt/lib64/libmongocrypt.*
AZUREKMS_SRC=testazurekms.tgz AZUREKMS_DST=/tmp $DRIVERS_TOOLS/.evergreen/csfle/azurekms/copy-file.sh
echo "Copying files ... end"
echo "Untarring file ... begin"
Expand All @@ -2228,7 +2210,7 @@ tasks:
export AZUREKMS_VMNAME=${AZUREKMS_VMNAME}
echo '${testazurekms_privatekey}' > /tmp/testazurekms.prikey
export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms.prikey
AZUREKMS_CMD="LD_LIBRARY_PATH=./install/libmongocrypt/lib MONGODB_URI='mongodb://localhost:27017' PROVIDER='azure' ./testkms" $DRIVERS_TOOLS/.evergreen/csfle/azurekms/run-command.sh
AZUREKMS_CMD="LD_LIBRARY_PATH=./install/libmongocrypt/lib64 MONGODB_URI='mongodb://localhost:27017' PROVIDER='azure' AZUREKMS_KEY_NAME='${AZUREKMS_KEY_NAME}' AZUREKMS_KEY_VAULT_ENDPOINT='${AZUREKMS_KEY_VAULT_ENDPOINT}' ./testkms" $DRIVERS_TOOLS/.evergreen/csfle/azurekms/run-command.sh
- name: "testazurekms-fail-task"
# testazurekms-fail-task runs without environment variables.
Expand All @@ -2247,10 +2229,10 @@ tasks:
make build-kms-test
echo "Building build-kms-test ... end"
LD_LIBRARY_PATH=./install/libmongocrypt/lib \
LD_LIBRARY_PATH=./install/libmongocrypt/lib64 \
MONGODB_URI='mongodb://localhost:27017' \
EXPECT_ERROR='unable to retrieve azure credentials' \
PROVIDER='azure' \
PROVIDER='azure' AZUREKMS_KEY_NAME='${AZUREKMS_KEY_NAME}' AZUREKMS_KEY_VAULT_ENDPOINT='${AZUREKMS_KEY_VAULT_ENDPOINT}' \
./testkms
- name: "test-fuzz"
Expand Down Expand Up @@ -2330,9 +2312,9 @@ axes:
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
GO_DIST: "C:\\golang\\go1.20"
VENV_BIN_DIR: "Scripts"
- id: "ubuntu1604-64-go-1-20"
display_name: "Ubuntu 16.04"
run_on: ubuntu1604-build
- id: "rhel87-64-go-1-20"
display_name: "RHEL 8.7"
run_on: rhel8.7-large
variables:
GO_DIST: "/opt/golang/go1.20"
- id: "macos11-go-1-20"
Expand All @@ -2354,9 +2336,9 @@ axes:
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
GO_DIST: "C:\\golang\\go1.20"
VENV_BIN_DIR: "Scripts"
- id: "ubuntu1804-64-go-1-20"
display_name: "Ubuntu 18.04"
run_on: ubuntu1804-build
- id: "rhel87-64-go-1-20"
display_name: "RHEL 8.7"
run_on: rhel8.7-large
variables:
GO_DIST: "/opt/golang/go1.20"
- id: "macos11-go-1-20"
Expand All @@ -2366,13 +2348,12 @@ axes:
variables:
GO_DIST: "/opt/golang/go1.20"

# OCSP linux tasks need to run against this OS since stapling is disabled on Ubuntu 18.04 (SERVER-51364)
- id: ocsp-rhel-70
- id: ocsp-rhel-87
display_name: OS
values:
- id: "rhel70-go-1-20"
display_name: "RHEL 7.0"
run_on: rhel70-build
- id: "rhel87-go-1-20"
display_name: "RHEL 8.7"
run_on: rhel8.7-large
variables:
GO_DIST: "/opt/golang/go1.20"

Expand All @@ -2387,6 +2368,8 @@ axes:
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
GO_DIST: "C:\\golang\\go1.20"
SKIP_ECS_AUTH_TEST: true
# TODO(BUILD-17329): Update this to Ubuntu 22 after we add a new ECS task
# definition.
- id: "ubuntu1804-64-go-1-20"
display_name: "Ubuntu 18.04"
run_on: ubuntu1804-test
Expand All @@ -2405,18 +2388,18 @@ axes:
- id: os-faas-80
display_name: OS
values:
- id: "rhel80-large-go-1-20"
display_name: "RHEL 8.0"
run_on: rhel80-large
- id: "rhel87-large-go-1-20"
display_name: "RHEL 8.7"
run_on: rhel8.7-large
variables:
GO_DIST: "/opt/golang/go1.20"

- id: os-serverless
display_name: OS
values:
- id: "ubuntu2204-go-1-20"
display_name: "Ubuntu 22.04"
run_on: ubuntu2204-small
- id: "rhel87-go-1-20"
display_name: "RHEL 8.7"
run_on: rhel8.7-small
variables:
GO_DIST: "/opt/golang/go1.20"

Expand Down Expand Up @@ -2639,7 +2622,7 @@ buildvariants:
- name: static-analysis
display_name: "Static Analysis"
run_on:
- ubuntu1804-build
- rhel8.7-large
expansions:
GO_DIST: "/opt/golang/go1.20"
tasks:
Expand All @@ -2648,7 +2631,7 @@ buildvariants:
- name: perf
display_name: "Performance"
run_on:
- ubuntu1804-build
- rhel8.7-large
expansions:
GO_DIST: "/opt/golang/go1.20"
tasks:
Expand All @@ -2657,16 +2640,16 @@ buildvariants:
- name: build-check
display_name: "Compile Only Checks"
run_on:
- ubuntu1804-test
- rhel8.7-large
expansions:
GO_DIST: "/opt/golang/go1.20"
tasks:
- name: ".compile-check"

- name: atlas-test
display_name: "Atlas test"
run_on:
- ubuntu1804-build
- rhel8.7-large
expansions:
GO_DIST: "/opt/golang/go1.20"
tasks:
Expand All @@ -2675,7 +2658,7 @@ buildvariants:
- name: atlas-data-lake-test
display_name: "Atlas Data Lake Test"
run_on:
- ubuntu1804-build
- rhel8.7-large
expansions:
GO_DIST: "/opt/golang/go1.20"
tasks:
Expand Down Expand Up @@ -2712,8 +2695,8 @@ buildvariants:
- name: "aws-auth-test"

- matrix_name: "ocsp-test"
matrix_spec: { version: ["4.4", "5.0", "6.0", "7.0", "latest"], ocsp-rhel-70: ["rhel70-go-1-20"] }
display_name: "OCSP ${version} ${ocsp-rhel-70}"
matrix_spec: { version: ["4.4", "5.0", "6.0", "7.0", "latest"], ocsp-rhel-87: ["rhel87-go-1-20"] }
display_name: "OCSP ${version} ${ocsp-rhel-87}"
batchtime: 20160 # Use a batchtime of 14 days as suggested by the OCSP test README
tasks:
- name: ".ocsp"
Expand All @@ -2735,7 +2718,7 @@ buildvariants:
- name: ".ocsp-rsa !.ocsp-staple"

- matrix_name: "race-test"
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-20"] }
matrix_spec: { version: ["latest"], os-ssl-40: ["rhel87-64-go-1-20"] }
display_name: "Race Detector Test"
tasks:
- name: ".race"
Expand All @@ -2747,14 +2730,13 @@ buildvariants:
- name: ".versioned-api"

- matrix_name: "kms-tls-test"
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-20"] }
matrix_spec: { version: ["latest"], os-ssl-40: ["rhel87-64-go-1-20"] }
display_name: "KMS TLS ${os-ssl-40}"
tasks:
- name: ".kms-tls"

- matrix_name: "load-balancer-test"
# The LB software is only available on Ubuntu 18.04, so we don't test on all OSes.
matrix_spec: { version: ["5.0", "6.0", "7.0", "latest", "rapid"], os-ssl-40: ["ubuntu1804-64-go-1-20"] }
matrix_spec: { version: ["5.0", "6.0", "7.0", "latest", "rapid"], os-ssl-40: ["rhel87-64-go-1-20"] }
display_name: "Load Balancer Support ${version} ${os-ssl-40}"
tasks:
- name: ".load-balancer"
Expand All @@ -2766,28 +2748,28 @@ buildvariants:
- "serverless_task_group"

- matrix_name: "kms-kmip-test"
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-20"] }
matrix_spec: { version: ["latest"], os-ssl-40: ["rhel87-64-go-1-20"] }
display_name: "KMS KMIP ${os-ssl-40}"
tasks:
- name: ".kms-kmip"

- matrix_name: "fuzz-test"
matrix_spec: { version: ["5.0"], os-ssl-40: ["ubuntu1804-64-go-1-20"] }
matrix_spec: { version: ["5.0"], os-ssl-40: ["rhel87-64-go-1-20"] }
display_name: "Fuzz ${version} ${os-ssl-40}"
tasks:
- name: "test-fuzz"
batchtime: 1440 # Run at most once per 24 hours.

- matrix_name: "faas-test"
matrix_spec: { version: ["latest"], os-faas-80: ["rhel80-large-go-1-20"] }
matrix_spec: { version: ["latest"], os-faas-80: ["rhel87-large-go-1-20"] }
display_name: "FaaS ${version} ${os-faas-80}"
tasks:
- test-aws-lambda-task-group

- name: testgcpkms-variant
display_name: "GCP KMS"
run_on:
- debian11-small
- rhel8.7-small
expansions:
GO_DIST: "/opt/golang/go1.20"
tasks:
Expand All @@ -2798,7 +2780,7 @@ buildvariants:
- name: testawskms-variant
display_name: "AWS KMS"
run_on:
- debian11-small
- rhel8.7-small
expansions:
GO_DIST: "/opt/golang/go1.20"
tasks:
Expand All @@ -2808,7 +2790,7 @@ buildvariants:
- name: testazurekms-variant
display_name: "AZURE KMS"
run_on:
- debian11-small
- rhel8.7-small
expansions:
GO_DIST: "/opt/golang/go1.20"
tasks:
Expand Down
4 changes: 2 additions & 2 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ fi
export GOROOT="${GOROOT}"
export PATH="${GOROOT}/bin:${GCC_PATH}:$GOPATH/bin:$PATH"
export PROJECT="${project}"
export PKG_CONFIG_PATH=$(pwd)/install/libmongocrypt/lib/pkgconfig:$(pwd)/install/mongo-c-driver/lib/pkgconfig
export LD_LIBRARY_PATH=$(pwd)/install/libmongocrypt/lib
export PKG_CONFIG_PATH=$(pwd)/install/libmongocrypt/lib64/pkgconfig:$(pwd)/install/mongo-c-driver/lib/pkgconfig
export LD_LIBRARY_PATH=$(pwd)/install/libmongocrypt/lib64
export GOFLAGS=-mod=vendor

SSL=${SSL:-nossl}
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ internal/test/compilecheck/compilecheck.so

# Ignore api report files
api-report.md
api-report.txt
api-report.txt

# Ignore secrets files
secrets-expansion.yml
secrets-export.sh
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ATLAS_URIS = "$(ATLAS_FREE)" "$(ATLAS_REPLSET)" "$(ATLAS_SHARD)" "$(ATLAS_TLS11)" "$(ATLAS_TLS12)" "$(ATLAS_FREE_SRV)" "$(ATLAS_REPLSET_SRV)" "$(ATLAS_SHARD_SRV)" "$(ATLAS_TLS11_SRV)" "$(ATLAS_TLS12_SRV)" "$(ATLAS_SERVERLESS)" "$(ATLAS_SERVERLESS_SRV)"
TEST_TIMEOUT = 1800

### Utility targets. ###
Expand Down Expand Up @@ -128,10 +127,6 @@ build-aws-ecs-test:
evg-test:
go test -exec "env PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)" $(BUILD_TAGS) -v -timeout $(TEST_TIMEOUT)s -p 1 ./... >> test.suite

.PHONY: evg-test-atlas
evg-test-atlas:
go run ./cmd/testatlas/main.go $(ATLAS_URIS)

.PHONY: evg-test-atlas-data-lake
evg-test-atlas-data-lake:
ATLAS_DATA_LAKE_INTEGRATION_TEST=true go test -v ./mongo/integration -run TestUnifiedSpecs/atlas-data-lake-testing >> spec_test.suite
Expand Down
Loading

0 comments on commit 934fba2

Please sign in to comment.