* Try again if we get a DuplicateItem error in MonoTouchFixtures.Security.KeyChainTest.Add_Certificate, hopefully fixes this random test failure:
MonoTouchFixtures.Security.KeyChainTest
[FAIL] Add_Certificate : Add_Certificate
Expected: Success
But was: DuplicateItem
at MonoTouchFixtures.Security.KeyChainTest.Add_Certificate() in /Users/builder/azdo/_work/2/s/xamarin-macios/tests/monotouch-test/Security/KeyChainTest.cs:line 49
Ref: https://github.com/xamarin/maccore/issues/2394
* Use a unique account name in MonoTouchFixtures.Security.RecordTest.Protocol_17579, hopefully fixes this random test failure:
MonoTouchFixtures.Security.RecordTest
[FAIL] Protocol_17579 : Add
Expected: Success
But was: DuplicateItem
at MonoTouchFixtures.Security.RecordTest.Protocol(SecProtocol protocol) in /Users/builder/azdo/_work/2/s/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 204
at MonoTouchFixtures.Security.RecordTest.Protocol_17579() in /Users/builder/azdo/_work/2/s/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 232
Ref: https://github.com/xamarin/maccore/issues/2692
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.
This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.
Also add code to the autoformat script to automatically fix these issues in the future.
* Bump maccore.
New commits in xamarin/maccore:
* xamarin/maccore@9acbbed1f6 [mlaunch] Add support for Xcode 13 beta 1. (#2452)
* xamarin/maccore@e48f75c0b6 [Xamarin.Hosting] Fix the --stdout arg not being forwarded to DeviceLaunchConfig (#2435)
* xamarin/maccore@109c695b1b [Xamarin.Hosting] Fix help string for launchdev argument (#2429)
Diff: cddbd1915d..9acbbed1f6
* [xtro] Fix generation of .pch files
* [xtro] Fix deprecated check to handle (anonymous) declarations and enable latest C# syntax in project
* [xtro] Fix _sanity_ checks
* [xtro] Update todo for beta 1
* [Siminstaller] Force siminstaller to use the xcode 12.5 url
Related issue: https://github.com/xamarin/xamarin-macios/issues/11881
* Fix introspection failures (due to [breaking] changes)
* [tests][intro] Fix hang for tvOS
Creating an instance of `NSMetadataQuery` hangs the simulator.
Even after (xharness) timeout the simulator is not in a good state
to run further tests and every new (tvOS) test will also hang...
* [tests][intro] Same hang for watchOS
except that further test execution does not seem affected (like tvOS)
```
CoreSimulator 772.1 - Device: Apple Watch Series 3 - 38mm (watchOS 8.0) - created by XHarness (42262867-E060-40C0-803E-6DA676AF50CC) - Runtime: watchOS 8.0 (19R5266p) - DeviceType: Apple Watch Series 3 - 38mm
Thread 0 Crashed:: tid_103 Dispatch queue: com.apple.main-thread
0 com.apple.Foundation 0x00007fff21470bd0 -[NSMetadataQuery dealloc] + 432
1 libobjc.A.dylib 0x00007fff200d11f7 objc_object::sidetable_release(bool, bool) + 177
2 com.apple.Foundation 0x00007fff21470a03 -[NSMetadataQuery init] + 64
3 com.xamarin.introspection_watch.watchkitapp.watchkitextension 0x0000000107efc139 xamarin_dyn_objc_msgSend + 217 (trampolines-x86_64-objc_msgSend.s:15)
4 ??? 0x000000010c76d4f6 0 + 4504081654
5 com.xamarin.introspection_watch.watchkitapp.watchkitextension 0x0000000107cffc85 mono_jit_runtime_invoke + 1621 (mini-runtime.c:3197)
6 com.xamarin.introspection_watch.watchkitapp.watchkitextension 0x0000000107e177d8 do_runtime_invoke + 54 (object.c:3052) [inlined]
7 com.xamarin.introspection_watch.watchkitapp.watchkitextension 0x0000000107e177d8 mono_runtime_invoke_checked + 136 (object.c:3220)
8 com.xamarin.introspection_watch.watchkitapp.watchkitextension 0x0000000107e1e3c5 mono_runtime_try_invoke_array + 2101 (object.c:5601)
9 com.xamarin.introspection_watch.watchkitapp.watchkitextension 0x0000000107daf977 ves_icall_InternalInvoke + 871 (icall.c:3927)
10 com.xamarin.introspection_watch.watchkitapp.watchkitextension 0x0000000107dc0167 ves_icall_InternalInvoke_raw + 103 (icall-def.h:667)
11 ??? 0x000000010a232799 0 + 4465043353
12 ??? 0x000000010c76e08b 0 + 4504084619
```
* [tests][monotouch-test] Fix failures with xcode 13 beta 1
* [tests][mmptest] Use a FAT framework that's build with x86_64 and arm64
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
This fixes at least some variations of this failure:
* Protocol_17579: Add
Expected: Success
But was: DuplicateItem
In this test we try to delete any existing keychain items, but it seems that
may fail if the keychain item in question was created by a different app, in
which case we wouldn't have permission to delete it (but adding a new one
would still fail with a duplicate item error). Cleaning up any added keychain
items by the same test (and process) that added them avoids the permissions
problem.
Also clean up in other tests as well, to avoid filling up our keychain with
test stuff.
* [monotouch-test] Rework big parts of KeyChainTest. Fixes #xamarin/maccore@2365.
'GenericPassword' keychain items are unique by their Service+Account
properties [1]. This means that changing the Label property will not create a
different 'GenericPassword', which has a few consequences:
* It's possible to filter (and try to delete) using the Label property.
* It's possible to try to delete a 'GenericPassword' item, and have that
deletion attempt fail with 'no item found', and then subsequently trying to
add the same item will fail with a DuplicateItem, because the deletion
was filtered using the Label property.
The change I've made is to:
* Make the Label property much more descriptive, and unique per process. This
makes it easier to figure out where things come from in the Keychain Access
app.
* Make the Service property unique per process. This way these tests are
parallel safe and they won't stomp on eachother.
* Keep the Account property the same (a constant value), so that it's easy to
filter to just these items in the Keychain Access app.
* Remove the Label property from all queries, it doesn't matter anyway. The
Label property is still set when adding items to the keychain.
Finally try to clean up after ourselves as good as possible. This way we don't
fill the keychain with test stuff. This involves removing certificates and
passwords we add to the keychain at the end of tests.
Fixes https://github.com/xamarin/maccore/issues/2365.
[1]: https://stackoverflow.com/a/11672200/183422
* Adjust query for RecordTest.AuthenticationType as well to not include fields that don't determine uniqueness.
Also make the InternetPassword items we add to the keychain more descriptive and labelled helpfully.
* Fix many version checks to be based on Xcode version instead of iOS version.
* Added/fixed a few expected values according to platform version to match behavior in older macOS versions.