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

Add test on UnifiedTestRunner::setEntityMapObserver() #1129

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Jul 13, 2023

UnifiedTestRunner::setEntityMapObserver() is used in `drivers-atlas-testing.

@GromNaN GromNaN requested review from jmikola and alcaeus July 13, 2023 14:41
@GromNaN GromNaN changed the title Remove unused property $entityMapObserver Remove unused property $entityMapObserver in tests Jul 13, 2023
*
* @param callable(EntityMap):void $entityMapObserver
*/
public function setEntityMapObserver(callable $entityMapObserver): void
Copy link
Member

Choose a reason for hiding this comment

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

This is called from the PHP workload executor in the Atlas testing project (see: workload-executor.php).

If you'd like to repurpose this PR you can add a link to the https://github.com/mongodb-labs/drivers-atlas-testing/ repository.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, it was written in the comment above.

I updated the PR to add link and test this feature.

@GromNaN GromNaN changed the title Remove unused property $entityMapObserver in tests Add test on UnifiedTestRunner::setEntityMapObserver() Jul 17, 2023
Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

LGTM with a cautionary note about reusing tests ;)

{
public function testEntityMapObserver(): void
{
$test = UnifiedTestCase::fromFile(__DIR__ . '/crud/find.json');
Copy link
Member

Choose a reason for hiding this comment

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

For the sake of completeness, this test might start failing if the crud tests change significantly. Creating a separate test would be safer, but for the sake of getting this method tested (and thus used) this suffices.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, I'll create a file specifically test the tester.

Copy link
Member Author

Choose a reason for hiding this comment

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

File added.

@GromNaN GromNaN merged commit e3b6462 into mongodb:master Jul 21, 2023
11 checks passed
@GromNaN GromNaN deleted the entityMapObserver branch July 21, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants