Skip to content

Conversation

@brizental
Copy link
Contributor

No description provided.

Copy link
Contributor

@Dexterp37 Dexterp37 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 one additional concern: by doing this, if Glean is initialized in the code being tested (e.g. Rally inits Glean), then the tests might send pings because the uploader is no longer the one from the test platform. To cover these cases, and avoid the potential of submitting pings from tests, can we make testResetGlean use a mock default uploader is none is passed via the configuration?

@brizental
Copy link
Contributor Author

I have one additional concern: by doing this, if Glean is initialized in the code being tested (e.g. Rally inits Glean), then the tests might send pings because the uploader is no longer the one from the test platform.

Note that testResetGlean always uninitializes before initializing. Therefore even if Glean is initialized in the code being tested before testResetGlean is called, the platform and config is still overwritten.

This is why I decided to rely on initialized to set the platform or not, instead of just checking if there is a platform there already. Writing this out gives me the vibe that it is fragile, but such fragility would be mitigated by work on Bug 1682771 and a clear testing state for Glean.

@brizental brizental force-pushed the 1701652-platform-disallow branch from 371ab84 to 3a4c202 Compare April 14, 2021 10:32
@brizental brizental merged commit 0f97c60 into mozilla:main Apr 15, 2021
@brizental brizental deleted the 1701652-platform-disallow branch April 15, 2021 12:38
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.

2 participants