Skip to content
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

Merged
merged 3 commits into from
Jan 19, 2021
Merged

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Jan 18, 2021

Q A
Type improvement
BC Break no

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.

@alcaeus alcaeus added the Task label Jan 18, 2021
@alcaeus alcaeus requested a review from malarzm January 18, 2021 19:26
@alcaeus alcaeus self-assigned this Jan 18, 2021
runs-on: "${{ matrix.os }}"

strategy:
matrix:
os:
- "ubuntu-20.04"
- "ubuntu-18.04"
Copy link
Member Author

@alcaeus alcaeus Jan 18, 2021

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);
Copy link
Member Author

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.

Copy link
Member

@malarzm malarzm left a 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"
Copy link
Member

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');
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

Sound good 👍

Copy link
Member Author

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.

@alcaeus
Copy link
Member Author

alcaeus commented Jan 19, 2021

As for topology, this is one of the inputs for the workflow. See the README for the full list: https://github.com/mongodb-labs/drivers-evergreen-tools#using-with-github-actions

@alcaeus alcaeus merged commit fa967ea into doctrine:master Jan 19, 2021
@alcaeus alcaeus deleted the test-sharded-setup branch January 19, 2021 19:25
@alexandre-abrioux alexandre-abrioux mentioned this pull request Jan 21, 2021
15 tasks
@GromNaN GromNaN added the CI label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants