Skip to content

Commit 3486d9a

Browse files
authored
SWIFT-703 Re-enable Atlas tests (#396)
1 parent f2b600e commit 3486d9a

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

.evergreen/config.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ functions:
144144
working_dir: "src"
145145
script: |
146146
# DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
147-
SWIFT_VERSION=${SWIFT_VERSION} ATLAS_REPL='${ATLAS_REPL}' ATLAS_SHRD='${ATLAS_SHRD}' ATLAS_FREE='${ATLAS_FREE}' ATLAS_TLS11='${ATLAS_TLS11}' ATLAS_TLS12='${ATLAS_TLS12}' sh ${PROJECT_DIRECTORY}/.evergreen/run-atlas-tests.sh
147+
SWIFT_VERSION=${SWIFT_VERSION} ATLAS_REPL='${ATLAS_REPL}' ATLAS_SHRD='${ATLAS_SHRD}' ATLAS_FREE='${ATLAS_FREE}' ATLAS_TLS11='${ATLAS_TLS11}' ATLAS_TLS12='${ATLAS_TLS12}' \
148+
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}' \
149+
sh ${PROJECT_DIRECTORY}/.evergreen/run-atlas-tests.sh
148150
149151
"cleanup":
150152
- command: shell.exec
@@ -425,11 +427,10 @@ buildvariants:
425427
then:
426428
remove_tasks: ".3.6"
427429

428-
# TODO SWIFT-703: reenable
429-
# - matrix_name: "atlas-connect"
430-
# matrix_spec:
431-
# os-fully-featured: ubuntu-18.04
432-
# swift-version: "*"
433-
# display_name: "Atlas Connectivity ${swift-version} ${os-fully-featured}"
434-
# tasks:
435-
# - ".atlas-connect"
430+
- matrix_name: "atlas-connect"
431+
matrix_spec:
432+
os-fully-featured: "*"
433+
swift-version: "*"
434+
display_name: "Atlas Connectivity ${swift-version} ${os-fully-featured}"
435+
tasks:
436+
- ".atlas-connect"

.evergreen/run-atlas-tests.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ eval "$(swiftenv init -)"
1616
swiftenv local $SWIFT_VERSION
1717

1818
# run the tests
19-
ATLAS_REPL="$ATLAS_REPL" ATLAS_SHRD="$ATLAS_SHRD" ATLAS_FREE="$ATLAS_FREE" ATLAS_TLS11="$ATLAS_TLS11" ATLAS_TLS12="$ATLAS_TLS12" swift run AtlasConnectivity $EXTRA_FLAGS
19+
ATLAS_REPL="$ATLAS_REPL" ATLAS_SHRD="$ATLAS_SHRD" ATLAS_FREE="$ATLAS_FREE" ATLAS_TLS11="$ATLAS_TLS11" ATLAS_TLS12="$ATLAS_TLS12" \
20+
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" \
21+
swift run AtlasConnectivity $EXTRA_FLAGS

Sources/AtlasConnectivity/main.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import Foundation
22
import MongoSwiftSync
33

44
private let configs = ["ATLAS_REPL", "ATLAS_SHRD", "ATLAS_FREE", "ATLAS_TLS11", "ATLAS_TLS12"]
5+
private let srvConfigs = configs.map { $0 + "_SRV" }
56

6-
for config in configs {
7+
for config in configs + srvConfigs {
78
print("Testing config \(config)... ", terminator: "")
89

910
guard let uri = ProcessInfo.processInfo.environment[config] else {
10-
print("Failed: couldn't find URI")
11+
print("Failed: couldn't find URI for config \(config)")
1112
exit(1)
1213
}
1314

@@ -18,8 +19,7 @@ for config in configs {
1819
_ = try db.runCommand(["isMaster": 1])
1920
// findOne
2021
let coll = db.collection("test")
21-
let res = try coll.find(options: FindOptions(limit: 1))
22-
for _ in res {} // iterate cursor so we actually talk to server
22+
_ = try coll.findOne()
2323
} catch {
2424
print("Failed: \(error)")
2525
exit(1)

0 commit comments

Comments
 (0)