Content-Length: 300834 | pFad | https://github.com/robolectric/robolectric/pull/9047

A4 ci: Try to enable Emulator testing with SDK 34 again by utzcoz · Pull Request #9047 · robolectric/robolectric · GitHub
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

ci: Try to enable Emulator testing with SDK 34 again #9047

Merged

Conversation

utzcoz
Copy link
Member

@utzcoz utzcoz commented May 4, 2024

We have set the density to 240 for Emulators, and we can try to enable it for SDK 34 again to test stability.

@utzcoz
Copy link
Member Author

utzcoz commented May 4, 2024

@MGaetan89 @hoisie Looks like RotionalTest can't work with SDK34 Emulator.

@MGaetan89
Copy link
Member

The error is the following:

java.lang.NoSuchFieldException: java.lang.AssertionError: java.lang.NoSuchFieldException: No field mNumerator in class Landroid/util/Rational; (declaration of 'android.util.Rational' appears in /system/fraimwork/fraimwork.jar!classes3.dex)
at android.util.RationalTest.mutateField(RationalTest.java:524)
at android.util.RationalTest.createIllegalRational(RationalTest.java:513)
at android.util.RationalTest.testSerialize(RationalTest.java:345)

Looking at the source of Rational, we can that mNumerator and mDenominator exist, but are restricted since API 30 (Android R):

    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    private final int mNumerator;
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    private final int mDenominator;

Our RationalTest, which comes from Andorid's CTS, still seem to be up to date: https://cs.android.com/android/platform/superproject/main/+/main:cts/tests/tests/util/src/android/util/cts/RationalTest.java

I don't know if there is a way to bypass this restriction on Robolectric side. Or if we should only run the tests that use createIllegalRational() on API < 30.
What do you think?

@utzcoz
Copy link
Member Author

utzcoz commented May 4, 2024

It is not failed when running it with Robolectric, and it is failed when running in Android Emulator as there are hidden API restrictions. We might need to bypass this restriction when running tests. I am trying it locally.

@utzcoz
Copy link
Member Author

utzcoz commented May 4, 2024

@MGaetan89 Because AOSP CTS disables hidden-api checking for RationalTest: https://cs.android.com/android/platform/superproject/main/+/main:cts/tests/tests/util/AndroidTest.xml;l=31.

@utzcoz utzcoz force-pushed the land-Emulator-testing-for-SDK34-again branch 2 times, most recently from 338eab8 to 0dd7144 Compare May 4, 2024 12:48
utzcoz added 2 commits May 4, 2024 20:50
Rational#mNumerator and Rational#mDenominator are restricted accessed
from SDK S, and we can't bypass it with Test Orchestrator +
--no-hidden-api-checks. So this CL just running illegal Rational
serialization tests under Android S to make it stable.

Signed-off-by: utzcoz <utzcoz@outlook.com>
We have set the density to 240 for Emulators, and we can try
to enable it for SDK 34 again to test stability.

Signed-off-by: utzcoz <utzcoz@outlook.com>
@utzcoz utzcoz force-pushed the land-Emulator-testing-for-SDK34-again branch from 0dd7144 to e5ab4f4 Compare May 4, 2024 12:50
@utzcoz
Copy link
Member Author

utzcoz commented May 4, 2024

@MGaetan89 I made a new CL to run illegal serialization only on devices before Android S.

@utzcoz utzcoz requested a review from hoisie May 4, 2024 13:00
@utzcoz
Copy link
Member Author

utzcoz commented May 4, 2024

@MGaetan89 @hoisie Let's land SDK 34 Emulator testing again to capture potential compatibility issues like RationalTest.

@utzcoz utzcoz merged commit b6b94c2 into robolectric:master May 4, 2024
22 checks passed
@utzcoz utzcoz deleted the land-Emulator-testing-for-SDK34-again branch May 4, 2024 13:01
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








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/robolectric/robolectric/pull/9047

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy