Skip to content

Remove testing hacks #1337

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

Merged
merged 5 commits into from
Jun 12, 2018
Merged

Remove testing hacks #1337

merged 5 commits into from
Jun 12, 2018

Conversation

SUPERCILEX
Copy link
Collaborator

This solution isn't great since it means we'll have to mock every FirebaseApp method we use, but it gives us absolute control over every Firebase API.

Signed-off-by: Alex Saveau <[email protected]>
@SUPERCILEX SUPERCILEX requested a review from samtstern as a code owner June 2, 2018 20:10
} catch (IllegalAccessException e) {
throw new IllegalStateException(e);
} catch (NullPointerException e) {
continue; // Instance field, move on

Choose a reason for hiding this comment

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

Seems like one hack is still here ;-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Lol, yeah. The more accurate title would be Remove testing hacks in production in favor of hacks in testing code.

@SUPERCILEX
Copy link
Collaborator Author

@samtstern BTW, all 4.1 PRs are going to fail until #1329 is resolved.

@samtstern
Copy link
Contributor

@SUPERCILEX are you sure this is better? It still relies on reflection that's likely to break one day. May not be any less of a hack than my half-assed dependency injection.

@SUPERCILEX
Copy link
Collaborator Author

Yeah, it's not great, but it moves the hacks to our tests instead of the production code. If you don't agree that that's better (I'm on the fence myself), I'll clean up your injection instead. 👍

@samtstern
Copy link
Contributor

If you have an idea to clean up the injection I'd be all for that instead!

@SUPERCILEX
Copy link
Collaborator Author

@samtstern Voila! Yeah, you're right, this is way better. Thanks! ❤️

@samtstern
Copy link
Contributor

@SUPERCILEX nice!

@samtstern samtstern added this to the 4.1.0 milestone Jun 12, 2018
@samtstern samtstern merged commit 36b118f into firebase:version-4.1.0-dev Jun 12, 2018
@SUPERCILEX SUPERCILEX deleted the tests branch June 12, 2018 21:42
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