-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Run tests on sharded clusters #2272
Conversation
runs-on: "${{ matrix.os }}" | ||
|
||
strategy: | ||
matrix: | ||
os: | ||
- "ubuntu-20.04" | ||
- "ubuntu-18.04" |
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.
Note: going back to 18.04 as drivers-evergreen-tools only supports MongoDB 4.4 on 20.04. 18.04 supports MongoDB 4.0, 4.2, and 4.4.
@@ -46,6 +46,8 @@ public function testHintIsNotSetByDefault() | |||
*/ | |||
public function testHintIsSetOnQuery($readPreference, array $tags = []) | |||
{ | |||
$this->skipTestIfSharded(User::class); |
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.
The sharded cluster uses a single-member replica set, so a functional test that runs a find
with a secondary read preference always fails.
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 have no clue what's topology
doing in GH actions but I know you know what you're doing :)
deps: | ||
- "normal" | ||
include: | ||
- deps: "low" | ||
os: "ubuntu-20.04" | ||
os: "ubuntu-16.04" |
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.
Hopefully this image won't disappear before MongoDB ends support for 3.6 in April :)
{ | ||
$result = $this->dm->getDocumentDatabase($className)->command(['listCommands' => true])->toArray()[0]; | ||
if (! $result['ok']) { | ||
$this->markTestSkipped('Could not check whether server supports sharding'); |
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.
Shouldn't this one be marked as risky
as we can't determine if the test should run or not? This will be easier to spot than S
which already is showing up in the results.
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 can also throw an exception to let the test fail: if we can't run listCommands
this warrants further investigation.
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.
Sound good 👍
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've removed the check entirely: the command
method already throws an exception for failed commands, so the checks are total unnecessary. I've removed them.
As for |
Summary
This part of the pipeline was dropped when we moved from travis-ci to GH actions. This now uses the (definitely unsupported) mongodb-labs/drivers-evergreen-tools repository to launch MongoDB clusters of any version/topology.