Skip to content

Commit d7a6b0c

Browse files
authored
RUST-2199 Remove all serverless testing logic (#1415)
1 parent c33f40a commit d7a6b0c

File tree

9 files changed

+19
-201
lines changed

9 files changed

+19
-201
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -267,17 +267,6 @@ buildvariants:
267267
tasks:
268268
- name: test-x509-auth
269269

270-
# - name: serverless
271-
# display_name: "Serverless"
272-
# run_on:
273-
# - rhel80-small
274-
# expansions:
275-
# LIBMONGOCRYPT_OS: rhel-80-64-bit
276-
# AUTH: auth
277-
# SSL: ssl
278-
# tasks:
279-
# - serverless-task-group
280-
281270
- name: oidc-linux
282271
display_name: "OIDC Linux"
283272
patchable: true
@@ -407,43 +396,6 @@ buildvariants:
407396
# Task Groups #
408397
###############
409398
task_groups:
410-
- name: serverless-task-group
411-
setup_group_can_fail_task: true
412-
setup_group_timeout_secs: 1800 # 30 minutes
413-
setup_group:
414-
- func: "fetch source"
415-
- func: "create expansions"
416-
- func: "prepare resources"
417-
- func: "windows fix"
418-
- func: "fix absolute paths"
419-
- func: "init test-results"
420-
- func: "make files executable"
421-
- func: "install rust"
422-
- func: "install junit dependencies"
423-
- command: shell.exec
424-
params:
425-
shell: "bash"
426-
script: |
427-
${PREPARE_SHELL}
428-
bash ${DRIVERS_TOOLS}/.evergreen/serverless/setup-secrets.sh
429-
bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
430-
- command: expansions.update
431-
params:
432-
file: serverless-expansion.yml
433-
teardown_group:
434-
- command: shell.exec
435-
params:
436-
script: |
437-
${PREPARE_SHELL}
438-
bash ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh
439-
- func: "upload test results"
440-
- func: "upload-mo-artifacts"
441-
- func: "cleanup"
442-
443-
tasks:
444-
- "test-serverless"
445-
- "test-in-use-encryption-serverless"
446-
447399
- name: azure-kms-task-group
448400
setup_group_can_fail_task: true
449401
setup_group_timeout_secs: 1800 # 30 minutes
@@ -1012,10 +964,6 @@ tasks:
1012964
TOPOLOGY: server
1013965
- func: "run x509 tests"
1014966

1015-
- name: test-serverless
1016-
commands:
1017-
- func: "run serverless tests"
1018-
1019967
- name: test-tokio-sync
1020968
tags: [sync]
1021969
commands:
@@ -1112,18 +1060,6 @@ tasks:
11121060
- func: "start csfle servers"
11131061
- func: "run csfle tests"
11141062

1115-
- name: test-in-use-encryption-serverless
1116-
commands:
1117-
- command: expansions.update
1118-
params:
1119-
file: src/expansion.yml
1120-
- command: expansions.update
1121-
params:
1122-
file: serverless-expansion.yml
1123-
- func: "install libmongocrypt"
1124-
- func: "start csfle servers"
1125-
- func: "run csfle serverless tests"
1126-
11271063
- name: test-load-balancer-5.0
11281064
tags: [load-balancer]
11291065
commands:
@@ -1578,23 +1514,6 @@ functions:
15781514
- PROJECT_DIRECTORY
15791515
- MONGODB_URI
15801516

1581-
"run serverless tests":
1582-
- command: shell.exec
1583-
type: test
1584-
params:
1585-
working_dir: src
1586-
shell: bash
1587-
include_expansions_in_env:
1588-
- SERVERLESS_ATLAS_USER
1589-
- SERVERLESS_ATLAS_PASSWORD
1590-
script: |
1591-
${PREPARE_SHELL}
1592-
1593-
export SINGLE_MONGOS_LB_URI=${SERVERLESS_URI}
1594-
. .evergreen/generate-uri.sh
1595-
1596-
.evergreen/run-serverless-tests.sh
1597-
15981517
"run atlas tests":
15991518
- command: ec2.assume_role
16001519
params:
@@ -1670,35 +1589,6 @@ functions:
16701589
- DISABLE_CRYPT_SHARED
16711590
- AZURE_IMDS_MOCK_PORT
16721591

1673-
"run csfle serverless tests":
1674-
- command: shell.exec
1675-
type: test
1676-
params:
1677-
working_dir: src
1678-
shell: bash
1679-
include_expansions_in_env:
1680-
- DRIVERS_TOOLS
1681-
- PROJECT_DIRECTORY
1682-
- MONGODB_URI
1683-
- MONGOCRYPT_LIB_DIR
1684-
- OPENSSL
1685-
- OS
1686-
- LD_LIBRARY_PATH
1687-
- AWS_ACCESS_KEY_ID
1688-
- AWS_SECRET_ACCESS_KEY
1689-
- CSFLE_LOCAL_KEY
1690-
- CRYPT_SHARED_LIB_PATH
1691-
- DISABLE_CRYPT_SHARED
1692-
- AZURE_IMDS_MOCK_PORT
1693-
- SERVERLESS_ATLAS_USER
1694-
- SERVERLESS_ATLAS_PASSWORD
1695-
script: |
1696-
export SINGLE_MONGOS_LB_URI=${SERVERLESS_URI}
1697-
. .evergreen/generate-uri.sh
1698-
export SERVERLESS=serverless
1699-
1700-
.evergreen/run-csfle-tests.sh
1701-
17021592
"build and upload gcp kms test":
17031593
- command: shell.exec
17041594
params:

.evergreen/run-serverless-tests.sh

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

src/test.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -279,18 +279,12 @@ pub(crate) static SERVER_API: Lazy<Option<ServerApi>> =
279279
}),
280280
_ => None,
281281
});
282-
pub(crate) static SERVERLESS: Lazy<bool> =
283-
Lazy::new(|| matches!(std::env::var("SERVERLESS"), Ok(s) if s == "serverless"));
284282
pub(crate) static LOAD_BALANCED_SINGLE_URI: Lazy<Option<String>> =
285283
Lazy::new(|| std::env::var("SINGLE_MONGOS_LB_URI").ok());
286284
pub(crate) static LOAD_BALANCED_MULTIPLE_URI: Lazy<Option<String>> =
287285
Lazy::new(|| std::env::var("MULTI_MONGOS_LB_URI").ok());
288286
pub(crate) static OIDC_URI: Lazy<Option<String>> =
289287
Lazy::new(|| std::env::var("MONGODB_URI_SINGLE").ok());
290-
pub(crate) static SERVERLESS_ATLAS_USER: Lazy<Option<String>> =
291-
Lazy::new(|| std::env::var("SERVERLESS_ATLAS_USER").ok());
292-
pub(crate) static SERVERLESS_ATLAS_PASSWORD: Lazy<Option<String>> =
293-
Lazy::new(|| std::env::var("SERVERLESS_ATLAS_PASSWORD").ok());
294288

