Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 2 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ functions:
SSL=${SSL} \
AUTH=${AUTH} \
REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \
LOAD_BALANCER=${LOAD_BALANCER} \
sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
# run-orchestration generates expansion file with the MONGODB_URI for the cluster
- command: expansions.update
Expand Down Expand Up @@ -664,6 +665,7 @@ tasks:
vars:
MONGODB_VERSION: "latest"
TOPOLOGY: "sharded_cluster"
LOAD_BALANCER: "true"
- func: start-load-balancer
- func: "run-lb-tests"
vars:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ MONGOC_EXPORT (int32_t)
mongoc_server_description_compressor_id (
const mongoc_server_description_t *description);

/* mongoc_global_mock_service_id is only used for testing. The test runner sets
* this to true when testing against a load balanced deployment to mock the
* presence of a serviceId field in the "hello" response. The purpose of this is
* further described in the Load Balancer test README. */
extern bool mongoc_global_mock_service_id;

BSON_END_DECLS

#endif
6 changes: 6 additions & 0 deletions Sources/CLibMongoC/mongoc/mongoc-server-description-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,10 @@ bool
mongoc_server_description_has_service_id (
const mongoc_server_description_t *description);

/* mongoc_global_mock_service_id is only used for testing. The test runner sets
* this to true when testing against a load balanced deployment to mock the
* presence of a serviceId field in the "hello" response. The purpose of this is
* further described in the Load Balancer test README. */
extern bool mongoc_global_mock_service_id;

#endif
13 changes: 0 additions & 13 deletions Sources/TestsCommon/CommonTestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ public enum TestTopologyConfiguration: String, Decodable {
helloReply["isreplicaset"] != true
{
self = .single
// TODO: SWIFT-1319: eventually, we should be able to just check for serviceId here.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as discussed offline, serviceId only shows up in the initial handshake, so we can't check for it here and need to still rely on the environment variable.

} else if MongoSwiftTestCase.topologyType == .loadBalanced {
self = .loadBalanced
} else if helloReply["msg"] == "isdbgrid" {
Expand Down Expand Up @@ -712,13 +711,6 @@ extension InsertManyResult {
}
}

// TODO: SWIFT-1319 Remove this method and usages of it.
/// Sets the libmongoc global variable indicating whether to include mock serviceIds in hello responses to the
/// provided value. This is necessary for load balancer testing until SERVER-58500 is complete.
public func setMockServiceId(to value: Bool) {
mongoc_global_mock_service_id = value
}

/// Resolves programmatically provided client options with those specified via environment variables.
public func resolveClientOptions(_ options: MongoClientOptions? = nil) -> MongoClientOptions {
var opts = options ?? MongoClientOptions()
Expand Down Expand Up @@ -751,10 +743,5 @@ public func resolveClientOptions(_ options: MongoClientOptions? = nil) -> MongoC
opts.compressors = [.zlib]
}

// TODO: SWIFT-1319 Remove this.
if MongoSwiftTestCase.topologyType == .loadBalanced {
setMockServiceId(to: true)
}

return opts
}
2 changes: 0 additions & 2 deletions etc/vendor-libmongoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ echo "RENAMING header files"
echo "PATCHING libmongoc"
git apply ${ETC_DIR}/lower-minheartbeatfrequencyms.diff
git apply ${ETC_DIR}/inttypes-non-modular-header-workaround.diff
# TODO SWIFT-1319: Remove.
git apply ${ETC_DIR}/expose-mock-service-id.diff
Copy link
Contributor

Choose a reason for hiding this comment

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

should we delete this diff file now too?


# Clang modules are build by a conventional structure with an `include` folder for public
# includes, and an umbrella header used as the primary entry point. As part of the vendoring
Expand Down