-
Notifications
You must be signed in to change notification settings - Fork 455
CDRIVER-4275 and CDRIVER-4275 #1158
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
Conversation
This matches expectation of integration-tests.sh.
This was only needed when MongoDB servers did not return a serviceId in the hello response.
Tests were updated in mongodb/specifications commit: 5d1b42a05017ba27ffdbe6fd068a45e93e5b68c5
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.
LGTM.
I'll leave it up to you as to whether you want to go to the trouble of changing the semantics of the LOAD_BALANCER
variable, but it's not worth holding up the PR so I'm going ahead and approving.
.evergreen/integration-tests.sh
Outdated
@@ -61,6 +61,10 @@ if [ -z "$ORCHESTRATION_FILE" ]; then | |||
if [ "$SSL" != "nossl" ]; then | |||
ORCHESTRATION_FILE="${ORCHESTRATION_FILE}-ssl" | |||
fi | |||
|
|||
if [ -n "$LOAD_BALANCER" ]; then |
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.
I'm not super excited about using -n
to test a variable that is set with the value true
in config.yml
. This seems to create the possibility that someone could think that setting LOAD_BALANCER=false
would disable load balancer tests, but that would clearly not happen. I can't decide on a clearly better approach, but what about testing for = "on"
as is done for IPV4_ONLY
? The the on/off
semantics seem a bit more natural.
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.
Agreed; suggest using same pattern as $IPV4_ONLY
check above:
if [ "$LOAD_BALANCER" = "on" ]; then
Also suggest adding LOAD_BALANCER=${LOAD_BALANCER:-off}
above to document script parameters and default behavior.
Note: if this script is unconditionally executed in Bash, the VAR=${VAR:-value}
pattern used above can be rewritten as:
: "${VAR:=value}"
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.
This seems to create the possibility that someone could think that setting LOAD_BALANCER=false would disable load balancer tests, but that would clearly not happen.
Good point. Updated to check for the value "on".
Note: if this script is unconditionally executed in Bash, the VAR=${VAR:-value} pattern used above can be rewritten
Thank you for the suggestion. Updated to explicitly run with bash and declare the LOAD_BALANCER
variable.
.evergreen/integration-tests.sh
Outdated
@@ -61,6 +61,10 @@ if [ -z "$ORCHESTRATION_FILE" ]; then | |||
if [ "$SSL" != "nossl" ]; then | |||
ORCHESTRATION_FILE="${ORCHESTRATION_FILE}-ssl" | |||
fi | |||
|
|||
if [ -n "$LOAD_BALANCER" ]; then |
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.
Agreed; suggest using same pattern as $IPV4_ONLY
check above:
if [ "$LOAD_BALANCER" = "on" ]; then
Also suggest adding LOAD_BALANCER=${LOAD_BALANCER:-off}
above to document script parameters and default behavior.
Note: if this script is unconditionally executed in Bash, the VAR=${VAR:-value}
pattern used above can be rewritten as:
: "${VAR:=value}"
Summary
mongoc_global_mock_service_id
.Resolves CDRIVER-4275 and CDRIVER-4387.
Background & Motivation
integration-tests.sh
and orchestration configs have been updated for load balancer support. The orchestration configs were added in mongodb-labs/drivers-evergreen-tools#183 and later updated in mongodb-labs/drivers-evergreen-tools#186.The C driver maintains a modified copy of the drivers-evergreen-tools script
run-orchestration.sh
asintegration-tests.sh
.integration-tests.sh
may be removed in CDRIVER-4029.The JSON tests in
src/libmongoc/tests/json/initial_seedlist_dns_discovery/load-balanced
were updated to account for mongodb/specifications#1148.Here is a full patch build: https://spruce.mongodb.com/version/6390ffd0850e613823e658de