Skip to content

firebase-perf: Add custom method to set final static method for test #5312

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

Conversation

utzcoz
Copy link
Contributor

@utzcoz utzcoz commented Sep 11, 2023

Robolectric's ReflectionHelpers removes supporting of setting fnial static method becasuse it not the reposibility of Robolectric, and it will not be allowed by the latest JDK. This CL just adds custom method to do the same things as a workaround. When the project updates the JDK someday, the maintainer needs to rewrite the test or provides some test helper method to avoid set final static method for test.

Robolectric's ReflectionHelpers removes supporting of setting fnial
static method becasuse it not the reposibility of Robolectric, and
it will not be allowed by the latest JDK. This CL just adds custom
method to do the same things as a workaround. When the project updates
the JDK someday, the maintainer needs to rewrite the test or provides
some test helper method to avoid set final static method for test.

Signed-off-by: utzcoz <[email protected]>
@utzcoz
Copy link
Contributor Author

utzcoz commented Sep 11, 2023

Prepare for #5149.

@utzcoz
Copy link
Contributor Author

utzcoz commented Sep 11, 2023

@rlazo This is another preparation PR for Robolectric 4.10.3 as it removes the supporting of set final static field from ReflectionHelpers because the team thinks it is not the Robolectric's responsibility. This PR add a workaround to implement the same function by Firebase's test itself.

Also I found logGaugeMetric_globalCustomAttributesAreNotAdded is common flaky on CI although my changes don't effect it. Could you help take a look at it? Thanks.

@rlazo
Copy link
Collaborator

rlazo commented Sep 13, 2023

@rlazo This is another preparation PR for Robolectric 4.10.3 as it removes the supporting of set final static field from ReflectionHelpers because the team thinks it is not the Robolectric's responsibility. This PR add a workaround to implement the same function by Firebase's test itself.

Also I found logGaugeMetric_globalCustomAttributesAreNotAdded is common flaky on CI although my changes don't effect it. Could you help take a look at it? Thanks.

Yes, I double check locally using your branch and it's passing. When ready, feel free to assign me as reviewer of this PR. Thanks!

@utzcoz
Copy link
Contributor Author

utzcoz commented Sep 14, 2023

@rlazo Thanks for testing. I think this PR is ready for reviewing now. Unfortunately, I don't have permission to assign a reviewer, and the GitHub doesn't show any recommendation people to us in the PR page. It might need your help to assign. Thanks.

@rlazo rlazo self-requested a review September 14, 2023 15:36
@rlazo
Copy link
Collaborator

rlazo commented Sep 14, 2023

@visumickey could you take a look at this change? Thanks!

@rlazo rlazo requested a review from visumickey September 14, 2023 15:38
@rlazo
Copy link
Collaborator

rlazo commented Sep 18, 2023

Thanks a lot for your contribution @utzcoz !

@rlazo rlazo merged commit f00c02f into firebase:master Sep 18, 2023
@utzcoz utzcoz deleted the migrate-Robolectric-ReflectoinHelpers-setStaticField branch September 19, 2023 00:36
@utzcoz
Copy link
Contributor Author

utzcoz commented Sep 19, 2023

@rlazo Thanks for your reviewing.

@visumickey
Copy link
Contributor

Sorry for being late here. The changes look good to me.

@firebase firebase locked and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants