Repository navigation
[Mono.Android-Tests] Fix #1191, add new instrumentation class for new NUnit runner - #1413
Merged
Merged
Conversation
See #1191 for more info. It seems that the `Mcc` and `Mnc` values are always present in ActivityInfo.ConfigChanges in Android 8.0+. We'll now only check to make sure `KeyboardHidden` has been set, rather than requiring an exact match.
This fixes an NRE which will occur if the user does not set either IncludedCateroies, ExcludedCategories, or ExcludedTestNames when inheriting from NUnitTestInstrumentation. We should provide an empty filter by default if there is no explicit inclusion/exclusion data specified
jonpryor
reviewed
Mar 13, 2018
|
|
||
| namespace Xamarin.Android.RuntimeTests { | ||
|
|
||
| [Obsolete("Please use Xamarin.Android.RuntimeTests.NUnitTestInstrumentation")] |
Contributor
There was a problem hiding this comment.
Indentation looks weird here. Is it a tabs-vs-spaces issue? Or is GitHub being weird?
Member
Author
There was a problem hiding this comment.
Yeah the whitespace amount is off format here, I can fix it.
grendello
approved these changes
Mar 13, 2018
jonpryor
approved these changes
Mar 13, 2018
Contributor
|
This is odd; macOS+xbuild is failing because of emulator launching:
I'm restarting the build. |
pjcollins
added a commit
that referenced
this pull request
Mar 14, 2018
Fixes: #1191 Fix the `ApplicationTest.EnsureAndroidManifestIsUpdated()` test when running on a Google Pixel 2 w/ Android 8.1.0, as `ActivityInfo.ConfigChanges` always contains the `ConfigChanges.Mcc` and `ConfigChanges.Mnc` values on Android 8.0+. Explicitly check that the `ConfigChanges.KeyboardHidden` flag is set, rather than the entire value. Update `src/Mono.Android/Test` to use the new `NUnitTestRunner` in addition to `Xamarin.Android.NUnitLite`, as the `NUnitTestRunner` reliably produces test result xml files on device which can be pulled and published with ease. Provide a default `TestFilter` value in `NUnitTestRunner`, to avoid a `NullReferenceException` when `$(IncludedCategories)`, `$(ExcludedCategories)`, or `$(ExcludedTestNames)` is not set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MccandMncvalues are now always present in ActivityInfo.ConfigChanges in Android 8.0+. The proposed fix is to ensure thatConfigChangescontains theKeyboardHiddenflag , rather than requiring an exact match.Using the new NUnit runner is desirable as it is reliably producing test result xml files on device which can be pulled and published with ease. The previous runner had issues with certain devices when it came to providing the correct "on device" path to the test result xml. I've only marked the old instrumentation as obsolete (rather than deleting it) as I am not entirely familiar with how it is used in jenkins/wrench, and figured it could be cleaned up at a later date if those tools also want to migrate to use the new instrumentation/runner.