Skip to content

Commit

Permalink
More updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed Jul 18, 2022
1 parent 539bc84 commit 17ef338
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,17 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo(
EqtTrace.Verbose("DotnetTestHostmanager: User specified custom path to dotnet host: '{0}'.", _dotnetHostPath);
}

// Try find testhost.exe (or the architecture specific version). We ship those ngened executables for Windows because they have faster startup time. We ship them only for some platforms.
// When user specified path to dotnet.exe don't try to find the exexutable, because we will always use the testhost.dll together with their dotnet.exe.
// Try find testhost.exe (or the architecture specific version). We ship those ngened executables for Windows
// because they have faster startup time. We ship them only for some platforms.
// When user specified path to dotnet.exe don't try to find the exexutable, because we will always use the
// testhost.dll together with their dotnet.exe.
bool testHostExeFound = false;
if (!useCustomDotnetHostpath
&& _platformEnvironment.OperatingSystem.Equals(PlatformOperatingSystem.Windows)

// testhost*.exe are build for netcoreapp2.1 and are not able to search for the correct runtime in case of x64/x86 on arm because the new logic(registry lookup)
// was added in since netcoreapp3.0. On arm we cannot rely on apphost and we'll use dotnet.exe muxer
// REVIEW ME: @Marco Do we need to update the logic?
// testhost*.exe are build for netcoreapp2.1 and are not able to search for the correct runtime in case of
// x64/x86 on arm because the new logic (registry lookup) was added in since netcoreapp3.0.
// On arm we cannot rely on apphost and we'll use dotnet.exe muxer.
&& !IsWinOnArm())
{
// testhost.exe is 64-bit and has no suffix other versions have architecture suffix.
Expand Down
1 change: 1 addition & 0 deletions src/testhost.x86/TestHostTraceListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static void Setup()

EqtTrace.Verbose("TestPlatformTraceListener.Setup: Added test platform trace listener.");

// REVIEW ME: Shall we remove this fix?
// this is a netcoreapp2.1 only fix, but because we always compile against netcoreapp2.1
// and upgrade the executable as necessary this needs to be a runtime check and not a compile time
// check. This call returns ".NET Core 4.6.xxx" on netcore 2.1 and older, and ".NET Core 3.1.xxx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public BlameDataCollectorTests()
}

[TestMethod]
// REVIEW ME: Shall we make the test supporting Linux?
// netcoreapp2.1 dump is not supported on Linux
[TestCategory("Windows-Review")]
[NetFullTargetFrameworkDataSource]
Expand All @@ -57,6 +58,7 @@ public void BlameDataCollectorShouldGiveCorrectTestCaseName(RunnerInfo runnerInf
}

[TestMethod]
// REVIEW ME: Shall we make the test supporting Linux?
// netcoreapp2.1 dump is not supported on Linux
[TestCategory("Windows-Review")]
[NetFullTargetFrameworkDataSource]
Expand All @@ -82,6 +84,7 @@ public void BlameDataCollectorShouldOutputDumpFile(RunnerInfo runnerInfo)
}

[TestMethod]
// REVIEW ME: Shall we make the test supporting Linux?
// netcoreapp2.1 dump is not supported on Linux
[TestCategory("Windows-Review")]
[NetFullTargetFrameworkDataSource]
Expand All @@ -107,6 +110,7 @@ public void BlameDataCollectorShouldNotOutputDumpFileWhenNoCrashOccurs(RunnerInf
}

