From 1fe689e027f3e288a5a97f9a01e0ba944f981ca9 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Mon, 4 Nov 2024 07:26:32 +0100 Subject: [PATCH] Add logging to RTE integration tests to trace the source of the failing tests (#17376) * Add logging to RTE integration tests to trace the source of the failing tests * Revert build host change * Explicitly log to console * Make the test assertions less fragile --- build/azure-pipelines.yml | 2 +- .../PropertyEditors/RichTextElementLevelVariationTests.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 0e0dbcafc2..602269f6c9 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -71,7 +71,7 @@ stages: - job: A displayName: Build Umbraco CMS pool: - vmImage: 'ubuntu-latest' + vmImage: 'windows-latest' steps: - checkout: self submodules: true diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextElementLevelVariationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextElementLevelVariationTests.cs index 80d02caa15..dfc8ae6141 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextElementLevelVariationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextElementLevelVariationTests.cs @@ -482,7 +482,7 @@ public class RichTextElementLevelVariationTests : BlockEditorElementVariationTes Assert.AreEqual(1, indexValue.Values.Count()); var indexedValue = indexValue.Values.First() as string; Assert.IsNotNull(indexedValue); - var values = indexedValue.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToArray(); + var values = indexedValue.Split(Environment.NewLine).Select(s => s.Trim()).Where(s => s.IsNullOrWhiteSpace() is false).ToArray(); Assert.AreEqual(expectedIndexedValues.Length, values.Length); Assert.IsTrue(values.ContainsAll(expectedIndexedValues)); } @@ -562,7 +562,7 @@ public class RichTextElementLevelVariationTests : BlockEditorElementVariationTes Assert.AreEqual(1, indexValue.Values.Count()); var indexedValue = indexValue.Values.First() as string; Assert.IsNotNull(indexedValue); - var values = indexedValue.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToArray(); + var values = indexedValue.Split(Environment.NewLine).Select(s => s.Trim()).Where(s => s.IsNullOrWhiteSpace() is false).ToArray(); Assert.AreEqual(expectedIndexedValues.Length, values.Length); Assert.IsTrue(values.ContainsAll(expectedIndexedValues)); } @@ -624,7 +624,7 @@ public class RichTextElementLevelVariationTests : BlockEditorElementVariationTes Assert.AreEqual(1, indexValue.Values.Count()); var indexedValue = indexValue.Values.First() as string; Assert.IsNotNull(indexedValue); - var values = indexedValue.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToArray(); + var values = indexedValue.Split(Environment.NewLine).Select(s => s.Trim()).Where(s => s.IsNullOrWhiteSpace() is false).ToArray(); Assert.AreEqual(expectedIndexedValues.Length, values.Length); Assert.IsTrue(values.ContainsAll(expectedIndexedValues)); }