From 965ada1b352a8aaecc52b77c8e7389af067252ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Wed, 7 Jun 2023 14:28:49 +0200 Subject: [PATCH 1/8] Update test matrix --- eng/Versions.props | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index ebd4cc6d86..848c3e65c5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,24 +52,24 @@ 17.4.1 - 2.3.0-preview-20220711-02 - 2.3.0-preview-20220711-02 + 3.0.4 + 3.0.4 1.0.3-preview - 2.3.1 - 2.3.1 - 2.3.1 - 3.10.1 - 3.11.0 - 3.8.0 + 2.4.2 + 2.4.5 + 2.4.2 + 3.13.3 + 4.5.0 + 3.16.3 - [2.3.0-preview-20220613-02] - [2.2.10] - [2.2.9] + [3.0.4] + [3.0.4] + [2.2.10] [2.1.0] [2.1.0] [1.4.0] @@ -77,10 +77,10 @@ See Invoke-TestAssetsBuild in scripts/build.ps1. Exact versions are used to avoid Nuget substituting them by closest match, if we make a typo. These versions need to be "statically" readable because we read this file as xml in our build and tests. --> - [17.2.0-preview-20220401-08] - [17.2.0] - [17.1.0] - [16.6.1] + [17.6.2] + [17.6.2] + [17.5.0] + [17.2.0] [16.11.0] [15.9.2] From a10548c0fe08de4c799f3fb2d3095cc46ae96046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Mon, 27 Nov 2023 12:55:15 +0100 Subject: [PATCH 2/8] update --- eng/Versions.props | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 848c3e65c5..7485904986 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -67,20 +67,20 @@ These versions need to be "statically" readable because we read this file as xml in our build and tests. --> - [3.0.4] - [3.0.4] - [2.2.10] - [2.1.0] - [2.1.0] + [3.1.1] + [3.1.1] + [3.0.2] + [2.2.10] + [2.1.2] [1.4.0] - [17.6.2] - [17.6.2] - [17.5.0] - [17.2.0] + [17.9.0-preview-23531-01] + [17.8.0] + [17.7.0 + [17.5.0] [16.11.0] [15.9.2] From d1e9536b099fdb7073ef41e7b596a1cd14164367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Mon, 27 Nov 2023 14:58:43 +0100 Subject: [PATCH 3/8] Fix test --- .../NetCoreTargetFrameworkDataSourceAttribute.cs | 4 ++-- ...ataCollectorAttachmentProcessorAppDomainTests.cs | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetCoreTargetFrameworkDataSourceAttribute.cs b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetCoreTargetFrameworkDataSourceAttribute.cs index eec13fe74c..5cc808dd7f 100644 --- a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetCoreTargetFrameworkDataSourceAttribute.cs +++ b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetCoreTargetFrameworkDataSourceAttribute.cs @@ -81,8 +81,8 @@ public IEnumerable GetData(MethodInfo methodInfo) return dataRows; } - public string GetDisplayName(MethodInfo methodInfo, object[] data) + public string GetDisplayName(MethodInfo methodInfo, object?[]? data) { - return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", methodInfo.Name, string.Join(",", data)); + return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", methodInfo.Name, string.Join(",", data ?? Array.Empty())); } } diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/AttachmentsProcessing/DataCollectorAttachmentProcessorAppDomainTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/AttachmentsProcessing/DataCollectorAttachmentProcessorAppDomainTests.cs index eeef74233d..ca3ebea968 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/AttachmentsProcessing/DataCollectorAttachmentProcessorAppDomainTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/AttachmentsProcessing/DataCollectorAttachmentProcessorAppDomainTests.cs @@ -87,17 +87,18 @@ public async Task DataCollectorAttachmentProcessorAppDomain_ShouldReturnCorrectA Assert.IsTrue(dcap.LoadSucceded); var attachmentsResult = await dcap.ProcessAttachmentSetsAsync(doc.DocumentElement, attachments, new Progress(), _loggerMock.Object, CancellationToken.None); + var firstAttachmentSet = attachmentsResult.First(); // assert // We return same instance but we're marshaling so we expected different pointers - Assert.AreNotSame(attachmentSet, attachmentsResult); + Assert.AreNotSame(attachmentSet, firstAttachmentSet); - Assert.AreEqual(attachmentSet.DisplayName, attachmentsResult.First().DisplayName); - Assert.AreEqual(attachmentSet.Uri, attachmentsResult.First().Uri); + Assert.AreEqual(attachmentSet.DisplayName, firstAttachmentSet.DisplayName); + Assert.AreEqual(attachmentSet.Uri, firstAttachmentSet.Uri); Assert.AreEqual(attachmentSet.Attachments.Count, attachmentsResult.Count); - Assert.AreEqual(attachmentSet.Attachments[0].Description, attachmentsResult.First().Attachments[0].Description); - Assert.AreEqual(attachmentSet.Attachments[0].Uri, attachmentsResult.First().Attachments[0].Uri); - Assert.AreEqual(attachmentSet.Attachments[0].Uri, attachmentsResult.First().Attachments[0].Uri); + Assert.AreEqual(attachmentSet.Attachments[0].Description, firstAttachmentSet.Attachments[0].Description); + Assert.AreEqual(attachmentSet.Attachments[0].Uri, firstAttachmentSet.Attachments[0].Uri); + Assert.AreEqual(attachmentSet.Attachments[0].Uri, firstAttachmentSet.Attachments[0].Uri); } [TestMethod] From d92aed0f27bd07a10d3ebd04c4be90a4cdfee360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Mon, 27 Nov 2023 15:21:58 +0100 Subject: [PATCH 4/8] Update --- eng/Versions.props | 2 +- .../Extension/NetCoreRunnerAttribute.cs | 4 ++-- .../CodeCoverageDataAttachmentsHandlerTests.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 7485904986..dad56211ea 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -67,7 +67,7 @@ These versions need to be "statically" readable because we read this file as xml in our build and tests. --> - [3.1.1] + [3.2.0-preview.23577.2] [3.1.1] [3.0.2] [2.2.10] diff --git a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetCoreRunnerAttribute.cs b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetCoreRunnerAttribute.cs index 977ae98fbc..478c595d3d 100644 --- a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetCoreRunnerAttribute.cs +++ b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetCoreRunnerAttribute.cs @@ -65,8 +65,8 @@ public IEnumerable GetData(MethodInfo methodInfo) return dataRows; } - public string GetDisplayName(MethodInfo methodInfo, object[] data) + public string GetDisplayName(MethodInfo methodInfo, object?[]? data) { - return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", methodInfo.Name, string.Join(",", data)); + return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", methodInfo.Name, string.Join(",", data ?? Array.Empty())); } } diff --git a/test/Microsoft.TestPlatform.Utilities.UnitTests/CodeCoverageDataAttachmentsHandlerTests.cs b/test/Microsoft.TestPlatform.Utilities.UnitTests/CodeCoverageDataAttachmentsHandlerTests.cs index b6626f081b..471355c0f4 100644 --- a/test/Microsoft.TestPlatform.Utilities.UnitTests/CodeCoverageDataAttachmentsHandlerTests.cs +++ b/test/Microsoft.TestPlatform.Utilities.UnitTests/CodeCoverageDataAttachmentsHandlerTests.cs @@ -33,7 +33,7 @@ public class CodeCoverageDataAttachmentsHandlerTests public TestContext? TestContext { get; set; } - internal string TestFilesDirectory => Path.Combine(TestContext!.DeploymentDirectory, "TestFiles"); + internal string TestFilesDirectory => Path.Combine(TestContext!.DeploymentDirectory!, "TestFiles"); public CodeCoverageDataAttachmentsHandlerTests() { From 8334d7bf1384151544645c122c742b486d3c8db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Mon, 27 Nov 2023 16:09:45 +0100 Subject: [PATCH 5/8] finally? --- .../Extension/TestDataSourceAttribute.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/TestDataSourceAttribute.cs b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/TestDataSourceAttribute.cs index 6f7a6adae2..90f520aeb3 100644 --- a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/TestDataSourceAttribute.cs +++ b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/TestDataSourceAttribute.cs @@ -32,9 +32,9 @@ IEnumerable ITestDataSource.GetData(MethodInfo methodInfo) return _data; } - string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object[] data) + string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object?[]? data) { - return GetDisplayName(methodInfo, (T1)data[0]); + return GetDisplayName(methodInfo, (T1)data![0]!); } } @@ -63,9 +63,9 @@ IEnumerable ITestDataSource.GetData(MethodInfo methodInfo) return _data; } - string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object[] data) + string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object?[]? data) { - return GetDisplayName(methodInfo, (T1)data[0], (T2)data[1]); + return GetDisplayName(methodInfo, (T1)data![0]!, (T2)data![1]!); } } @@ -95,9 +95,9 @@ IEnumerable ITestDataSource.GetData(MethodInfo methodInfo) return _data; } - string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object[] data) + string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object?[]? data) { - return GetDisplayName(methodInfo, (T1)data[0], (T2)data[1], (T3)data[2]); + return GetDisplayName(methodInfo, (T1)data![0]!, (T2)data[1]!, (T3)data[2]!); } } @@ -128,8 +128,8 @@ IEnumerable ITestDataSource.GetData(MethodInfo methodInfo) return _data; } - string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object[] data) + string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object?[]? data) { - return GetDisplayName(methodInfo, (T1)data[0], (T2)data[1], (T3)data[2], (T4)data[3]); + return GetDisplayName(methodInfo, (T1)data![0]!, (T2)data[1]!, (T3)data[2]!, (T4)data[3]!); } } From 6a15438eb934146f688bac10b0d480f2a0ab14b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Tue, 28 Nov 2023 12:53:41 +0100 Subject: [PATCH 6/8] Builds --- .../Extension/NetFrameworkRunnerAttribute.cs | 4 ++-- .../Extension/NetFullTargetFrameworkDataSourceAttribute.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetFrameworkRunnerAttribute.cs b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetFrameworkRunnerAttribute.cs index 4d8b56c92e..3ade381b25 100644 --- a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetFrameworkRunnerAttribute.cs +++ b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetFrameworkRunnerAttribute.cs @@ -68,8 +68,8 @@ public IEnumerable GetData(MethodInfo methodInfo) return dataRows; } - public string GetDisplayName(MethodInfo methodInfo, object[] data) + public string GetDisplayName(MethodInfo methodInfo, object?[]? data) { - return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", methodInfo.Name, string.Join(",", data)); + return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", methodInfo.Name, string.Join(",", data ?? Array.Empty())); } } diff --git a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetFullTargetFrameworkDataSourceAttribute.cs b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetFullTargetFrameworkDataSourceAttribute.cs index 0179019a1f..c38cdde9cf 100644 --- a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetFullTargetFrameworkDataSourceAttribute.cs +++ b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Extension/NetFullTargetFrameworkDataSourceAttribute.cs @@ -110,8 +110,8 @@ public IEnumerable GetData(MethodInfo methodInfo) return dataRows; } - public string GetDisplayName(MethodInfo methodInfo, object[] data) + public string GetDisplayName(MethodInfo methodInfo, object?[]? data) { - return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", methodInfo.Name, string.Join(",", data)); + return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", methodInfo.Name, string.Join(",", data ?? Array.Empty())); } } From fc158f112a3cdd31f29891da56f51084071c2c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Tue, 28 Nov 2023 14:53:25 +0100 Subject: [PATCH 7/8] Fix file copy --- .../CodeCoverageDataAttachmentsHandlerTests.cs | 4 +--- .../Microsoft.TestPlatform.Utilities.UnitTests.csproj | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/Microsoft.TestPlatform.Utilities.UnitTests/CodeCoverageDataAttachmentsHandlerTests.cs b/test/Microsoft.TestPlatform.Utilities.UnitTests/CodeCoverageDataAttachmentsHandlerTests.cs index 471355c0f4..0761e61d69 100644 --- a/test/Microsoft.TestPlatform.Utilities.UnitTests/CodeCoverageDataAttachmentsHandlerTests.cs +++ b/test/Microsoft.TestPlatform.Utilities.UnitTests/CodeCoverageDataAttachmentsHandlerTests.cs @@ -50,19 +50,17 @@ public CodeCoverageDataAttachmentsHandlerTests() #endif } -#if NETFRAMEWORK [ClassInitialize] public static void ClassInitialize(TestContext context) { // Copying test files to correct place, var assemblyPath = AppDomain.CurrentDomain.BaseDirectory; - var testFilesDirectory = Path.Combine(context.DeploymentDirectory, "TestFiles"); + var testFilesDirectory = Path.Combine(context.DeploymentDirectory!, "TestFiles"); Directory.CreateDirectory(testFilesDirectory); var files = Directory.GetFiles(Path.Combine(assemblyPath, "TestFiles")); foreach (var file in files) File.Copy(file, Path.Combine(testFilesDirectory, Path.GetFileName(file))); } -#endif [TestMethod] public async Task HandleDataCollectionAttachmentSetsShouldReturnEmptySetWhenNoAttachmentsOrAttachmentsAreNull() diff --git a/test/Microsoft.TestPlatform.Utilities.UnitTests/Microsoft.TestPlatform.Utilities.UnitTests.csproj b/test/Microsoft.TestPlatform.Utilities.UnitTests/Microsoft.TestPlatform.Utilities.UnitTests.csproj index 01a6a79ab8..2ef1dbe427 100644 --- a/test/Microsoft.TestPlatform.Utilities.UnitTests/Microsoft.TestPlatform.Utilities.UnitTests.csproj +++ b/test/Microsoft.TestPlatform.Utilities.UnitTests/Microsoft.TestPlatform.Utilities.UnitTests.csproj @@ -15,7 +15,7 @@ - + From 7dc5e07abf9443a7dc09619d7c6d8fac9646e1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Wed, 29 Nov 2023 08:24:34 +0100 Subject: [PATCH 8/8] Fix version --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 626e904d9d..f105226537 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -83,7 +83,7 @@ [17.9.0-preview-23531-01] [17.8.0] - [17.7.0 + [17.7.0] [17.5.0] [16.11.0] [15.9.2]