From 909f039cbd768ed7d2a10161df63c056f5154864 Mon Sep 17 00:00:00 2001 From: Keith Mahoney <41657372+kmahone@users.noreply.github.com> Date: Mon, 9 Dec 2019 09:18:20 -0800 Subject: [PATCH] Enable chk tests (#1729) Adds chk configuration to the test matrix. Fixes #1563 Enabling this configuration uncovered three issues: * RecyclingElementFactory.Templates cannot be set from Xaml on RS4 and below in debug configuration (using reflection provider) #1725 * Test Failure: RepeaterTests.VerifyCurrentAnchor #1726 * NavigationViewTests.EnsureDynamicSizeForPaneHeaderFooterAndCustomContent fails in CHK configuration on RS2 #1734 These three test cases have been disabled for chk configuration for now. --- build/CopyFilesToStagingDir.ps1 | 4 +- dev/CommonManaged/PlatformConfiguration.cs | 9 ++++ .../NavigationViewTests.cs | 8 +++ dev/Repeater/APITests/RepeaterTests.cs | 8 +++ .../Tests/MetadataProviderTests.cs | 54 ++++++++++--------- 5 files changed, 57 insertions(+), 26 deletions(-) diff --git a/build/CopyFilesToStagingDir.ps1 b/build/CopyFilesToStagingDir.ps1 index 43ef4327b8..ba9da84ca9 100644 --- a/build/CopyFilesToStagingDir.ps1 +++ b/build/CopyFilesToStagingDir.ps1 @@ -65,10 +65,10 @@ if($PublishAppxFiles) # Publish pdbs: $symbolsOutputDir = "$($FullPublishDir)\Symbols\" PublishFile -IfExists $FullBuildOutput\Microsoft.UI.Xaml\Microsoft.UI.Xaml.pdb $symbolsOutputDir -PublishFile -IfExists $FullBuildOutput\IXMPTestApp\IXMPTestApp.pdb $symbolsOutputDir +PublishFile -IfExists $FullBuildOutput\IXMPTestApp.TAEF\IXMPTestApp.pdb $symbolsOutputDir PublishFile -IfExists $FullBuildOutput\MUXTestUtilities\MUXTestUtilities.pdb $symbolsOutputDir PublishFile -IfExists $FullBuildOutput\MUXControls.Test\MUXControls.Test.pdb $symbolsOutputDir -PublishFile -IfExists $FullBuildOutput\MUXControlsTestApp\MUXControlsTestApp.pdb $symbolsOutputDir +PublishFile -IfExists $FullBuildOutput\MUXControlsTestApp.TAEF\MUXControlsTestApp.pdb $symbolsOutputDir PublishFile -IfExists $FullBuildOutput\MUXControlsTestAppForIslands\MUXControlsTestAppForIslands.pdb $symbolsOutputDir PublishFile -IfExists $FullBuildOutput\MUXControlsTestAppWPF\MUXControlsTestAppWPF.pdb $symbolsOutputDir PublishFile -IfExists $FullBuildOutput\TestAppCX\TestAppCX.pdb $symbolsOutputDir diff --git a/dev/CommonManaged/PlatformConfiguration.cs b/dev/CommonManaged/PlatformConfiguration.cs index 934fcddc7f..278a0308e5 100644 --- a/dev/CommonManaged/PlatformConfiguration.cs +++ b/dev/CommonManaged/PlatformConfiguration.cs @@ -101,5 +101,14 @@ public static bool IsOSVersionLessThan(OSVersion version) { return !IsOsVersionGreaterThanOrEqual(version); } + + public static bool IsDebugBuildConfiguration() + { +#if DEBUG + return true; +#else + return false; +#endif + } } } diff --git a/dev/NavigationView/NavigationView_InteractionTests/NavigationViewTests.cs b/dev/NavigationView/NavigationView_InteractionTests/NavigationViewTests.cs index 5d4f91b352..7d9944fe06 100644 --- a/dev/NavigationView/NavigationView_InteractionTests/NavigationViewTests.cs +++ b/dev/NavigationView/NavigationView_InteractionTests/NavigationViewTests.cs @@ -3722,6 +3722,14 @@ public void EnsureTopSettingsRetainsFocusAfterOrientationChanges() [TestProperty("TestSuite", "D")] public void EnsureDynamicSizeForPaneHeaderFooterAndCustomContent() { + if (PlatformConfiguration.IsDebugBuildConfiguration()) + { + // Test is failing in chk configuration due to: + // Bug #1734 NavigationViewTests.EnsureDynamicSizeForPaneHeaderFooterAndCustomContent fails in CHK configuration + Log.Warning("Skipping test for Debug builds."); + return; + } + using (var setup = new TestSetupHelper(new[] { "NavigationView Tests", "NavigationView Stretch Test" })) { Button navButton = new Button(FindElement.ById("TogglePaneButton")); diff --git a/dev/Repeater/APITests/RepeaterTests.cs b/dev/Repeater/APITests/RepeaterTests.cs index 1864077561..f7d65a57cf 100644 --- a/dev/Repeater/APITests/RepeaterTests.cs +++ b/dev/Repeater/APITests/RepeaterTests.cs @@ -196,6 +196,14 @@ public void ValidateGetSetBackground() [TestMethod] public void VerifyCurrentAnchor() { + if(PlatformConfiguration.IsDebugBuildConfiguration()) + { + // Test is failing in chk configuration due to: + // Bug #1726 Test Failure: RepeaterTests.VerifyCurrentAnchor + Log.Warning("Skipping test for Debug builds."); + return; + } + ItemsRepeater rootRepeater = null; ScrollViewer scrollViewer = null; ItemsRepeaterScrollHost scrollhost = null; diff --git a/test/IXMPTestApp/Tests/MetadataProviderTests.cs b/test/IXMPTestApp/Tests/MetadataProviderTests.cs index 8e869a78e8..fe43734e15 100644 --- a/test/IXMPTestApp/Tests/MetadataProviderTests.cs +++ b/test/IXMPTestApp/Tests/MetadataProviderTests.cs @@ -55,30 +55,36 @@ public void CanLoadXamlFragments() "); - Log.Comment("Loading ItemsRepeater..."); - XamlReader.Load(@" - - - - - - - - - - - - - - - - - - - "); + + // This test case is disabled in Debug configuration due to: + // Bug #1725: RecyclingElementFactory.Templates cannot be set from Xaml on RS4 and below in debug configuration (using reflection provider) + if (!PlatformConfiguration.IsDebugBuildConfiguration()) + { + Log.Comment("Loading ItemsRepeater..."); + XamlReader.Load(@" + + + + + + + + + + + + + + + + + + + "); + } Log.Comment("Loading SwipeControl..."); XamlReader.Load(@"