-
Notifications
You must be signed in to change notification settings - Fork 67
SWIFT-1328 Test against load balancers on Evergreen #668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -356,6 +356,40 @@ functions: | |
| LINUX_SOURCEKIT_LIB_PATH=${PROJECT_DIRECTORY}/opt/swiftenv/versions/${SWIFT_VERSION}/usr/lib \ | ||
| ${PROJECT_DIRECTORY}/opt/swiftlint/.build/release/swiftlint --strict --quiet | ||
|
|
||
| start-load-balancer: | ||
| - command: shell.exec | ||
| params: | ||
| script: | | ||
| DRIVERS_TOOLS=${DRIVERS_TOOLS} MONGODB_URI=${MONGODB_URI} \ | ||
| bash ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh start | ||
| - command: expansions.update | ||
| params: | ||
| file: lb-expansion.yml | ||
|
|
||
| stop-load-balancer: | ||
| - command: shell.exec | ||
| params: | ||
| script: | | ||
| DRIVERS_TOOLS=${DRIVERS_TOOLS} MONGODB_URI=${MONGODB_URI} \ | ||
| bash ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh stop | ||
|
|
||
| run-lb-tests: | ||
| - command: shell.exec | ||
| type: test | ||
| params: | ||
| working_dir: src | ||
| script: | | ||
| ${PREPARE_SHELL} | ||
| MONGODB_URI="${MONGODB_URI}" \ | ||
| TOPOLOGY="${TOPOLOGY}" \ | ||
| SSL=${SSL} \ | ||
| AUTH=${AUTH} \ | ||
| SWIFT_VERSION=${SWIFT_VERSION} \ | ||
| MONGODB_API_VERSION="${MONGODB_API_VERSION}" \ | ||
| SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI}" \ | ||
| MULTI_MONGOS_LB_URI="${MULTI_MONGOS_LB_URI}" \ | ||
| ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh | ||
|
|
||
| "sourcery": | ||
| - command: shell.exec | ||
| type: test | ||
|
|
@@ -579,6 +613,21 @@ tasks: | |
| MONGODB_VERSION: "latest" | ||
| TOPOLOGY: "sharded_cluster" | ||
| - func: "run tests" | ||
|
|
||
| - name: "test-latest-load_balancer" | ||
| tags: ["latest", "load-balancer"] | ||
| commands: | ||
| - func: "prepare resources" | ||
| - func: "fix absolute paths" | ||
| - func: "bootstrap mongo-orchestration" | ||
| vars: | ||
| MONGODB_VERSION: "latest" | ||
| TOPOLOGY: "sharded_cluster" | ||
| - func: start-load-balancer | ||
| - func: "run-lb-tests" | ||
| vars: | ||
| TOPOLOGY: "load_balanced" | ||
| - func: stop-load-balancer | ||
|
|
||
| - name: "test-atlas-connectivity" | ||
| tags: ["atlas-connect"] | ||
|
|
@@ -1136,7 +1185,7 @@ buildvariants: | |
| ssl-auth: "*" | ||
| display_name: "${swift-version} ${os-fully-featured} ${ssl-auth}" | ||
| tasks: | ||
| - ".latest" | ||
| - ".latest !.load-balancer" | ||
| - ".5.0" | ||
| - ".4.4" | ||
| - ".4.2" | ||
|
|
@@ -1165,7 +1214,7 @@ buildvariants: | |
| ssl-auth: "*" | ||
| display_name: "${swift-version} ${os-fully-featured} ${ssl-auth}" | ||
| tasks: | ||
| - ".latest" | ||
| - ".latest !.load-balancer" | ||
| - ".5.0" | ||
| - ".4.4" | ||
| - ".4.2" | ||
|
|
@@ -1220,6 +1269,21 @@ buildvariants: | |
| tasks: | ||
| - ".atlas-connect" | ||
|
|
||
| - matrix_name: "load-balancer-all" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I considered doing what we have done for other matrices and having a separate matrix for testing Swift 5.1 (this is necessary since Ubuntu 20.04 doesn't support 5.1). however, I think this is sufficient coverage, and I also relatedly just filed SWIFT-1337 about dropping Swift 5.1 support anyway, per our recent convo / SwiftNIO's decision to do so
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in general we could be a bit looser about what we test, too. The SSWG graduation criteria require that we test at least the two latest versions, and I think if we also include a test that we compile on our minimum supported version, we can be generally confident that the entire range of minimum -> maximum works as expected. In our case that would be compile on 5.1 and test on 5.3 and 5.4. This could help reduce the multiplicative factor of our evergreen config.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, that's a good point and I agree that just making sure everything builds on those versions seems sufficient, especially given we don't have any branching logic based on language version as far as I can think of. I filed SWIFT-1340 about reducing the matrix size, seems like a good GBF candidate |
||
| matrix_spec: | ||
| os-fully-featured: | ||
| - "ubuntu-18.04" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haproxy isn't installed by default on macOS like it is on these hosts, and other drivers seem to have skipped running these tests on macOS, so I think just testing on Ubuntu should be sufficient. |
||
| - "ubuntu-20.04" | ||
| ssl-auth: "*" | ||
| swift-version: | ||
| - "5.2" | ||
| - "5.3" | ||
| - "5.4" | ||
| - "5.5-dev" | ||
| display_name: "Load Balancer ${swift-version} ${os-fully-featured} ${ssl-auth}" | ||
| tasks: | ||
| - ".load-balancer" | ||
|
|
||
| - matrix_name: "serverless" | ||
| matrix_spec: | ||
| os-fully-featured: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,7 +132,7 @@ open class MongoSwiftTestCase: XCTestCase { | |
| } | ||
|
|
||
| public static var multipleMongosLoadBalancedURI: String? { | ||
| ProcessInfo.processInfo.environment["MULTIPLE_MONGOS_LB_URI"] | ||
| ProcessInfo.processInfo.environment["MULTI_MONGOS_LB_URI"] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is actually what the evergreen setup tools name the env variable, I had it wrong |
||
| } | ||
|
|
||
| /// Indicates that we are running the tests with SSL enabled, determined by the environment variable $SSL. | ||
|
|
@@ -297,6 +297,15 @@ public struct TestRequirement: Decodable { | |
| ) | ||
| ] | ||
|
|
||
| public static let changeStreamOnCollectionSupport = TestRequirement( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this and the various usages of it are not exactly related to the Evergreen work, however as I was looking through the logs to make sure tests ran correctly I noticed we were incorrectly skipping a bunch of tests which we had hardcoded the supported topologies for and I forgot to add |
||
| acceptableTopologies: [.replicaSet, .sharded, .shardedReplicaSet, .loadBalanced] | ||
| ) | ||
|
|
||
| public static let changeStreamOnDBOrClientSupport = TestRequirement( | ||
| minServerVersion: ServerVersion(major: 4, minor: 0, patch: 0), | ||
| acceptableTopologies: [.replicaSet, .sharded, .shardedReplicaSet, .loadBalanced] | ||
| ) | ||
|
|
||
| public init( | ||
| minServerVersion: ServerVersion? = nil, | ||
| maxServerVersion: ServerVersion? = nil, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically, we are supposed to test against "each server version that supports load balanced clusters".
this is kind of weird now because no servers actually support it, yet, with the serviceId mocking support they all appear to.
for now, I opted to just test against latest since that's the closest server version to actual support, but I suppose once 5.1 comes out with serviceId support (and we get a "test drivers against 5.1" ticket) we can start testing against both 5.1 and latest.