From 4dac38264f4951c080337429ad962432e7c40aa7 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Thu, 13 Jun 2024 08:59:18 -0700 Subject: [PATCH] CSHARP-5122: Rotate credentials in Atlas testing URIs --- evergreen/evergreen.yml | 24 ++++--------------- .../ConnectivityTests.cs | 16 ++++++------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/evergreen/evergreen.yml b/evergreen/evergreen.yml index a87115b75bd..5543ab489e2 100644 --- a/evergreen/evergreen.yml +++ b/evergreen/evergreen.yml @@ -108,12 +108,7 @@ functions: script: | ${PREPARE_SHELL} 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 + git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config # Upload build artifacts that other tasks may depend on @@ -442,22 +437,10 @@ functions: - command: shell.exec type: test params: - silent: true + shell: "bash" working_dir: mongo-csharp-driver - include_expansions_in_env: - - "ATLAS_FREE" - - "ATLAS_FREE_SRV" - - "ATLAS_REPLICA" - - "ATLAS_REPLICA_SRV" - - "ATLAS_SHARDED" - - "ATLAS_SHARDED_SRV" - - "ATLAS_TLS11" - - "ATLAS_TLS11_SRV" - - "ATLAS_TLS12" - - "ATLAS_TLS12_SRV" - - "ATLAS_SERVERLESS" - - "ATLAS_SERVERLESS_SRV" script: | + . ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/atlas_connect . evergreen/run-atlas-connectivity-tests.sh run-gssapi-auth-tests: @@ -1261,6 +1244,7 @@ tasks: - name: atlas-connectivity-tests commands: + - func: assume-ec2-role - func: run-atlas-connectivity-tests - name: test-gssapi diff --git a/tests/AtlasConnectivity.Tests/ConnectivityTests.cs b/tests/AtlasConnectivity.Tests/ConnectivityTests.cs index 9d63764efd2..55928aedfe7 100644 --- a/tests/AtlasConnectivity.Tests/ConnectivityTests.cs +++ b/tests/AtlasConnectivity.Tests/ConnectivityTests.cs @@ -34,18 +34,18 @@ public ConnectivityTests(ITestOutputHelper testOutputHelper) // public methods [Theory] + [InlineData("ATLAS_REPL")] + [InlineData("ATLAS_SHRD")] [InlineData("ATLAS_FREE")] - [InlineData("ATLAS_FREE_SRV")] - [InlineData("ATLAS_REPLICA")] - [InlineData("ATLAS_REPLICA_SRV")] - [InlineData("ATLAS_SHARDED")] - [InlineData("ATLAS_SHARDED_SRV")] [InlineData("ATLAS_TLS11")] - [InlineData("ATLAS_TLS11_SRV")] [InlineData("ATLAS_TLS12")] - [InlineData("ATLAS_TLS12_SRV")] [InlineData("ATLAS_SERVERLESS")] - [InlineData("ATLAS_SERVERLESS_SRV")] + [InlineData("ATLAS_SRV_REPL")] + [InlineData("ATLAS_SRV_SHRD")] + [InlineData("ATLAS_SRV_FREE")] + [InlineData("ATLAS_SRV_TLS11")] + [InlineData("ATLAS_SRV_TLS12")] + [InlineData("ATLAS_SRV_SERVERLESS")] public void Connection_to_Atlas_should_work(string environmentVariableName) { var connectionString = Environment.GetEnvironmentVariable(environmentVariableName);