From 34f925394eca282289138f9602c3d99e21e444fe Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 8 Aug 2023 17:12:08 +0200 Subject: [PATCH] [tests] Filter out any warnings about out-of-support workloads. Our test projects may be using an earlier version of .NET (in particular Touch.Unit and MonoTouch.Dialog often are), so ignore any warnings about out-of-support workloads. Fixes test failures like: Xamarin.Tests.BundleStructureTest.Build(MacCatalyst,"maccatalyst-x64;maccatalyst-arm64",All,"Debug"): Warnings Expected is with 22 elements, actual is Values differ at index [22] Extra: < "The workload 'maccatalyst' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.", "The workload 'maccatalyst' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.", "The workload 'maccatalyst' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy."... > --- tests/common/BinLog.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/common/BinLog.cs b/tests/common/BinLog.cs index 36fdc413452d..a832cbb2af6e 100644 --- a/tests/common/BinLog.cs +++ b/tests/common/BinLog.cs @@ -175,7 +175,12 @@ public static IEnumerable PrintToLines (string path) public static IEnumerable GetBuildLogWarnings (string path) { - return GetBuildMessages (path).Where (v => v.Type == BuildLogEventType.Warning); + return GetBuildMessages (path) + // Filter to warnings + .Where (v => v.Type == BuildLogEventType.Warning) + // We're often referencing earlier .NET projects (Touch.Unit/MonoTouch.Dialog), so ignore any out-of-support warnings. + .Where (v => v.Message?.Contains ("is out of support and will not receive security updates in the future") != true) + ; } public static IEnumerable GetBuildLogErrors (string path)