Skip to content

Commit 459e30d

Browse files
authored
SWIFT-1250 Add Atlas serverless connectivity tests (#677)
1 parent 8bd3b1f commit 459e30d

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

.evergreen/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ functions:
179179
# DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
180180
SWIFT_VERSION=${SWIFT_VERSION} ATLAS_REPL='${ATLAS_REPL}' ATLAS_SHRD='${ATLAS_SHRD}' ATLAS_FREE='${ATLAS_FREE}' ATLAS_TLS11='${ATLAS_TLS11}' ATLAS_TLS12='${ATLAS_TLS12}' \
181181
ATLAS_REPL_SRV='${ATLAS_REPL_SRV}' ATLAS_SHRD_SRV='${ATLAS_SHRD_SRV}' ATLAS_FREE_SRV='${ATLAS_FREE_SRV}' ATLAS_TLS11_SRV='${ATLAS_TLS11_SRV}' ATLAS_TLS12_SRV='${ATLAS_TLS12_SRV}' \
182+
ATLAS_SERVERLESS='${ATLAS_SERVERLESS}' ATLAS_SERVERLESS_SRV='${ATLAS_SERVERLESS_SRV}' \
182183
sh ${PROJECT_DIRECTORY}/.evergreen/run-atlas-tests.sh
183184
184185
"run serverless tests":

Sources/AtlasConnectivity/main.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import Foundation
22
import MongoSwiftSync
33

4-
private let configs = ["ATLAS_REPL", "ATLAS_SHRD", "ATLAS_FREE", "ATLAS_TLS11", "ATLAS_TLS12"]
4+
private let configs = ["ATLAS_REPL", "ATLAS_SHRD", "ATLAS_FREE", "ATLAS_TLS11", "ATLAS_TLS12", "ATLAS_SERVERLESS"]
55
private let srvConfigs = configs.map { $0 + "_SRV" }
6-
/// Currently, almost all of the Atlas test instances are running 3.4 which does not support the new "hello" command.
7-
private let legacyHello = "ismaster"
8-
private let supportsHello = ["ATLAS_FREE", "ATLAS_FREE_SRV"]
96

107
for config in configs + srvConfigs {
118
print("Testing config \(config)... ", terminator: "")
@@ -17,13 +14,8 @@ for config in configs + srvConfigs {
1714

1815
do {
1916
let client = try MongoClient(uri)
20-
// run legacy hello command
2117
let db = client.db("test")
22-
if supportsHello.contains(config) {
23-
_ = try db.runCommand(["hello": 1])
24-
} else {
25-
_ = try db.runCommand([legacyHello: 1])
26-
}
18+
_ = try db.runCommand(["hello": 1])
2719

2820
// findOne
2921
let coll = db.collection("test")

0 commit comments

Comments
 (0)