Skip to content

Commit 67752b3

Browse files
authored
CSHARP-5568: Remove Serverless testing (#1725)
1 parent d2802b6 commit 67752b3

File tree

12 files changed

+21
-213
lines changed

12 files changed

+21
-213
lines changed

build.cake

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -202,17 +202,6 @@ Task("TestMongoDbOidc")
202202
action: (BuildConfig buildConfig, Path testProject) =>
203203
RunTests(buildConfig, testProject, filter: "Category=\"MongoDbOidc\""));
204204

205-
Task("TestServerless")
206-
.IsDependentOn("Build")
207-
.DoesForEach(
208-
items: GetFiles("./**/MongoDB.Driver.Tests.csproj"),
209-
action: (BuildConfig buildConfig, Path testProject) =>
210-
RunTests(buildConfig, testProject, filter: "Category=\"Serverless\""));
211-
212-
Task("TestServerlessNet472").IsDependentOn("TestServerless");
213-
Task("TestServerlessNetStandard21").IsDependentOn("TestServerless");
214-
Task("TestServerlessNet60").IsDependentOn("TestServerless");
215-
216205
Task("TestLibMongoCrypt")
217206
.IsDependentOn("Build")
218207
.DoesForEach(

evergreen/evergreen.yml

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -727,19 +727,6 @@ functions:
727727
args:
728728
- evergreen/run-mongodb-oidc-tests.sh
729729

730-
run-serverless-tests:
731-
- command: shell.exec
732-
type: test
733-
params:
734-
working_dir: mongo-csharp-driver
735-
script: |
736-
${PREPARE_SHELL}
737-
AUTH=${AUTH} \
738-
FRAMEWORK=${FRAMEWORK} \
739-
SSL=${SSL} \
740-
CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \
741-
evergreen/run-serverless-tests.sh
742-
743730
run-smoke-tests:
744731
- command: shell.exec
745732
type: test
@@ -1339,12 +1326,6 @@ tasks:
13391326
vars:
13401327
K8S_VARIANT: aks
13411328

1342-
- name: test-serverless
1343-
exec_timeout_secs: 2700 # 45 minutes: 15 for setup + 30 for tests
1344-
commands:
1345-
- func: setup-csfle-secrets
1346-
- func: run-serverless-tests
1347-
13481329
- name: test-ocsp-rsa-valid-cert-server-staples-ca-responder
13491330
tags: ["ocsp"]
13501331
commands:
@@ -1899,14 +1880,6 @@ axes:
18991880
variables:
19001881
FRAMEWORK: net80
19011882

1902-
- id: serverless
1903-
display_name: Serverless
1904-
values:
1905-
- id: "Passthrough"
1906-
display_name: "Serverless Passthrough Proxy"
1907-
variables:
1908-
VAULT_NAME: "serverless"
1909-
19101883
task_groups:
19111884
- name: testazurekms-task-group
19121885
setup_group_can_fail_task: true
@@ -2180,39 +2153,6 @@ task_groups:
21802153
tasks:
21812154
- test-oidc-k8s
21822155

2183-
- name: serverless-task-group
2184-
setup_group_can_fail_task: true
2185-
setup_group_timeout_secs: 1800 # 30 minutes
2186-
setup_group:
2187-
- func: fetch-source
2188-
- func: prepare-resources
2189-
- func: fix-absolute-paths
2190-
- func: make-files-executable
2191-
- func: assume-ec2-role
2192-
- command: subprocess.exec
2193-
params:
2194-
binary: bash
2195-
env:
2196-
VAULT_NAME: ${VAULT_NAME}
2197-
include_expansions_in_env:
2198-
- "AWS_ACCESS_KEY_ID"
2199-
- "AWS_SECRET_ACCESS_KEY"
2200-
- "AWS_SESSION_TOKEN"
2201-
args:
2202-
- ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
2203-
- command: expansions.update
2204-
params:
2205-
file: serverless-expansion.yml
2206-
teardown_group:
2207-
- func: upload-test-results
2208-
- command: subprocess.exec
2209-
params:
2210-
binary: bash
2211-
args:
2212-
- ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh
2213-
tasks:
2214-
- test-serverless
2215-
22162156
- name: validate-apicompat-task-group
22172157
setup_group_can_fail_task: true
22182158
setup_group_timeout_secs: 1800 # 30 minutes
@@ -2483,21 +2423,6 @@ buildvariants:
24832423
- name: "test-load-balancer-netstandard21"
24842424
- name: "test-load-balancer-net60"
24852425

2486-
# Serverless tests
2487-
- matrix_name: serverless-tests-windows
2488-
matrix_spec: { auth: "auth", ssl: "ssl", compressor: "zlib", os: "windows-64", target_framework: ["net472", "netstandard21", "net60"], serverless: "*" }
2489-
display_name: "${serverless} ${compressor} ${auth} ${ssl} ${os} ${target_framework}"
2490-
batchtime: 10080 # 7 days
2491-
tasks:
2492-
- name: serverless-task-group
2493-
2494-
- matrix_name: serverless-tests-ubuntu
2495-
matrix_spec: { auth: "auth", ssl: "ssl", compressor: "zlib", os: "ubuntu-2004", target_framework: ["netstandard21", "net60"], serverless: "*" }
2496-
display_name: "${serverless} ${compressor} ${auth} ${ssl} ${os} ${target_framework}"
2497-
batchtime: 10080 # 7 days
2498-
tasks:
2499-
- name: serverless-task-group
2500-
25012426
# Performance tests
25022427
- name: driver-performance-tests
25032428
display_name: "Driver Performance Tests"

evergreen/run-serverless-tests.sh

Lines changed: 0 additions & 62 deletions
This file was deleted.

tests/AtlasConnectivity.Tests/ConnectivityTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ public ConnectivityTests(ITestOutputHelper testOutputHelper)
3939
[InlineData("ATLAS_FREE")]
4040
[InlineData("ATLAS_TLS11")]
4141
[InlineData("ATLAS_TLS12")]
42-
[InlineData("ATLAS_SERVERLESS")]
4342
[InlineData("ATLAS_SRV_REPL")]
4443
[InlineData("ATLAS_SRV_SHRD")]
4544
[InlineData("ATLAS_SRV_FREE")]
4645
[InlineData("ATLAS_SRV_TLS11")]
4746
[InlineData("ATLAS_SRV_TLS12")]
48-
[InlineData("ATLAS_SRV_SERVERLESS")]
4947
public void Connection_to_Atlas_should_work(string environmentVariableName)
5048
{
5149
var connectionString = Environment.GetEnvironmentVariable(environmentVariableName);

tests/MongoDB.Driver.TestHelpers/Core/CoreTestConfiguration.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public static class CoreTestConfiguration
4949
private static MessageEncoderSettings __messageEncoderSettings = new MessageEncoderSettings();
5050
private static Lazy<int> __numberOfMongoses = new Lazy<int>(GetNumberOfMongoses, isThreadSafe: true);
5151
private static Lazy<ServerApi> __serverApi = new Lazy<ServerApi>(GetServerApi, isThreadSafe: true);
52-
private static Lazy<bool> __serverless = new Lazy<bool>(GetServerless, isThreadSafe: true);
5352
private static Lazy<SemanticVersion> __serverVersion = new Lazy<SemanticVersion>(GetServerVersion, isThreadSafe: true);
5453
private static Lazy<string> __storageEngine = new Lazy<string>(GetStorageEngine, isThreadSafe: true);
5554
private static TraceSource __traceSource;
@@ -109,11 +108,6 @@ public static ServerApi ServerApi
109108
get { return __serverApi.Value; }
110109
}
111110

112-
public static bool Serverless
113-
{
114-
get { return __serverless.Value; }
115-
}
116-
117111
public static SemanticVersion ServerVersion => __serverVersion.Value;
118112

119113
public static int MaxWireVersion => __maxWireVersion.Value;
@@ -293,13 +287,6 @@ private static ServerApi GetServerApi()
293287
return new ServerApi(ServerApiVersion.V1);
294288
}
295289