[TestMethod]
// REVIEW ME: Shall we make the test supporting Linux?
// netcoreapp2.1 dump is not supported on Linux
[TestCategory("Windows-Review")]
[NetFullTargetFrameworkDataSource]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void DataCollectorAssemblyLoadingShouldNotThrowErrorForNetCore(RunnerInfo
{
SetTestEnvironment(_testEnvironment, runnerInfo);

var arguments = PrepareArguments(GetTestDllForFramework("AppDomainGetAssembliesTestProject.dll", "netcoreapp2.1"), string.Empty, string.Empty, FrameworkArgValue, resultsDirectory: TempDirectory.Path);
var arguments = PrepareArguments(GetTestDllForFramework("AppDomainGetAssembliesTestProject.dll", DEFAULT_RUNNER_NETCORE), string.Empty, string.Empty, FrameworkArgValue, resultsDirectory: TempDirectory.Path);

InvokeVsTest(arguments);
ValidateSummaryStatus(1, 0, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class DotnetArchitectureSwitchTestsWindowsOnly : AcceptanceTestBase
[DataRow("X86", "X64")]
public void Use_EnvironmentVariables(string architectureFrom, string architectureTo)
{
SetTestEnvironment(_testEnvironment, new RunnerInfo { RunnerFramework = "netcoreapp2.1" });
SetTestEnvironment(_testEnvironment, new RunnerInfo { RunnerFramework = DEFAULT_RUNNER_NETCORE });
string dotnetPath = GetDownloadedDotnetMuxerFromTools(architectureFrom);
string dotnetPathTo = GetDownloadedDotnetMuxerFromTools(architectureTo);
var vstestConsolePath = GetDotnetRunnerPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Microsoft.TestPlatform.AcceptanceTests;
// >= x64 6.0.2xx
// x64 5.0.4xx for Mac
// x64 3.1.4XX for Win
// Manual test './tools/.../dotnet test ./test/Microsoft.TestPlatform.AcceptanceTests/bin/Debug/netcoreapp2.1/Microsoft.TestPlatform.AcceptanceTests.dll --testcasefilter:"DotnetArchitectureSwitchTests"'
// Manual test './tools/.../dotnet test ./test/Microsoft.TestPlatform.AcceptanceTests/bin/Debug/netcoreapp3.1/Microsoft.TestPlatform.AcceptanceTests.dll --testcasefilter:"DotnetArchitectureSwitchTests"'
[TestClass]
[Ignore("Manual tests(for now). Tests in this class need some .NET SDK global installations")]
public class DotnetArchitectureSwitchTests : AcceptanceTestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
namespace Microsoft.TestPlatform.AcceptanceTests;

/// <summary>
/// Runs tests using the dotnet vstest.console.dll built against .NET Core 2.1.
/// Runs tests using the dotnet vstest.console.dll built against .NET Core 3.1.
/// Provide a list of target frameworks to run the tests from given as a ';' separated list, or using a constant containing that range such as
/// AcceptanceTestBase.NETFX462_NET50 = "net462;net472;net48;netcoreapp2.1;netcoreapp3.1;net5.0" to determine which target framework of the project
/// AcceptanceTestBase.NETFX462_NET50 = "net462;net472;net48;netcoreapp3.1;net5.0" to determine which target framework of the project
/// to test. The target project must list those TFMs in the TargetFrameworks property in csproj.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public NetCoreTargetFrameworkDataSourceAttribute(
bool useDesktopRunner = true,
// adding another runner is not necessary until we need to start building against another
// sdk, because the netcoreapp2.1 executable is forward compatible
// REVIEW ME: Does this comment needs to be updated?
bool useCoreRunner = true,
bool useNetCore31Target = true)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.TestPlatform.AcceptanceTests;
/// <summary>
/// Runs tests using the dotnet vstest.console.dll built against .NET Core 2.1.
/// Provide a list of target frameworks to run the tests from given as a ';' separated list, or using a constant containing that range such as
/// AcceptanceTestBase.NETFX462_NET50 = "net462;net472;net48;netcoreapp2.1;netcoreapp3.1;net5.0" to determine which target framework of the project
/// AcceptanceTestBase.NETFX462_NET50 = "net462;net472;net48;netcoreapp3.1;net5.0" to determine which target framework of the project
/// to test. The target project must list those TFMs in the TargetFrameworks property in csproj.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.TestPlatform.AcceptanceTests;
/// used only to test the most common scenarios, or special configurations that are candidates for their own
/// specialized source.
///
/// By default net462 and netcoreapp2.1 are used for both runner and host. (4 combinations)
/// By default net462 and netcoreapp3.1 are used for both runner and host. (4 combinations)
/// Then run with every version of runner is added.
/// Then run with every version of test.sdk is added.
/// Then run with every combination of testhost and adapter is added.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void RunTestsWithCustomTestHostLauncherLaunchesTheProcessUsingTheProvided
[TestMethod]
[TestCategory("Windows-Review")]
// [RunnerCompatibilityDataSource(BeforeFeature = Features.ATTACH_DEBUGGER_FLOW)]
[TestHostCompatibilityDataSource("net462", "netcoreapp2.1", "LegacyStable", BeforeFeature = Features.ATTACH_DEBUGGER_FLOW, DebugVSTestConsole = true)]
[TestHostCompatibilityDataSource(DEFAULT_RUNNER_NETFX, DEFAULT_RUNNER_NETCORE, "LegacyStable", BeforeFeature = Features.ATTACH_DEBUGGER_FLOW, DebugVSTestConsole = true)]
[Ignore("This is not working for any testhost prior 16.7.0 where the change was introduced. The launch testhost flow was replaced with AttachDebugger in runner, and the new callback to AttachDebugger happens in testhost."
+ "But any testhost prior 16.7.0 where the change was introduced does not know to call back AttachDebugger, and the call never happens.")]
// You can confirm that the functionality broke between runner and testhost, past this point by using newer runners, against older testhosts.
Expand Down Expand Up @@ -149,7 +149,7 @@ public void RunAllTestsWithMixedTFMsWillProvideAdditionalInformationToTheDebugge
var vstestConsoleWrapper = GetVsTestConsoleWrapper();
var runEventHandler = new RunEventHandler();
var netFrameworkDll = GetTestDllForFramework("MSTestProject1.dll", DEFAULT_RUNNER_NETFX);
var netDll = GetTestDllForFramework("MSTestProject1.dll", "netcoreapp2.1");
var netDll = GetTestDllForFramework("MSTestProject1.dll", DEFAULT_RUNNER_NETCORE);
var testHostLauncher = new TestHostLauncherV3();

// Act
Expand Down Expand Up @@ -180,7 +180,7 @@ public void RunAllTestsCallsBackToTestHostLauncherV3EvenWhenRunnerDoesNotSupport
var vstestConsoleWrapper = GetVsTestConsoleWrapper();
var runEventHandler = new RunEventHandler();
var netFrameworkDll = GetTestDllForFramework("MSTestProject1.dll", DEFAULT_RUNNER_NETFX);
var netDll = GetTestDllForFramework("MSTestProject1.dll", "netcoreapp2.1");
var netDll = GetTestDllForFramework("MSTestProject1.dll", DEFAULT_RUNNER_NETCORE);
var testHostLauncher = new TestHostLauncherV3();

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DiaSessionTests : IntegrationTestBase
#if NETFRAMEWORK
"net462";
#else
"netcoreapp2.1";
"netcoreapp3.1";
#endif
return currentTargetFrameWork;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ public class DataCollectorTestsCoverlets : IntegrationTestBase
[TestMethod]
public void RunCoverletCoverage()
{
// REVIEW ME: @Marco do we need to update this test?
// Collector is supported only for netcoreapp2.1, is compiled for netcoreapp2.1 and packaged as netstandard
if (_testEnvironment.TargetFramework != CoreRunnerFramework)
{
return;
}

// We use netcoreapp runner
// "...\vstest\tools\dotnet\dotnet.exe "...\vstest\artifacts\Debug\netcoreapp2.1\vstest.console.dll" --collect:"XPlat Code Coverage" ...
// "...\vstest\tools\dotnet\dotnet.exe "...\vstest\artifacts\Debug\netcoreapp3.1\vstest.console.dll" --collect:"XPlat Code Coverage" ...
_testEnvironment.RunnerFramework = CoreRunnerFramework;
var resultsDir = new TempDirectory();

Expand Down

0 comments on commit 17ef338

Please sign in to comment.