From a9600ab0d0233e3f64788e7cfd7bf6102218080d 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 4ae578ca46c7..3220cae9e7f4 100644 --- a/tests/common/BinLog.cs +++ b/tests/common/BinLog.cs @@ -176,7 +176,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)