296-
private static bool GetServerless()
297-
{
298-
var serverless = Environment.GetEnvironmentVariable("SERVERLESS");
299-
300-
return serverless?.ToLower() == "true";
301-
}
302-
303290
public static DatabaseNamespace GetDatabaseNamespaceForTestClass(Type testClassType)
304291
{
305292
var databaseName = TruncateDatabaseNameIfTooLong(__databaseNamespace.Value.DatabaseName + "-" + testClassType.Name);
@@ -469,8 +456,7 @@ private static string GetStorageEngine()
469456
switch (clusterType)
470457
{
471458
case ClusterType.LoadBalanced:
472-
case var _ when Serverless:
473-
// Load balancing and serverless are only supported for servers higher than 50
459+
// Load balancing only supported for servers higher than 50
474460
result = "wiredTiger";
475461
break;
476462
case ClusterType.Sharded:

tests/MongoDB.Driver.TestHelpers/Core/XunitExtensions/RequireServer.cs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
using MongoDB.Bson;
1919
using MongoDB.Driver.Core.Clusters;
2020
using MongoDB.Driver.Core.Misc;
21-
using Xunit;
2221
using Xunit.Sdk;
2322

2423
namespace MongoDB.Driver.Core.TestHelpers.XunitExtensions
@@ -129,18 +128,6 @@ public RequireServer RunOn(BsonArray requirements)
129128
throw new SkipException($"Test skipped because cluster does not meet runOn requirements: {requirements}.");
130129
}
131130

132-
public RequireServer Serverless(bool require = true)
133-
{
134-
var isServerless = CoreTestConfiguration.Serverless;
135-
136-
if (isServerless == require)
137-
{
138-
return this;
139-
}
140-
141-
throw new SkipException("Test skipped because serverless is " + (require ? "required" : "not required") + ".");
142-
}
143-
144131
public RequireServer StableServer(bool stable = true)
145132
{
146133
var serverVersion = CoreTestConfiguration.ServerVersion;
@@ -321,12 +308,8 @@ private bool IsRequirementSatisfied(BsonElement requirement)
321308
var serverlessValue = requirement.Value.AsString;
322309
switch (serverlessValue)
323310
{
324-
case "allow":
325-
return true;
326311
case "forbid":
327-
return CoreTestConfiguration.Serverless == false;
328-
case "require":
329-
return CoreTestConfiguration.Serverless == true;
312+
return true;
330313
default:
331314
throw new FormatException($"Invalid runOn requirement serverless field value: '{requirement.Value}'.");
332315
}

tests/MongoDB.Driver.Tests/Specifications/UnifiedTestSpecRunner.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ public void LoadBalancers(JsonDrivenTestCase testCase)
126126
Run(testCase);
127127
}
128128

129-
[Category("Serverless", "SupportLoadBalancing")]
129+
[Category("SupportLoadBalancing")]
130130
[UnifiedTestsTheory("read_write_concern.tests.operation")]
131131
public void ReadWriteConcern(JsonDrivenTestCase testCase) => Run(testCase);
132132

133-
[Category("Serverless", "SupportLoadBalancing")]
133+
[Category("SupportLoadBalancing")]
134134
[UnifiedTestsTheory("retryable_reads.tests.unified")]
135135
public void RetryableReads(JsonDrivenTestCase testCase) => Run(testCase);
136136

137-
[Category("Serverless", "SupportLoadBalancing")]
137+
[Category("SupportLoadBalancing")]
138138
[UnifiedTestsTheory("retryable_writes.tests.unified")]
139139
public void RetryableWrites(JsonDrivenTestCase testCase)
140140
{
@@ -156,11 +156,10 @@ public void ServerDiscoveryAndMonitoring(JsonDrivenTestCase testCase) =>
156156
[UnifiedTestsTheory("server_selection.tests.logging")]
157157
public void ServerSelection(JsonDrivenTestCase testCase) => Run(testCase);
158158

159-
[Category("Serverless")]
160159
[UnifiedTestsTheory("sessions.tests")]
161160
public void Sessions(JsonDrivenTestCase testCase) => Run(testCase);
162161

163-
[Category("Serverless", "SupportLoadBalancing")]
162+
[Category("SupportLoadBalancing")]
164163
[UnifiedTestsTheory("transactions.tests.unified")]
165164
public void Transactions(JsonDrivenTestCase testCase)
166165
{
@@ -203,7 +202,7 @@ public void UnifiedTestFormatValidPass(JsonDrivenTestCase testCase)
203202
Run(testCase);
204203
}
205204

206-
[Category("Serverless", "SupportLoadBalancing")]
205+
[Category("SupportLoadBalancing")]
207206
[UnifiedTestsTheory("versioned_api.tests")]
208207
public void VersionedApi(JsonDrivenTestCase testCase) => Run(testCase);
209208

tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/ClientSideEncryptionTestRunner.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
namespace MongoDB.Driver.Tests.Specifications.client_side_encryption
2929
{
3030
[Trait("Category", "CSFLE")]
31-
[Trait("Category", "Serverless")]
3231
[Trait("Category", "Integration")]
3332
public class ClientSideEncryptionTestRunner : MongoClientJsonDrivenTestRunnerBase
3433
{

tests/MongoDB.Driver.Tests/Specifications/crud/CrudTestRunner.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
namespace MongoDB.Driver.Tests.Specifications.crud
3333
{
34-
[Trait("Category", "Serverless")]
3534
[Trait("Category", "Integration")]
3635
public class CrudTestRunner : LoggableTestClass
3736
{
@@ -313,11 +312,7 @@ private void SkipTestIfNeeded(BsonDocument definition, BsonDocument test)
313312

314313
if (definition.TryGetValue("serverless", out var serverless))
315314
{
316-
if (serverless == "forbid")
317-
{
318-
RequireServer.Check().Serverless(false);
319-
}
320-
else
315+
if (serverless != "forbid")
321316
{
322317
throw new FormatException($"Invalid serverless field value: '{serverless.AsString}'.");
323318
}

0 commit comments

Comments
 (0)