Skip to content

Commit 457fdd0

Browse files
authored
CSHARP-5731: Fix atlas search tests failures (#1775)
1 parent d12cb58 commit 457fdd0

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

evergreen/evergreen.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ functions:
526526
echo "Response Body: $response_body"
527527
echo "HTTP Status: $http_status"
528528
529-
assume-ec2-role:
529+
assume-aws-test-secrets-role:
530530
- command: ec2.assume_role
531531
params:
532532
role_arn: ${aws_test_secrets_role}
@@ -665,9 +665,12 @@ functions:
665665
params:
666666
working_dir: mongo-csharp-driver
667667
include_expansions_in_env:
668-
- "ATLAS_SEARCH"
668+
- "AWS_ACCESS_KEY_ID"
669+
- "AWS_SECRET_ACCESS_KEY"
670+
- "AWS_SESSION_TOKEN"
669671
script: |
670672
${PREPARE_SHELL}
673+
. ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/atlas-qa
671674
evergreen/run-atlas-search-test.sh
672675
673676
run-atlas-search-index-helpers-test:
@@ -1250,7 +1253,7 @@ tasks:
12501253

12511254
- name: atlas-connectivity-tests
12521255
commands:
1253-
- func: assume-ec2-role
1256+
- func: assume-aws-test-secrets-role
12541257
- func: run-atlas-connectivity-tests
12551258

12561259
- name: test-gssapi
@@ -1356,12 +1359,13 @@ tasks:
13561359

13571360
- name: atlas-data-lake-test
13581361
commands:
1359-
- func: assume-ec2-role
1362+
- func: assume-aws-test-secrets-role
13601363
- func: bootstrap-mongohoused
13611364
- func: run-atlas-data-lake-test
13621365

13631366
- name: atlas-search-test
13641367
commands:
1368+
- func: assume-aws-test-secrets-role
13651369
- func: run-atlas-search-test
13661370

13671371
- name: atlas-search-index-helpers-test
@@ -1419,7 +1423,7 @@ tasks:
14191423
${PREPARE_SHELL}
14201424
dotnet build
14211425
tar czf /tmp/mongo-csharp-driver.tgz tests/*.Tests/bin/Debug/net6.0/ ./evergreen/run-mongodb-oidc-env-tests.sh
1422-
- func: assume-ec2-role
1426+
- func: assume-aws-test-secrets-role
14231427
- func: run_oidc_k8s_tests
14241428
vars:
14251429
K8S_VARIANT: eks
@@ -1828,7 +1832,7 @@ tasks:
18281832
18291833
- name: x509-auth-tests
18301834
commands:
1831-
- func: assume-ec2-role
1835+
- func: assume-aws-test-secrets-role
18321836
- func: setup-x509-tests
18331837
- func: run-x509-tests
18341838
vars:
@@ -2010,7 +2014,7 @@ task_groups:
20102014
- func: fix-absolute-paths
20112015
- func: init-test-results
20122016
- func: make-files-executable
2013-
- func: assume-ec2-role
2017+
- func: assume-aws-test-secrets-role
20142018
- command: subprocess.exec
20152019
params:
20162020
binary: bash
@@ -2056,7 +2060,7 @@ task_groups:
20562060
- func: fix-absolute-paths
20572061
- func: init-test-results
20582062
- func: make-files-executable
2059-
- func: assume-ec2-role
2063+
- func: assume-aws-test-secrets-role
20602064
- command: subprocess.exec
20612065
params:
20622066
binary: bash
@@ -2100,7 +2104,7 @@ task_groups:
21002104
- func: fix-absolute-paths
21012105
- func: init-test-results
21022106
- func: make-files-executable
2103-
- func: assume-ec2-role
2107+
- func: assume-aws-test-secrets-role
21042108
- command: subprocess.exec
21052109
params:
21062110
binary: bash
@@ -2132,7 +2136,7 @@ task_groups:
21322136
setup_group:
21332137
- func: fetch-source
21342138
- func: prepare-resources
2135-
- func: assume-ec2-role
2139+
- func: assume-aws-test-secrets-role
21362140
- command: subprocess.exec
21372141
params:
21382142
binary: bash
@@ -2167,7 +2171,7 @@ task_groups:
21672171
- func: fix-absolute-paths
21682172
- func: init-test-results
21692173
- func: make-files-executable
2170-
- func: assume-ec2-role
2174+
- func: assume-aws-test-secrets-role
21712175
- command: subprocess.exec
21722176
params:
21732177
binary: bash
@@ -2195,7 +2199,7 @@ task_groups:
21952199
- func: prepare-resources
21962200
- func: fix-absolute-paths
21972201
- func: make-files-executable
2198-
- func: assume-ec2-role
2202+
- func: assume-aws-test-secrets-role
21992203
- func: install-dotnet
22002204
- command: subprocess.exec
22012205
params:
@@ -2226,7 +2230,7 @@ task_groups:
22262230
- func: prepare-resources
22272231
- func: fix-absolute-paths
22282232
- func: make-files-executable
2229-
- func: assume-ec2-role
2233+
- func: assume-aws-test-secrets-role
22302234
- func: install-dotnet
22312235
- command: subprocess.exec
22322236
params:
@@ -2257,7 +2261,7 @@ task_groups:
22572261
- func: fix-absolute-paths
22582262
- func: make-files-executable
22592263
- func: install-dotnet
2260-
- func: assume-ec2-role
2264+
- func: assume-aws-test-secrets-role
22612265
- command: subprocess.exec
22622266
params:
22632267
binary: bash

tests/MongoDB.Driver.Tests/Search/AtlasSearchTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public AtlasSearchTests(ITestOutputHelper testOutputHelper) : base(testOutputHel
6060
{
6161
RequireEnvironment.Check().EnvironmentVariable("ATLAS_SEARCH_TESTS_ENABLED");
6262

63-
var atlasSearchUri = Environment.GetEnvironmentVariable("ATLAS_SEARCH");
63+
var atlasSearchUri = Environment.GetEnvironmentVariable("ATLAS_SEARCH_URI");
6464
Ensure.IsNotNullOrEmpty(atlasSearchUri, nameof(atlasSearchUri));
6565

6666
var mongoClientSettings = MongoClientSettings.FromConnectionString(atlasSearchUri);
@@ -436,8 +436,8 @@ public void PhraseSynonym()
436436
result[0].Title.Should().Be("The Great Race");
437437
result[1].Title.Should().Be("The Cannonball Run");
438438
result[2].Title.Should().Be("National Mechanics");
439-
result[3].Title.Should().Be("Genevieve");
440-
result[4].Title.Should().Be("Speedway Junky");
439+
result[3].Title.Should().Be("Speedway Junky");
440+
result[4].Title.Should().Be("Jo pour Jonathan");
441441
}
442442

443443
[Fact]
@@ -866,7 +866,7 @@ public class Movie
866866
public class EmbeddedMovie : Movie
867867
{
868868
[BsonElement("plot_embedding")]
869-
public double[] Embedding { get; set; }
869+
public BinaryVectorFloat32 Embedding { get; set; }
870870
}
871871

872872
[BsonIgnoreExtraElements]

tests/MongoDB.Driver.Tests/Search/VectorSearchTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public VectorSearchTests(ITestOutputHelper testOutputHelper) : base(testOutputHe
3737
{
3838
RequireEnvironment.Check().EnvironmentVariable("ATLAS_SEARCH_TESTS_ENABLED");
3939

40-
var atlasSearchUri = Environment.GetEnvironmentVariable("ATLAS_SEARCH");
40+
var atlasSearchUri = Environment.GetEnvironmentVariable("ATLAS_SEARCH_URI");
4141
Ensure.IsNotNullOrEmpty(atlasSearchUri, nameof(atlasSearchUri));
4242

4343
var mongoClientSettings = MongoClientSettings.FromConnectionString(atlasSearchUri);

0 commit comments

Comments
 (0)