Skip to content

Remove testing hacks#1337

Merged
samtstern merged 5 commits intofirebase:version-4.1.0-devfrom
SUPERCILEX:tests
Jun 12, 2018
Merged

Remove testing hacks#1337
samtstern merged 5 commits intofirebase:version-4.1.0-devfrom
SUPERCILEX:tests

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 <saveau.alexandre@gmail.com>
@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
Copy link

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!

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
@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.

2 participants