Add ventura to mac tests configurations (#17349)

Added Ventura machines to macTestConfigurations within both the
build-ci-pipeline and the build-pr-pipelines.

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
This commit is contained in:
dustin-wojciechowski 2023-02-13 08:08:18 -08:00 коммит произвёл GitHub
Родитель c4c53fed32
Коммит 3eeb7691dc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
16 изменённых файлов: 137 добавлений и 14 удалений

Просмотреть файл

@ -109,6 +109,7 @@ namespace Foundation {
static IntPtr sw = Dlfcn.dlopen (Constants.SharedWithYouLibrary, 1);
static IntPtr swc = Dlfcn.dlopen (Constants.SharedWithYouCoreLibrary, 1);
static IntPtr th = Dlfcn.dlopen (Constants.ThreadNetworkLibrary, 1);
static IntPtr ni = Dlfcn.dlopen (Constants.NearbyInteractionLibrary, 1);
#if !NET
[Obsolete ("Use PlatformAssembly for easier code sharing across platforms.")]

Просмотреть файл

@ -191,7 +191,7 @@ namespace HomeKit {
string FirmwareVersion { get; }
[NullAllowed]
[Mac (13, 0), iOS (16, 1), MacCatalyst (16, 1), Watch (9, 1), TV (16, 1)]
[Mac (13, 0), iOS (16, 1), MacCatalyst (16, 2), Watch (9, 1), TV (16, 1)]
[Export ("matterNodeID", ArgumentSemantic.Copy)]
NSNumber MatterNodeId { get; }

Просмотреть файл

@ -186,6 +186,29 @@ partial class TestRuntime {
#endif
}
public static void AssertDesktop (string message = "This test only runs on Desktops (macOS or MacCatalyst).")
{
#if __MACOS__ || __MACCATALYST__
return;
#endif
NUnit.Framework.Assert.Ignore (message);
}
public static void AssertNotDesktop (string message = "This test does not run on Desktops (macOS or MacCatalyst).")
{
#if __MACOS__ || __MACCATALYST__
NUnit.Framework.Assert.Ignore (message);
#endif
}
public static void AssertNotX64Desktop (string message = "This test does not run on x64 desktops.")
{
#if __MACOS__ || __MACCATALYST__
if (!IsARM64)
NUnit.Framework.Assert.Ignore (message);
#endif
}
public static void AssertNotARM64Desktop (string message = "This test does not run on an ARM64 desktop.")
{
#if __MACOS__ || __MACCATALYST__

Просмотреть файл

@ -134,6 +134,10 @@ namespace Introspection {
return true;
case "HMMatterRequestHandler": // got removed and the current API throws an exception at run time.
return true;
#if __MACCATALYST__
case "PKIdentityButton":
return true;
#endif
}
#if !NET

Просмотреть файл

@ -380,9 +380,9 @@ namespace Introspection {
return true;
}
break;
#if __WATCHOS__
#if (__WATCHOS__ || __MACOS__ || __MACCATALYST__)
case "AVPlayerItem":
switch (selectorName) {
switch (selectorName) { // comes from AVPlayerItem+MPAdditions.h
case "nowPlayingInfo":
case "setNowPlayingInfo:":
return TestRuntime.IsSimulatorOrDesktop;
@ -939,6 +939,26 @@ namespace Introspection {
return true;
break;
}
#endif
break;
case "SKAdImpression":
#if __MACCATALYST__
switch (selectorName) {
case "initWithSourceAppStoreItemIdentifier:advertisedAppStoreItemIdentifier:adNetworkIdentifier:adCampaignIdentifier:adImpressionIdentifier:timestamp:signature:version:":
if (TestRuntime.CheckXcodeVersion (14, 0))
return true;
break;
}
#endif
break;
case "EKParticipant":
#if __MACCATALYST__
switch (selectorName) {
case "ABRecordWithAddressBook:": // Deprecated in 13.1
if (TestRuntime.CheckXcodeVersion (14, 0))
return true;
break;
}
#endif
break;
case "SWRemoveParticipantAlertController":

Просмотреть файл

@ -1072,8 +1072,12 @@ namespace Introspection {
Assert.True (CheckLibrary (s), fi.Name);
break;
#endif
case "ChipLibrary": // Chip is removed entirely beginning Xcode 14
if (!TestRuntime.CheckXcodeVersion (14, 0))
if (TestRuntime.IsDevice)
Assert.True (CheckLibrary (s), fi.Name);
break;
#if !__MACOS__
case "ChipLibrary":
case "ThreadNetworkLibrary":
case "MediaSetupLibrary":
case "MLComputeLibrary":

Просмотреть файл

@ -70,6 +70,7 @@ namespace Introspection {
case "Foundation.NSUnitPressure": // -init should never be called on NSUnit!
case "Foundation.NSUnitSpeed": // -init should never be called on NSUnit!
case "MonoMac.EventKit.EKParticipant":
case "EventKit.EKCalendarItem":
case "EventKit.EKParticipant":
case "XamCore.CoreImage.CISampler":
case "CoreImage.CISampler":

Просмотреть файл

@ -205,7 +205,6 @@ namespace Introspection {
#if __MACCATALYST__
case "BCChatButton":
case "PKAddPassButton":
case "PKPaymentButton":
case "UIButton":
case "UIControl":
case "UISegmentedControl":
@ -222,6 +221,32 @@ namespace Introspection {
if (protocolName == "UIContextMenuInteractionDelegate")
return !TestRuntime.CheckXcodeVersion (12, 0);
break;
// We have to special case the following PKPayment* in MacCatalyst
// since it gets all of these via inheritance from UIView
case "PKPaymentButton":
case "PKPaymentAuthorizationViewController":
switch (protocolName) {
case "UIUserActivityRestoring":
case "UIAppearanceContainer":
case "UIFocusItem":
case "UICoordinateSpace":
case "UIPopoverPresentationControllerSourceItem":
case "UIContextMenuInteractionDelegate":
case "UIFocusItemContainer":
case "UITraitEnvironment":
case "UIActivityItemsConfigurationProviding":
case "UIResponderStandardEditActions":
case "UILargeContentViewerItem":
case "UIDynamicItem":
case "UIAppearance":
case "UIAccessibilityContentSizeCategoryImageAdjusting":
case "UIContentContainer":
if (TestRuntime.CheckXcodeVersion (14, 0))
return true;
break;
}
break;
#endif
}

Просмотреть файл

@ -80,8 +80,13 @@ namespace apitest {
NSRange range;
var rect = textView.GetFirstRect (new NSRange (12, 18), out range);
Assert.AreEqual (rect, new CGRect (0, 0, 12, 14), "NSTextInputClient_ShouldGetFirstRect - Returned wrong rect");
Assert.AreEqual (range, new NSRange (10, 4), "NSTextInputClient_ShouldGetFirstRect - Returned wrong Range");
if (TestRuntime.CheckXcodeVersion (14, 0)) {
Assert.AreEqual (rect, new CGRect (0, 0, 0, 14), "NSTextInputClient_ShouldGetFirstRect - Returned wrong rect");
Assert.AreEqual (range, new NSRange (12, 0), "NSTextInputClient_ShouldGetFirstRect - Returned wrong Range");
} else {
Assert.AreEqual (rect, new CGRect (0, 0, 12, 14), "NSTextInputClient_ShouldGetFirstRect - Returned wrong rect");
Assert.AreEqual (range, new NSRange (10, 4), "NSTextInputClient_ShouldGetFirstRect - Returned wrong Range");
}
}
[Test]
@ -99,7 +104,10 @@ namespace apitest {
[Test]
public void NSTextInputClient_ShouldGetBaselineDelta ()
{
Assert.IsTrue (textView.GetBaselineDelta (4) == 11, "NSTextInputClient_ShouldGetBaselineDelta - Returned wrong baseline delta value");
if (TestRuntime.CheckXcodeVersion (14, 0))
Assert.IsTrue (textView.GetBaselineDelta (4) == 0, "NSTextInputClient_ShouldGetBaselineDelta - Returned wrong baseline delta value");
else
Assert.IsTrue (textView.GetBaselineDelta (4) == 11, "NSTextInputClient_ShouldGetBaselineDelta - Returned wrong baseline delta value");
}
[Test]

Просмотреть файл

@ -76,6 +76,8 @@ namespace MonoTouchFixtures.CoreBluetooth {
[SetUp]
public void SetUp ()
{
if (TestRuntime.IsInCI && TestRuntime.CheckXcodeVersion (14, 0))
TestRuntime.AssertNotDesktop (); // Looks like this particular test doesn't like Desktop + M1 bot machines
// iOS 13 and friends require bluetooth permission
if (TestRuntime.CheckXcodeVersion (11, 0))
TestRuntime.CheckBluetoothPermission (true);

Просмотреть файл

@ -78,7 +78,11 @@ namespace MonoTouchFixtures.EventKit {
Assert.Null (c.Source, "Source");
Assert.False (c.Subscribed, "Subscribed");
#if MONOMAC || __MACCATALYST__
Assert.That (c.SupportedEventAvailabilities, Is.EqualTo (EKCalendarEventAvailability.Busy | EKCalendarEventAvailability.Free), "SupportedEventAvailabilities");
if (TestRuntime.CheckXcodeVersion (14, 0))
Assert.That (c.SupportedEventAvailabilities, Is.EqualTo (EKCalendarEventAvailability.None), "SupportedEventAvailabilities");
else
Assert.That (c.SupportedEventAvailabilities, Is.EqualTo (EKCalendarEventAvailability.Busy | EKCalendarEventAvailability.Free), "SupportedEventAvailabilities");
Assert.That (c.Title, Is.EqualTo (string.Empty), "Title");
#else
Assert.That (c.SupportedEventAvailabilities, Is.EqualTo (EKCalendarEventAvailability.None), "SupportedEventAvailabilities");
@ -120,7 +124,11 @@ namespace MonoTouchFixtures.EventKit {
Assert.Null (c.Source, "Source");
Assert.False (c.Subscribed, "Subscribed");
#if MONOMAC || __MACCATALYST__
Assert.That (c.SupportedEventAvailabilities, Is.EqualTo (EKCalendarEventAvailability.Busy | EKCalendarEventAvailability.Free), "SupportedEventAvailabilities");
if (TestRuntime.CheckXcodeVersion (14, 0))
Assert.That (c.SupportedEventAvailabilities, Is.EqualTo (EKCalendarEventAvailability.None), "SupportedEventAvailabilities");
else
Assert.That (c.SupportedEventAvailabilities, Is.EqualTo (EKCalendarEventAvailability.Busy | EKCalendarEventAvailability.Free), "SupportedEventAvailabilities");
Assert.That (c.Title, Is.EqualTo (string.Empty), "Title");
#else
Assert.That (c.SupportedEventAvailabilities, Is.EqualTo (EKCalendarEventAvailability.None), "SupportedEventAvailabilities");

Просмотреть файл

@ -20,11 +20,8 @@ namespace MonoTouchFixtures.HealthKit {
[SetUp]
public void SetUp ()
{
#if MONOMAC
TestRuntime.AssertXcodeVersion (14, 0);
#else
TestRuntime.AssertNotDesktop (); // Only runs on iOS Devices or Simulators, which makes sense `Apple Walking Steadiness`.
TestRuntime.AssertXcodeVersion (13, 0);
#endif
}
[Test]

Просмотреть файл

@ -42,6 +42,7 @@ namespace MonoTouchFixtures.MetalPerformanceShadersGraph {
TestRuntime.AssertNotSimulator ("Fails with 'Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[MTLSimHeap protectionOptions]: unrecognized selector sent to instance 0x600002a09090' - note that we don't call this selector.");
#endif
TestRuntime.IgnoreInCI ("This test seems to make bots keel over and die.");
TestRuntime.AssertNotX64Desktop (); // Intel Mac is not fast enough.
var device = MTLDevice.SystemDefault;
// some older hardware won't have a default

Просмотреть файл

@ -94,6 +94,7 @@ namespace monotouchtest.Network {
});
}
#if MONOMAC
[Ignore ("Unusable nil instance returned, verified with ObjC project. Filled rdar://FB11984039.")]
[Test]
public void CreateForEthernetChannelTest ()
{

Просмотреть файл

@ -124,6 +124,20 @@ parameters:
"Agent.HasDevices -equals False",
"Agent.IsPaired -equals False"
]
},
{
stageName: 'mac_13_0_m1',
displayName: 'M1 - Mac Ventura (13.0)',
macPool: 'VSEng-VSMac-Xamarin-Shared',
useImage: false,
statusContext: 'M1 - Mac Ventura (13.0)',
demands: [
"Agent.OS -equals Darwin",
"macOS.Name -equals Ventura",
"macOS.Architecture -equals arm64",
"Agent.HasDevices -equals False",
"Agent.IsPaired -equals False"
]
}]
resources:

Просмотреть файл

@ -109,6 +109,20 @@ parameters:
"Agent.HasDevices -equals False",
"Agent.IsPaired -equals False"
]
},
{
stageName: 'mac_13_0_m1',
displayName: 'M1 - Mac Ventura (13.0)',
macPool: 'VSEng-VSMac-Xamarin-Shared',
useImage: false,
statusContext: 'M1 - Mac Ventura (13.0)',
demands: [
"Agent.OS -equals Darwin",
"macOS.Name -equals Ventura",
"macOS.Architecture -equals arm64",
"Agent.HasDevices -equals False",
"Agent.IsPaired -equals False"
]
}]
resources: