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

[tests] Move Mono.Android-Tests to top tests dir #5281

Merged
merged 4 commits into from
Nov 11, 2020

Conversation

pjcollins
Copy link
Member

Context: #5250

PR #5250 will be adding another another Mono.Android-Tests project file,
and it feels like a good time to move all relevant Mono.Android test
source into a single location and reduce duplication where possible.

The src/Mono.Android/Test/ folder has been moved into the top level
tests directory. The two existing tests/Runtime-* folders have been
moved under the new tests/Mono.Android-Tests folder. Some duplication
that existed in the .targets and .projitems files that belonged to these
test projects has been cleaned up.

The obsolete TestInstrumentation class has been deleted in favor of
the newer NUnitInstrumentation class.

The Build.GetSerial () API is restricted on API 29+, so a check has
been added to prevent the following exception:

AndroidRuntime: FATAL EXCEPTION: Instr: xamarin.android.runtimetests.NUnitInstrumentation
AndroidRuntime: Process: Mono.Android_Tests, PID: 3489
AndroidRuntime: java.lang.SecurityException: getSerial: The user 10106 does not meet the requirements to access device identifiers.
AndroidRuntime: 	at android.os.Parcel.createException(Parcel.java:2071)
AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:2039)
AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1987)
AndroidRuntime: 	at android.os.IDeviceIdentifiersPolicyService$Stub$Proxy.getSerialForPackage(IDeviceIdentifiersPolicyService.java:159)
AndroidRuntime: 	at android.os.Build.getSerial(Build.java:162)

Context: dotnet#5250

PR dotnet#5250 will be adding another another Mono.Android-Tests project file,
and it feels like a good time to move all relevant Mono.Android test
source into a single location and reduce duplication where possible.

The `src/Mono.Android/Test/` folder has been moved into the top level
`tests` directory.  The two existing `tests/Runtime-*` folders have been
moved under the new `tests/Mono.Android-Tests` folder.  Some duplication
that existed in the .targets and .projitems files that belonged to these
test projects has been cleaned up.

The obsolete `TestInstrumentation` class has been deleted in favor of
the newer `NUnitInstrumentation` class.

The `Build.GetSerial ()` API is restricted on API 29+, so a check has
been added to prevent the following exception:

    AndroidRuntime: FATAL EXCEPTION: Instr: xamarin.android.runtimetests.NUnitInstrumentation
    AndroidRuntime: Process: Mono.Android_Tests, PID: 3489
    AndroidRuntime: java.lang.SecurityException: getSerial: The user 10106 does not meet the requirements to access device identifiers.
    AndroidRuntime: 	at android.os.Parcel.createException(Parcel.java:2071)
    AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:2039)
    AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1987)
    AndroidRuntime: 	at android.os.IDeviceIdentifiersPolicyService$Stub$Proxy.getSerialForPackage(IDeviceIdentifiersPolicyService.java:159)
    AndroidRuntime: 	at android.os.Build.getSerial(Build.java:162)
@pjcollins pjcollins requested a review from jonpryor November 9, 2020 20:57
@pjcollins pjcollins marked this pull request as ready for review November 10, 2020 15:23
@pjcollins pjcollins requested a review from grendello as a code owner November 10, 2020 15:23
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

Otherwise, if the tests end up green, LTGM 👍

tests/Mono.Android-Tests/Directory.Build.targets Outdated Show resolved Hide resolved
@jonpryor jonpryor merged commit 7e4c16c into dotnet:master Nov 11, 2020
@pjcollins pjcollins deleted the runtime-test-reorg branch November 11, 2020 17:32
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants