diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index a4731ca3719a..525e8c65623d 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -329,19 +329,20 @@ void AutoConfigureIOS () IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "bcl-test/mscorlib/mscorlib-0.csproj")), false)); IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "bcl-test/mscorlib/mscorlib-1.csproj")), false)); foreach (var p in test_suites) - IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".csproj")))); + IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".csproj"))) { Name = p }); foreach (var p in fsharp_test_suites) - IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".fsproj")))); + IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".fsproj"))) { Name = p }); foreach (var p in library_projects) - IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".csproj")), false)); + IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".csproj")), false) { Name = p }); foreach (var p in fsharp_library_projects) - IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".fsproj")), false)); + IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".fsproj")), false) { Name = p }); foreach (var p in bcl_suites) { BCLTestInfo bclTestInfo = new BCLTestInfo (this, p); IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "bcl-test/" + p + "/" + p + ".csproj"))) { SkipwatchOSVariation = bcl_skip_watchos.Contains (p), - BCLInfo = bclTestInfo + BCLInfo = bclTestInfo, + Name = p }); } diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index afb804b8eea3..da94ab25178b 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -23,6 +23,7 @@ public class Jenkins public bool IncludeMac32 = true; public bool IncludeiOS = true; public bool IncludeiOSExtensions; + public bool ForceExtensionBuildOnly; public bool IncludetvOS = true; public bool IncludewatchOS = true; public bool IncludeMmpTest; @@ -385,7 +386,7 @@ IEnumerable CreateRunDeviceTasks () TestName = project.Name, }; build64.CloneTestProject (project); - rv.Add (new RunDeviceTask (build64, Devices.ConnectedDevices.Where ((dev) => dev.DevicePlatform == DevicePlatform.iOS && dev.Supports64Bit)) { Ignored = ignored || !IncludeiOS }); + rv.Add (new RunDeviceTask (build64, Devices.Connected64BitIOS) { Ignored = ignored || !IncludeiOS, BuildOnly = project.BuildOnly }); var build32 = new XBuildTask { Jenkins = this, @@ -395,7 +396,7 @@ IEnumerable CreateRunDeviceTasks () TestName = project.Name, }; build32.CloneTestProject (project); - rv.Add (new RunDeviceTask (build32, Devices.ConnectedDevices.Where ((dev) => dev.DevicePlatform == DevicePlatform.iOS && dev.Supports32Bit)) { Ignored = ignored || !IncludeiOS }); + rv.Add (new RunDeviceTask (build32, Devices.Connected32BitIOS) { Ignored = ignored || !IncludeiOS, BuildOnly = project.BuildOnly }); var todayProject = project.AsTodayExtensionProject (); var buildToday = new XBuildTask { @@ -406,7 +407,7 @@ IEnumerable CreateRunDeviceTasks () TestName = project.Name, }; buildToday.CloneTestProject (todayProject); - rv.Add (new RunDeviceTask (buildToday, Devices.ConnectedDevices.Where ((dev) => dev.DevicePlatform == DevicePlatform.iOS && dev.Supports64Bit)) { Ignored = ignored || !IncludeiOSExtensions }); + rv.Add (new RunDeviceTask (buildToday, Devices.Connected64BitIOS) { Ignored = ignored || !IncludeiOSExtensions, BuildOnly = project.BuildOnly || ForceExtensionBuildOnly }); } if (!project.SkiptvOSVariation) { @@ -419,7 +420,7 @@ IEnumerable CreateRunDeviceTasks () TestName = project.Name, }; buildTV.CloneTestProject (tvOSProject); - rv.Add (new RunDeviceTask (buildTV, Devices.ConnectedDevices.Where ((dev) => dev.DevicePlatform == DevicePlatform.tvOS)) { Ignored = ignored || !IncludetvOS }); + rv.Add (new RunDeviceTask (buildTV, Devices.ConnectedTV) { Ignored = ignored || !IncludetvOS, BuildOnly = project.BuildOnly }); } if (!project.SkipwatchOSVariation) { @@ -432,7 +433,7 @@ IEnumerable CreateRunDeviceTasks () TestName = project.Name, }; buildWatch.CloneTestProject (watchOSProject); - rv.Add (new RunDeviceTask (buildWatch, Devices.ConnectedDevices.Where ((dev) => dev.DevicePlatform == DevicePlatform.watchOS)) { Ignored = ignored || !IncludewatchOS }); + rv.Add (new RunDeviceTask (buildWatch, Devices.ConnectedWatch) { Ignored = ignored || !IncludewatchOS, BuildOnly = project.BuildOnly }); } } @@ -460,6 +461,8 @@ void SelectTests () // whatever we did automatically. SelectTestsByLabel (pull_request); + DisableKnownFailingDeviceTests (); + if (!Harness.INCLUDE_IOS) { MainLog.WriteLine ("The iOS build is diabled, so any iOS tests will be disabled as well."); IncludeiOS = false; @@ -481,6 +484,16 @@ void SelectTests () } } + void DisableKnownFailingDeviceTests () + { + // https://github.com/xamarin/maccore/issues/1008 + ForceExtensionBuildOnly = true; + + // https://github.com/xamarin/maccore/issues/1011 + foreach (var mono in Harness.IOSTestProjects.Where (x => x.Name == "mini")) + mono.BuildOnly = true; + } + void SelectTestsByModifiedFiles (int pull_request) { var files = GitHub.GetModifiedFiles (Harness, pull_request); @@ -3083,6 +3096,7 @@ protected override async Task RunTestAsync () abstract class RunTestTask : TestTask { public readonly BuildToolTask BuildTask; + public bool BuildOnly; public RunTestTask (BuildToolTask build_task) { @@ -3150,6 +3164,11 @@ protected override async Task ExecuteAsync () if (!await BuildAsync ()) return; + if (BuildOnly) { + ExecutionResult = TestExecutingResult.Succeeded; + return; + } + ExecutionResult = TestExecutingResult.Running; duration.Restart (); // don't count the build time. await RunTestAsync (); diff --git a/tests/xharness/Simulators.cs b/tests/xharness/Simulators.cs index 976ee404eb80..f121ef2394f9 100644 --- a/tests/xharness/Simulators.cs +++ b/tests/xharness/Simulators.cs @@ -646,11 +646,12 @@ public class Devices bool loaded; BlockingEnumerableCollection connected_devices = new BlockingEnumerableCollection (); - public IEnumerable ConnectedDevices { - get { - return connected_devices; - } - } + + public IEnumerable ConnectedDevices => connected_devices; + public IEnumerable Connected64BitIOS => connected_devices.Where (x => x.DevicePlatform == DevicePlatform.iOS && x.Supports64Bit); + public IEnumerable Connected32BitIOS => connected_devices.Where (x => x.DevicePlatform == DevicePlatform.iOS && x.Supports32Bit); + public IEnumerable ConnectedTV => connected_devices.Where (x => x.DevicePlatform == DevicePlatform.tvOS); + public IEnumerable ConnectedWatch => connected_devices.Where (x => x.DevicePlatform == DevicePlatform.watchOS); public async Task LoadAsync (Log log, bool extra_data = false, bool removed_locked = false, bool force = false) { diff --git a/tests/xharness/TestProject.cs b/tests/xharness/TestProject.cs index 0e18547221fc..ff79cab882f2 100644 --- a/tests/xharness/TestProject.cs +++ b/tests/xharness/TestProject.cs @@ -145,6 +145,7 @@ public class iOSTestProject : TestProject public bool SkipiOSVariation; public bool SkipwatchOSVariation; public bool SkiptvOSVariation; + public bool BuildOnly; // Optional public BCLTestInfo BCLInfo { get; set; }