From eb8b4f0db7ae420e271d1e172dfa5ddc6bd7dba0 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Mon, 26 Nov 2018 15:21:01 -0500 Subject: [PATCH 1/5] Bump mono to head of 2018-06 (#5177) Commit list for mono/mono: * mono/mono@b63e5378e38 [2018-06][ios] fix path for llvm invocation (#11737) Diff: https://github.com/mono/mono/compare/bb3ae37d71a0993a09abc59a0d8255c074dc885b...b63e5378e389f675640fba97999b82f3ca7a44c2 --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index bb3ae37d71..b63e5378e3 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit bb3ae37d71a0993a09abc59a0d8255c074dc885b +Subproject commit b63e5378e389f675640fba97999b82f3ca7a44c2 From acf8357ece1e43ed0d354e3c5e352a067929e96b Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Tue, 27 Nov 2018 08:34:47 -0500 Subject: [PATCH 2/5] [macos] Fix Constants.mac.cs.in for backward compatibility (#5181) On macOS the path changes are forward but not backward compatible. This means we need to keep older values, as they will work on newer OS, while the new path won't work (on older OS). The test are updated to add exceptions for such cases - in order to give us a better chance to spot typos (since they were some). This should fix https://github.com/xamarin/maccore/issues/1174 https://github.com/xamarin/maccore/issues/1175 https://github.com/xamarin/maccore/issues/1176 https://github.com/xamarin/maccore/issues/1177 --- src/Constants.mac.cs.in | 4 ++-- tests/introspection/ApiTypoTest.cs | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Constants.mac.cs.in b/src/Constants.mac.cs.in index 96a727b415..ce51dbcb58 100644 --- a/src/Constants.mac.cs.in +++ b/src/Constants.mac.cs.in @@ -63,13 +63,13 @@ namespace MonoMac { public const string ScriptingBridgeLibrary = "/System/Library/Frameworks/ScriptingBridge.framework/ScriptingBridge"; public const string CoreDataLibrary = "/System/Library/Frameworks/CoreData.framework/CoreData"; public const string CoreImageLibrary = "/System/Library/Frameworks/QuartzCore.framework/Versions/A/Frameworks/CoreImage.framework/CoreImage"; - public const string CFNetworkLibrary = "/System/Library/Frameworks/CFNetwork.framework/CFNetwork"; + public const string CFNetworkLibrary = "/System/Library/Frameworks/CoreServices.framework/Frameworks/CFNetwork.framework/CFNetwork"; public const string CoreMidiLibrary = "/System/Library/Frameworks/CoreMIDI.framework/CoreMIDI"; public const string QuickLookLibrary = "/System/Library/Frameworks/QuickLook.framework/QuickLook"; public const string AVFoundationLibrary = "/System/Library/Frameworks/AVFoundation.framework/AVFoundation"; public const string AccelerateImageLibrary = "/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/vImage"; - public const string CoreBluetoothLibrary = "/System/Library/Frameworks//CoreBluetooth.framework/CoreBluetooth"; + public const string CoreBluetoothLibrary = "/System/Library/Frameworks/IOBluetooth.framework/Versions/A/Frameworks/CoreBluetooth.framework/CoreBluetooth"; public const string GameKitLibrary = "/System/Library/Frameworks/GameKit.framework/GameKit"; public const string SceneKitLibrary = "/System/Library/Frameworks/SceneKit.framework/SceneKit"; public const string StoreKitLibrary = "/System/Library/Frameworks/StoreKit.framework/StoreKit"; diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index db80c307de..798f64aafb 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -1042,10 +1042,18 @@ namespace Introspection #if MONOMAC // on macOS the file should exist on the specified path // for iOS the simulator paths do not match the strings - if (!File.Exists (lib)) { - if (lib != Constants.CoreImageLibrary) + switch (lib) { + // location changed in 10.8 but it loads fine (and fixing it breaks on earlier macOS) + case Constants.CFNetworkLibrary: + // location changed in 10.10 but it loads fine (and fixing it breaks on earlier macOS) + case Constants.CoreBluetoothLibrary: + // location changed in 10.11 but it loads fine (and fixing it breaks on earlier macOS) + case Constants.CoreImageLibrary: + break; + default: + if (!File.Exists (lib)) return false; - // location changed in 10.11 but it loads fine (and fixing it breaks on earlier macOS) + break; } #endif var h = IntPtr.Zero; From 943e7eafd51d41d7c9fc5e039e9c7184a72ba078 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 27 Nov 2018 14:59:44 +0100 Subject: [PATCH 3/5] [xharness] Add support for stopping queued tasks in the web UI. (#5185) --- tests/xharness/Jenkins.cs | 71 ++++++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index dbb6da7981..a480c12785 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -1159,33 +1159,59 @@ namespace xharness } } break; + case "/stoptest": case "/runtest": response.ContentType = System.Net.Mime.MediaTypeNames.Text.Plain; - using (var writer = new StreamWriter (response.OutputStream)) { - int id; - var id_inputs = arguments ["id"].Split (','); - - // We want to randomize the order the tests are added, so that we don't build first the test for one device, - // then for another, since that would not take advantage of running tests on several devices in parallel. - var rnd = new Random ((int) DateTime.Now.Ticks); - id_inputs = id_inputs.OrderBy (v => rnd.Next ()).ToArray (); - + IEnumerable find_tasks (StreamWriter writer, string ids) + { + var id_inputs = ids.Split (','); foreach (var id_input in id_inputs) { - if (int.TryParse (id_input, out id)) { + if (int.TryParse (id_input, out var id)) { var task = Tasks.FirstOrDefault ((t) => t.ID == id); if (task == null) task = Tasks.Where ((v) => v is AggregatedRunSimulatorTask).Cast ().SelectMany ((v) => v.Tasks).FirstOrDefault ((t) => t.ID == id); if (task == null) { writer.WriteLine ($"Could not find test {id}"); - } else if (task.InProgress || task.Waiting) { + } else { + yield return task; + } + } else { + writer.WriteLine ($"Could not parse {arguments ["id"]}"); + } + } + + } + using (var writer = new StreamWriter (response.OutputStream)) { + var id_inputs = arguments ["id"].Split (','); + + var tasks = find_tasks (writer, arguments ["id"]); + + // We want to randomize the order the tests are added, so that we don't build first the test for one device, + // then for another, since that would not take advantage of running tests on several devices in parallel. + var rnd = new Random ((int) DateTime.Now.Ticks); + tasks = tasks.OrderBy ((v) => rnd.Next ()); + + foreach (var task in tasks) { + switch (request.Url.LocalPath) { + case "/stoptest": + if (!task.Waiting) { + writer.WriteLine ($"Test '{task.TestName}' is not in a waiting state."); + } else { + task.Reset (); + writer.WriteLine ($"OK: {task.ID}"); + } + break; + case "/runtest": + if (task.InProgress || task.Waiting) { writer.WriteLine ($"Test '{task.TestName}' is already executing."); } else { task.Reset (); task.RunAsync (); - writer.WriteLine ("OK"); + writer.WriteLine ($"OK: {task.ID}"); } - } else { - writer.WriteLine ($"Could not parse {arguments ["id"]}"); + break; + default: + throw new NotImplementedException (); } } } @@ -1630,6 +1656,10 @@ function runtest(id) { sendrequest (""runtest?id="" + id); } +function stoptest(id) +{ + sendrequest (""stoptest?id="" + id); +} function sendrequest(url, callback) { var xhttp = new XMLHttpRequest(); @@ -1989,8 +2019,17 @@ function toggleAll (show) writer.Write ($"
"); writer.Write ($"{defaultExpander}"); writer.Write ($"{title} ({state}) "); - if (IsServerMode && !test.InProgress && !test.Waiting) - writer.Write ($" Run "); + if (IsServerMode) { + writer.Write ($" "); + if (test.Waiting) { + writer.Write ($" Stop "); + } else if (test.InProgress) { + // Stopping is not implemented for tasks that are already executing + } else { + writer.Write ($" Run "); + } + writer.Write (" "); + } writer.WriteLine ("
"); writer.WriteLine ($"
"); From 8618db251ce1cb53944e699c95579510b0365a10 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 27 Nov 2018 17:02:39 +0100 Subject: [PATCH 4/5] [xharness] Show device/simulator loading in progress in the web UI. (#5186) --- tests/xharness/Jenkins.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index a480c12785..8fd802950a 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -83,25 +83,29 @@ namespace xharness Devices.Harness = Harness; if (SimulatorLoadLog == null) - SimulatorLoadLog = Logs.Create ($"simulator-list-{Harness.Timestamp}.log", "Simulator Listing"); + SimulatorLoadLog = Logs.Create ($"simulator-list-{Harness.Timestamp}.log", "Simulator Listing (in progress)"); var simulatorLoadTask = Task.Run (async () => { try { await Simulators.LoadAsync (SimulatorLoadLog); + SimulatorLoadLog.Description = "Simulator Listing (ok)"; } catch (Exception e) { SimulatorLoadLog.WriteLine ("Failed to load simulators:"); SimulatorLoadLog.WriteLine (e); + SimulatorLoadLog.Description = $"Simulator Listing ({e.Message})"; } }); if (DeviceLoadLog == null) - DeviceLoadLog = Logs.Create ($"device-list-{Harness.Timestamp}.log", "Device Listing"); + DeviceLoadLog = Logs.Create ($"device-list-{Harness.Timestamp}.log", "Device Listing (in progress)"); var deviceLoadTask = Task.Run (async () => { try { await Devices.LoadAsync (DeviceLoadLog, removed_locked: true); + DeviceLoadLog.Description = "Device Listing (ok)"; } catch (Exception e) { DeviceLoadLog.WriteLine ("Failed to load devices:"); DeviceLoadLog.WriteLine (e); + DeviceLoadLog.Description = $"Device Listing ({e.Message})"; } }); @@ -1788,7 +1792,7 @@ function toggleAll (show) writer.WriteLine ("

Test results

"); foreach (var log in Logs) - writer.WriteLine ("{1}
", log.FullPath.Substring (LogDirectory.Length + 1), log.Description); + writer.WriteLine (" {1}
", log.FullPath.Substring (LogDirectory.Length + 1), log.Description, id_counter++); var headerColor = "black"; if (unfinishedTests.Any ()) { From e8d780229bfc26ad7a5ed09813575e2e5f2ecce4 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 27 Nov 2018 18:09:17 +0100 Subject: [PATCH 5/5] [mmp] Set DEVELOPER_DIR to our Xcode. (#5187) This makes it possible to build mmp (the partial static registrar code) with the wrong system Xcode (which is not supported, but that doesn't mean we can't try to make it mostly work to ease our lives). I tried this in the xcode9 branch (PR #2588), and it didn't stick after the xcode9 branch was merged to master. I tried again a year later with the xcode10 branch (PR #4691), and once again the commit didn't stick after the xcode10 branch was merged to master. So now I'm trying to get this directly into master instead. Let's see if it's still there when we branch for xcode11 next year... --- tools/mmp/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/mmp/Makefile b/tools/mmp/Makefile index 0cc6869eb5..de5437d9c9 100644 --- a/tools/mmp/Makefile +++ b/tools/mmp/Makefile @@ -1,6 +1,8 @@ TOP=../.. include $(TOP)/Make.config +export DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT) + # # mmp #