Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ functions:
# DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
SWIFT_VERSION=${SWIFT_VERSION} ATLAS_REPL='${ATLAS_REPL}' ATLAS_SHRD='${ATLAS_SHRD}' ATLAS_FREE='${ATLAS_FREE}' ATLAS_TLS11='${ATLAS_TLS11}' ATLAS_TLS12='${ATLAS_TLS12}' \
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}' \
ATLAS_SERVERLESS='${ATLAS_SERVERLESS}' ATLAS_SERVERLESS_SRV='${ATLAS_SERVERLESS_SRV}' \
Copy link
Contributor Author

@kmahar kmahar Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are both now private variables in our Evergreen project

sh ${PROJECT_DIRECTORY}/.evergreen/run-atlas-tests.sh

"run serverless tests":
Expand Down
12 changes: 2 additions & 10 deletions Sources/AtlasConnectivity/main.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import Foundation
import MongoSwiftSync

private let configs = ["ATLAS_REPL", "ATLAS_SHRD", "ATLAS_FREE", "ATLAS_TLS11", "ATLAS_TLS12"]
private let configs = ["ATLAS_REPL", "ATLAS_SHRD", "ATLAS_FREE", "ATLAS_TLS11", "ATLAS_TLS12", "ATLAS_SERVERLESS"]
private let srvConfigs = configs.map { $0 + "_SRV" }
/// Currently, almost all of the Atlas test instances are running 3.4 which does not support the new "hello" command.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these instances were recently all upgraded to 3.6 (and new enough patch versions to have "hello" backported), so the special-casing is no longer necessary

private let legacyHello = "ismaster"
private let supportsHello = ["ATLAS_FREE", "ATLAS_FREE_SRV"]

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

do {
let client = try MongoClient(uri)
// run legacy hello command
let db = client.db("test")
if supportsHello.contains(config) {
_ = try db.runCommand(["hello": 1])
} else {
_ = try db.runCommand([legacyHello: 1])
}
_ = try db.runCommand(["hello": 1])

// findOne
let coll = db.collection("test")
Expand Down