From f0ba3dccfad57de7ebdad32dbca5f06790619436 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 3 Mar 2025 16:38:29 +0100 Subject: [PATCH 1/5] Set DataSetXmlSerializationSupport to true --- .../tests/System.Runtime.Serialization.Xml.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj b/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj index 7f40960460a9fe..936a76d07c9702 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent) + true From 807ee3711f3191ef3e122a820999f7b8362c965e Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 3 Mar 2025 16:42:16 +0100 Subject: [PATCH 2/5] Fix name --- .../tests/System.Runtime.Serialization.Xml.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj b/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj index 936a76d07c9702..f4fd7e61f70115 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj @@ -2,7 +2,7 @@ $(NetCoreAppCurrent) - true + <_DataSetXmlSerializationSupport Condition="'$(EnableAggressiveTrimming)' == 'true'">true From cc7c6cc95934141d2cce159628743fc8c2e58ab1 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 13 Mar 2025 11:33:09 +0100 Subject: [PATCH 3/5] Conditionally run the test --- .../tests/XsdDataContractExporterTests/ExporterTypesTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs index c21b3157294a8d..b3a9f89b46baee 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs @@ -19,7 +19,7 @@ public ExporterTypesTests(ITestOutputHelper output) _output = output; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.DataSetXmlSerializationIsSupported))] public void TypesTest() { var types = new List() From a823dcf766210cad761db692b44c2f2f339a2ece Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 13 Mar 2025 12:38:32 +0100 Subject: [PATCH 4/5] Remove props in the csproj --- .../tests/System.Runtime.Serialization.Xml.Tests.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj b/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj index f4fd7e61f70115..7f40960460a9fe 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/System.Runtime.Serialization.Xml.Tests.csproj @@ -2,7 +2,6 @@ $(NetCoreAppCurrent) - <_DataSetXmlSerializationSupport Condition="'$(EnableAggressiveTrimming)' == 'true'">true From 9e494f8fe084d3e85961a6303c1eea9db9ef1699 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 19 Mar 2025 09:05:21 +0100 Subject: [PATCH 5/5] Disable test --- .../tests/XsdDataContractExporterTests/ExporterTypesTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs index b3a9f89b46baee..9dab40e4793b72 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs @@ -79,7 +79,7 @@ public static IEnumerable GetDynamicallyVersionedTypesTestNegativeData }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.DataSetXmlSerializationIsSupported))] [SkipOnPlatform(TestPlatforms.Browser, "Inconsistent and unpredictable results.")] // TODO - Why does 'TypeWithReadWriteCollectionAndNoCtorOnCollection' only cause an exception sometimes, but not all the time? What's special about wasm here? [ActiveIssue("https://github.com/dotnet/runtime/issues/82967", TestPlatforms.Wasi)] [InlineData(typeof(NoDataContractWithoutParameterlessConstructor), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]