Skip to content

Update framework version used for testing, and test matrix #4534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,35 @@
<MicrosoftCodeCoverageVersion>17.4.1</MicrosoftCodeCoverageVersion>
<!-- These versions are used for running unit tests, and running acceptance tests. They are also used as the default version for projects
in TestAssets.sln to allow running and debugging tests in that solution directly in VS without having to run them via AcceptanceTests. -->
<MSTestTestFrameworkVersion>2.3.0-preview-20220711-02</MSTestTestFrameworkVersion>
<MSTestTestAdapterVersion>2.3.0-preview-20220711-02</MSTestTestAdapterVersion>
<MSTestTestFrameworkVersion>3.0.4</MSTestTestFrameworkVersion>
<MSTestTestAdapterVersion>3.0.4</MSTestTestAdapterVersion>
<MSTestAssertExtensionVersion>1.0.3-preview</MSTestAssertExtensionVersion>
<XUnitFrameworkVersion>2.3.1</XUnitFrameworkVersion>
<XUnitAdapterVersion>2.3.1</XUnitAdapterVersion>
<XUnitConsoleRunnerVersion>2.3.1</XUnitConsoleRunnerVersion>
<NUnit3FrameworkVersion>3.10.1</NUnit3FrameworkVersion>
<NUnit3AdapterVersion>3.11.0</NUnit3AdapterVersion>
<NUnitConsoleRunnerVersion>3.8.0</NUnitConsoleRunnerVersion>
<XUnitFrameworkVersion>2.4.2</XUnitFrameworkVersion>
<XUnitAdapterVersion>2.4.5</XUnitAdapterVersion>
<XUnitConsoleRunnerVersion>2.4.2</XUnitConsoleRunnerVersion>
<NUnit3FrameworkVersion>3.13.3</NUnit3FrameworkVersion>
<NUnit3AdapterVersion>4.5.0</NUnit3AdapterVersion>
<NUnitConsoleRunnerVersion>3.16.3</NUnitConsoleRunnerVersion>
<!--
Versions that are used when building projects from TestAssets.sln for compatibility tests. 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.
-->
<!-- <MSTestFrameworkLatestVersion></MSTestFrameworkLatestVersion> is not here, because we don't build MSTest locally, so we don't have access to the latest version. -->
<MSTestFrameworkLatestPreviewVersion>[2.3.0-preview-20220613-02]</MSTestFrameworkLatestPreviewVersion>
<MSTestFrameworkLatestStableVersion>[2.2.10]</MSTestFrameworkLatestStableVersion>
<MSTestFrameworkRecentStableVersion>[2.2.9]</MSTestFrameworkRecentStableVersion>
<MSTestFrameworkMostDownloadedVersion>[2.1.0]</MSTestFrameworkMostDownloadedVersion>
<MSTestFrameworkPreviousStableVersion>[2.1.0]</MSTestFrameworkPreviousStableVersion>
<MSTestFrameworkLatestPreviewVersion>[3.2.0-preview.23577.2]</MSTestFrameworkLatestPreviewVersion>
<MSTestFrameworkLatestStableVersion>[3.1.1]</MSTestFrameworkLatestStableVersion>
<MSTestFrameworkRecentStableVersion>[3.0.2]</MSTestFrameworkRecentStableVersion>
<MSTestFrameworkMostDownloadedVersion>[2.2.10]</MSTestFrameworkMostDownloadedVersion>
<MSTestFrameworkPreviousStableVersion>[2.1.2]</MSTestFrameworkPreviousStableVersion>
<MSTestFrameworkLegacyStableVersion>[1.4.0]</MSTestFrameworkLegacyStableVersion>
<!-- Versions that are used to restore previous versions of console, translation layer, and test.sdk for compatibility tests.
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. -->
<!-- <VSTestConsoleLatestVersion></VSTestConsoleLatestVersion> is not here, NETTestSdkVersion is used instead, because that is the version of the locally built latest package. -->
<VSTestConsoleLatestPreviewVersion>[17.2.0-preview-20220401-08]</VSTestConsoleLatestPreviewVersion>
<VSTestConsoleLatestStableVersion>[17.2.0]</VSTestConsoleLatestStableVersion>
<VSTestConsoleRecentStableVersion>[17.1.0]</VSTestConsoleRecentStableVersion>
<VSTestConsoleMostDownloadedVersion>[16.6.1]</VSTestConsoleMostDownloadedVersion>
<VSTestConsoleLatestPreviewVersion>[17.9.0-preview-23531-01]</VSTestConsoleLatestPreviewVersion>
<VSTestConsoleLatestStableVersion>[17.8.0]</VSTestConsoleLatestStableVersion>
<VSTestConsoleRecentStableVersion>[17.7.0]</VSTestConsoleRecentStableVersion>
<VSTestConsoleMostDownloadedVersion>[17.5.0]</VSTestConsoleMostDownloadedVersion>
<VSTestConsolePreviousStableVersion>[16.11.0]</VSTestConsolePreviousStableVersion>
<VSTestConsoleLegacyStableVersion>[15.9.2]</VSTestConsoleLegacyStableVersion>
<ILAsmPackageVersion>5.0.0</ILAsmPackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public IEnumerable<object[]> 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<string>()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public IEnumerable<object[]> 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<string>()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public IEnumerable<object[]> 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<string>()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public IEnumerable<object[]> 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<string>()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ IEnumerable<object[]> 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]!);
}
}

Expand Down Expand Up @@ -63,9 +63,9 @@ IEnumerable<object[]> 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]!);
}
}

Expand Down Expand Up @@ -95,9 +95,9 @@ IEnumerable<object[]> 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]!);
}
}

Expand Down Expand Up @@ -128,8 +128,8 @@ IEnumerable<object[]> 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]!);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,18 @@ public async Task DataCollectorAttachmentProcessorAppDomain_ShouldReturnCorrectA
Assert.IsTrue(dcap.LoadSucceded);

var attachmentsResult = await dcap.ProcessAttachmentSetsAsync(doc.DocumentElement, attachments, new Progress<int>(), _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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ProjectReference Include="..\..\src\Microsoft.TestPlatform.Utilities\Microsoft.TestPlatform.Utilities.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeCoverage.IO" Version="17.3.1-beta.22253.3" />
<PackageReference Include="Microsoft.CodeCoverage.IO" Version="$(MicrosoftCodeCoverageIOVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System.Runtime" />
Expand Down