295289
// conditional definitions do not work within the lazy_static! macro, so this
296290
// needs to be defined separately.
@@ -322,15 +316,6 @@ pub(crate) fn update_options_for_testing(options: &mut ClientOptions) {
322316
))]
323317
set_compressor(options);
324318

325-
if options.credential.is_none() && SERVERLESS_ATLAS_USER.is_some() {
326-
options.credential = Some(
327-
Credential::builder()
328-
.username(SERVERLESS_ATLAS_USER.clone())
329-
.password(SERVERLESS_ATLAS_PASSWORD.clone())
330-
.build(),
331-
);
332-
}
333-
334319
if let Some(ref mut credential) = options.credential {
335320
if credential.mechanism == Some(AuthMechanism::MongoDbOidc)
336321
&& credential

src/test/csfle/kms_retry.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use reqwest::{Certificate, Client as HttpClient};
77

88
use crate::{
99
client_encryption::{AwsMasterKey, AzureMasterKey, ClientEncryption, GcpMasterKey},
10-
test::{get_client_options, log_uncaptured, SERVERLESS},
10+
test::get_client_options,
1111
Client,
1212
Namespace,
1313
};
@@ -16,11 +16,6 @@ use super::{AWS_KMS, AZURE_KMS, CSFLE_TLS_CERT_DIR, GCP_KMS};
1616

1717
#[tokio::test]
1818
async fn kms_retry() {
19-
if *SERVERLESS {
20-
log_uncaptured("skipping kms_retry on serverless");
21-
return;
22-
}
23-
2419
let endpoint = "127.0.0.1:9003";
2520

2621
let mut certificate_file_path = PathBuf::from(&*CSFLE_TLS_CERT_DIR);

src/test/cursor.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,12 @@ use crate::{
77
bson::doc,
88
options::{CreateCollectionOptions, CursorType, FindOptions},
99
runtime,
10-
test::{log_uncaptured, SERVERLESS},
1110
Client,
1211
};
1312

1413
#[tokio::test]
1514
#[function_name::named]
1615
async fn tailable_cursor() {
17-
if *SERVERLESS {
18-
log_uncaptured(
19-
"skipping cursor::tailable_cursor; serverless does not support capped collections",
20-
);
21-
return;
22-
}
23-
2416
let client = Client::for_test().await;
2517
let coll = client
2618
.create_fresh_collection(

src/test/spec.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub(crate) use self::{
4141
unified_runner::{merge_uri_options, ExpectedEventType, Topology},
4242
v2_runner::{operation::Operation, test_file::RunOn},
4343
};
44-
use crate::{bson::Bson, test::SERVERLESS};
44+
use crate::bson::Bson;
4545

4646
use super::log_uncaptured;
4747

@@ -142,10 +142,6 @@ pub(crate) enum Serverless {
142142

143143
impl Serverless {
144144
pub(crate) fn can_run(&self) -> bool {
145-
match self {
146-
Self::Forbid if *SERVERLESS => false,
147-
Self::Require if !*SERVERLESS => false,
148-
_ => true,
149-
}
145+
*self != Self::Require
150146
}
151147
}

src/test/spec/crud.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
use crate::{
22
bson::doc,
3-
test::{
4-
log_uncaptured,
5-
server_version_lt,
6-
spec::unified_runner::run_unified_tests,
7-
SERVERLESS,
8-
},
3+
test::{log_uncaptured, server_version_lt, spec::unified_runner::run_unified_tests},
94
Client,
105
};
116

@@ -37,17 +32,13 @@ async fn run_unified() {
3732
"findOneAndUpdate-errorResponse.json",
3833
];
3934

40-
let mut skipped_tests = vec![
35+
let skipped_tests = vec![
4136
// Unacknowledged write; see above.
4237
"Unacknowledged write using dollar-prefixed or dotted keys may be silently rejected on \
4338
pre-5.0 server",
4439
"Requesting unacknowledged write with verboseResults is a client-side error",
4540
"Requesting unacknowledged write with ordered is a client-side error",
4641
];
47-
// TODO: remove this manual skip when this test is fixed to skip on serverless
48-
if *SERVERLESS {
49-
skipped_tests.push("inserting _id with type null via clientBulkWrite");
50-
}
5142

5243
run_unified_tests(&["crud", "unified"])
5344
.skip_files(&skipped_files)
@@ -74,7 +65,7 @@ async fn generated_id_first_field() {
7465
let (key, _) = insert_document.iter().next().unwrap();
7566
assert_eq!(key, "_id");
7667

77-
if server_version_lt(8, 0).await || *SERVERLESS {
68+
if server_version_lt(8, 0).await {
7869
log_uncaptured("skipping bulk write test in generated_id_first_field");
7970
return;
8071
}

src/test/spec/unified_runner/test_runner.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use crate::{
2828
DEFAULT_URI,
2929
LOAD_BALANCED_MULTIPLE_URI,
3030
LOAD_BALANCED_SINGLE_URI,
31-
SERVERLESS,
3231
SERVER_API,
3332
},
3433
Client,
@@ -471,8 +470,7 @@ impl TestRunner {
471470
let server_api = client.server_api.clone().or_else(|| SERVER_API.clone());
472471

473472
let given_uri = if get_client_options().await.load_balanced.unwrap_or(false) {
474-
// for serverless testing, ignore use_multiple_mongoses.
475-
if client.use_multiple_mongoses() && !*SERVERLESS {
473+
if client.use_multiple_mongoses() {
476474
LOAD_BALANCED_MULTIPLE_URI.as_ref().expect(
477475
"Test requires URI for load balancer fronting multiple servers",
478476
)

src/test/spec/v2_runner.rs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use crate::{
3030
},
3131
EventClient,
3232
TestClient,
33-
SERVERLESS,
3433
},
3534
Client,
3635
ClientSession,
@@ -318,7 +317,7 @@ impl crate::test::util::TestClientBuilder {
318317

319318
let default_options = if is_load_balanced {
320319
// for serverless testing, ignore use_multiple_mongoses.
321-
let uri = if use_multiple_mongoses && !*SERVERLESS {
320+
let uri = if use_multiple_mongoses {
322321
crate::test::LOAD_BALANCED_MULTIPLE_URI
323322
.as_ref()
324323
.expect("MULTI_MONGOS_LB_URI is required")
@@ -520,21 +519,17 @@ async fn run_v2_test(path: std::path::PathBuf, test_file: TestFile) {
520519
continue;
521520
}
522521

523-
// `killAllSessions` isn't supported on serverless.
524-
// TODO CLOUDP-84298 remove this conditional.
525-
if !*SERVERLESS {
526-
match file_ctx
527-
.internal_client
528-
.database("admin")
529-
.run_command(doc! { "killAllSessions": [] })
530-
.await
531-
{
532-
Ok(_) => {}
533-
Err(err) => match err.sdam_code() {
534-
Some(11601) => {}
535-
_ => panic!("{}: killAllSessions failed", test.description),
536-
},
537-
}
522+
match file_ctx
523+
.internal_client
524+
.database("admin")
525+
.run_command(doc! { "killAllSessions": [] })
526+
.await
527+
{
528+
Ok(_) => {}
529+
Err(err) => match err.sdam_code() {
530+
Some(11601) => {}
531+
_ => panic!("{}: killAllSessions failed", test.description),
532+
},
538533
}
539534

540535
#[cfg(feature = "in-use-encryption")]

0 commit comments

Comments
 (0)