diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AbortionTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AbortionTests.cs index e64265b804..0b8aafbaaf 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AbortionTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AbortionTests.cs @@ -36,7 +36,7 @@ public async Task AbortWithCTRLPlusC_CancellingTests(string tfm) testHostResult.AssertOutputMatchesRegex("Canceling the test session.*"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string Sources = """ #file AbortMSTestAsset.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AnalyzersTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AnalyzersTests.cs index b5aa911e94..f2654fbae1 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AnalyzersTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AnalyzersTests.cs @@ -56,7 +56,6 @@ public void TestMethod() using TestAsset testAsset = await TestAsset.GenerateAssetAsync("TestForMSTEST0001", code); DotnetMuxerResult result = await DotnetCli.RunAsync( $"build {testAsset.TargetAssetPath}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, warnAsError: false, cancellationToken: TestContext.CancellationToken); if (isAdapterReferenced) @@ -113,7 +112,6 @@ public void TestMethod() using TestAsset testAsset = await TestAsset.GenerateAssetAsync("AnalyzersMetapackage", code); DotnetMuxerResult result = await DotnetCli.RunAsync( $"build {testAsset.TargetAssetPath}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, warnAsError: false, cancellationToken: TestContext.CancellationToken); result.AssertOutputContains("MSTEST0014"); @@ -153,7 +151,6 @@ public void TestMethod() using TestAsset testAsset = await TestAsset.GenerateAssetAsync("AnalyzersTestFrameworkPackage", code); DotnetMuxerResult result = await DotnetCli.RunAsync( $"build {testAsset.TargetAssetPath}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, warnAsError: false, cancellationToken: TestContext.CancellationToken); result.AssertOutputContains("MSTEST0014"); @@ -196,7 +193,6 @@ public void TestMethod() using TestAsset testAsset = await TestAsset.GenerateAssetAsync("Analyzers", code); DotnetMuxerResult result = await DotnetCli.RunAsync( $"build {testAsset.TargetAssetPath}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, environmentVariables: new() { ["DOTNET_CLI_UI_LANGUAGE"] = "it-IT", @@ -295,7 +291,7 @@ public async void TestMethod1() private static async Task AssertAnalysisModeAsync(string mode, string[] contains, string[] doesNotContain, string targetAssetPath) { - async Task BuildTaskAsync() => await DotnetCli.RunAsync($"build {targetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, warnAsError: false, retryCount: 0); + async Task BuildTaskAsync() => await DotnetCli.RunAsync($"build {targetAssetPath}", warnAsError: false, retryCount: 0); string output; if (mode is "Recommended" or "All") diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AppDomainTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AppDomainTests.cs index 82fd4d1e0c..5f16cedd10 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AppDomainTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AppDomainTests.cs @@ -26,7 +26,7 @@ public async Task RunTests_With_VSTest(bool? disableAppDomain) null => string.Empty, }; - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test -c Release --no-build {AssetFixture.TargetAssetPath}{disableAppDomainCommand}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: AssetFixture.TargetAssetPath, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test -c Release --no-build {AssetFixture.TargetAssetPath}{disableAppDomainCommand}", workingDirectory: AssetFixture.TargetAssetPath, cancellationToken: TestContext.CancellationToken); Assert.AreEqual(0, compilationResult.ExitCode); compilationResult.AssertOutputContains(@"Passed! - Failed: 0, Passed: 2, Skipped: 0, Total: 2"); @@ -45,7 +45,7 @@ public async Task DiscoverTests_With_VSTest(bool? disableAppDomain) null => string.Empty, }; - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test -c Release --no-build {AssetFixture.TargetAssetPath} --list-tests{disableAppDomainCommand}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: AssetFixture.TargetAssetPath, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test -c Release --no-build {AssetFixture.TargetAssetPath} --list-tests{disableAppDomainCommand}", workingDirectory: AssetFixture.TargetAssetPath, cancellationToken: TestContext.CancellationToken); Assert.AreEqual(0, compilationResult.ExitCode); } @@ -107,7 +107,7 @@ private static string GetTestDllPath(string assetPath, string targetFramework) = public TestContext TestContext { get; set; } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string SingleTestSourceCode = """ #file AppDomainTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AspireSdkTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AspireSdkTests.cs index 106dbc0684..290f4ae998 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AspireSdkTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AspireSdkTests.cs @@ -28,7 +28,6 @@ public async Task EnableAspireProperty_WhenUsingVSTest_AllowsToRunAspireTests() : testHost.FullName + ".dll"; DotnetMuxerResult dotnetTestResult = await DotnetCli.RunAsync( $"test {exeOrDllName}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: AssetFixture.AspireProjectPath, warnAsError: false, suppressPreviewDotNetMessage: false, @@ -39,7 +38,7 @@ public async Task EnableAspireProperty_WhenUsingVSTest_AllowsToRunAspireTests() dotnetTestResult.AssertOutputContains("Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string AspireProjectName = "AspireProject"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyCleanupTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyCleanupTests.cs index 262b31da65..3de2a389e6 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyCleanupTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyCleanupTests.cs @@ -26,7 +26,7 @@ In AsmCleanup """); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "AssemblyCleanupTests"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolutionTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolutionTests.cs index f85b11273b..93b20ee1fc 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolutionTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolutionTests.cs @@ -68,7 +68,7 @@ public void Dispose() public async Task InitializeAsync(CancellationToken cancellationToken) { VSSolution solution = CreateTestAsset(); - DotnetMuxerResult result = await DotnetCli.RunAsync($"build {solution.SolutionFile} -c Release", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: cancellationToken); + DotnetMuxerResult result = await DotnetCli.RunAsync($"build {solution.SolutionFile} -c Release", cancellationToken: cancellationToken); result.AssertExitCodeIs(0); TestHost = TestHost.LocateFrom(solution.Projects.Skip(1).Single().FolderPath, TestProjectName, TargetFramework); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolverTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolverTests.cs index 1a88ea9279..52d1973dcd 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolverTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolverTests.cs @@ -24,7 +24,7 @@ public async Task RunningTests_DoesNotHitResourceRecursionIssueAndDoesNotCrashTh testHostResult.AssertExitCodeIs(ExitCodes.Success); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CancellationTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CancellationTests.cs index a67a1f382e..11c9495330 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CancellationTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CancellationTests.cs @@ -128,7 +128,7 @@ public async Task WhenCancelingTestContextTokenInTestMethod_MessageIsAsExpected( testHostResult.AssertOutputContains("Failed!"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "TestCancellation"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestSettingsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestSettingsTests.cs index 34a4943016..093b0c95bd 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestSettingsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestSettingsTests.cs @@ -24,7 +24,7 @@ public async Task TestConfigJson_AndRunSettingsHasMstest_Throws(string tfm) testHostResult.AssertStandardErrorContains("Both '.runsettings' and '.testconfig.json' files have been detected. Please select only one of these test configuration files."); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectNameWithMSTestRunSettings = "ConfigurationMSTestSettings"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestV2SettingsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestV2SettingsTests.cs index 1e5539de3a..818b569849 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestV2SettingsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestV2SettingsTests.cs @@ -24,7 +24,7 @@ public async Task TestConfigJson_AndRunSettingsHasMstestv2_Throws(string tfm) testHostResult.AssertStandardErrorContains("Both '.runsettings' and '.testconfig.json' files have been detected. Please select only one of these test configuration files."); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectNameWithMSTestV2RunSettings = "ConfigurationMSTestV2Settings"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationSettingsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationSettingsTests.cs index 23a4030f9b..590fc9bc3a 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationSettingsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationSettingsTests.cs @@ -80,7 +80,7 @@ public async Task TestWithConfigFromCommandLineWithNonExistingFile() testHostResult.AssertStandardErrorContains("dummyconfigfile_not_existing_file.json"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "ConfigurationSettings"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CustomAttributesTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CustomAttributesTests.cs index c1e9f894bb..043172a089 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CustomAttributesTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CustomAttributesTests.cs @@ -23,7 +23,7 @@ public async Task DuplicateTestMethodAttribute_ShouldFail(string tfm) testHostResult.AssertOutputContainsSummary(failed: 1, passed: 1, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string DuplicateTestMethodProjectName = "DuplicateTestMethodAttribute"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DataSourceTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DataSourceTests.cs index 66be0c8fd7..b986c076b1 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DataSourceTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DataSourceTests.cs @@ -96,7 +96,6 @@ public async Task TestDataSourceFromAppConfig() await DotnetCli.RunAsync( $"build {generator.TargetAssetPath} -c Release", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, retryCount: 0, cancellationToken: TestContext.CancellationToken); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeadlockTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeadlockTests.cs index 4d52c0f377..a8590c4c72 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeadlockTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeadlockTests.cs @@ -42,7 +42,7 @@ public async Task DeadlockCaseAssemblyCleanupWaitingOnTestMethod(string tfm) testHostResult.AssertOutputContainsSummary(failed: 0, passed: 1, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "DeadlockTests"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeploymentItemTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeploymentItemTests.cs index 53ecc51aaa..811036e96e 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeploymentItemTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeploymentItemTests.cs @@ -24,7 +24,7 @@ public async Task AssemblyIsLoadedOnceFromDeploymentDirectory(string runsettings testHostResult.AssertExitCodeIs(ExitCodes.Success); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string Sources = """ #file DeploymentItemTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DotnetTestCliTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DotnetTestCliTests.cs index 1231e3d6c7..233e51ac21 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DotnetTestCliTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DotnetTestCliTests.cs @@ -25,7 +25,7 @@ public async Task DotnetTest_Should_Execute_Tests(string tfm, BuildConfiguration .PatchCodeWithReplace("$OutputType$", string.Empty) .PatchCodeWithReplace("$Extra$", string.Empty)); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test {generator.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: generator.TargetAssetPath, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test {generator.TargetAssetPath}", workingDirectory: generator.TargetAssetPath, cancellationToken: TestContext.CancellationToken); // There is whitespace difference in output in parent and public repo that depends on the version of the dotnet SDK used. compilationResult.AssertOutputMatchesRegex(@"Passed!\s+-\s+Failed:\s+0,\s+Passed:\s+1,\s+Skipped:\s+0,\s+Total:\s+1"); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DuplicateTestClassAttributeTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DuplicateTestClassAttributeTests.cs index 3015a87b4a..61fe02fc7d 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DuplicateTestClassAttributeTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DuplicateTestClassAttributeTests.cs @@ -23,7 +23,7 @@ public async Task DuplicateTestClassAttribute_ShouldFail(string tfm) testHostResult.AssertStandardErrorContains("Only one attribute of type 'Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute' is allowed, but multiple were found."); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string DuplicateTestClassProjectName = "DuplicateTestClassAttribute"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DynamicDataMethodTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DynamicDataMethodTests.cs index 6803faee75..988ab77806 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DynamicDataMethodTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DynamicDataMethodTests.cs @@ -51,7 +51,7 @@ public async Task DynamicDataTestWithParameterizedDataProviderMethod(string tfm) testHostResult.AssertOutputContains("TestMethodSingleParameterIntArray called with: 9"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "DynamicDataMethodTests"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/FrameworkOnlyTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/FrameworkOnlyTests.cs index 44caf5c15e..efbfe3a196 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/FrameworkOnlyTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/FrameworkOnlyTests.cs @@ -28,7 +28,7 @@ public async Task DynamicDataAttributeGetDataShouldWorkWithoutAdapter() testHostResult.AssertExitCodeIs(ExitCodes.Success); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string Sources = """ #file FrameworkOnlyTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/GenericTestMethodTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/GenericTestMethodTests.cs index fb5ae392c8..b51b183db3 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/GenericTestMethodTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/GenericTestMethodTests.cs @@ -78,7 +78,7 @@ Cannot create an instance of T\[] because Type\.ContainsGenericParameters is tru """, RegexOptions.Singleline); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public override (string ID, string Name, string Code) GetAssetsToGenerate() => ("GenericTestMethodTests", "GenericTestMethodTests", SourceGenericTestMethod diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs index ed1b9f778c..6ed3e4f23d 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs @@ -124,7 +124,7 @@ public async Task Info_WhenMSTestExtensionRegistered_OutputInfoContentOfRegister testHostResult.AssertOutputContains(output); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/IgnoreTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/IgnoreTests.cs index bef076410f..6c75ea6d43 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/IgnoreTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/IgnoreTests.cs @@ -106,7 +106,7 @@ public async Task WhenSpecificDataSourceIsIgnoredViaIgnoreMessageProperty() testHostResult.AssertOutputContainsSummary(failed: 0, passed: 10, skipped: 6); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "TestIgnore"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InconclusiveTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InconclusiveTests.cs index 724e547f35..d1230ef4d7 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InconclusiveTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InconclusiveTests.cs @@ -112,7 +112,7 @@ public async Task TestOutcomeShouldBeRespectedCorrectly(Lifecycle inconclusiveSt testHostResult.AssertOutputContains("AssemblyCleanup called"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "TestInconclusive"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LeakTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LeakTests.cs index 0357c5d550..da0a9c8176 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LeakTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LeakTests.cs @@ -20,7 +20,7 @@ public async Task TestContextInstancesShouldNotLeak(string tfm) testHostResult.AssertOutputContainsSummary(failed: 0, passed: 100, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "LeakTests"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesTaskThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesTaskThreadingTests.cs index 69a198a052..a6c2f1d46b 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesTaskThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesTaskThreadingTests.cs @@ -26,7 +26,7 @@ public async Task LifecycleAttributesTaskThreading_WhenMainIsNotSTA_RunsettingsA testHostResult.AssertOutputContains("Passed!"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "LifecycleAttributesTask"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesValueTaskThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesValueTaskThreadingTests.cs index d9c5cca4c4..1bd39701d5 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesValueTaskThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesValueTaskThreadingTests.cs @@ -26,7 +26,7 @@ public async Task LifecycleAttributesValueTaskThreading_WhenMainIsNotSTA_Runsett testHostResult.AssertOutputContains("Passed!"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "LifecycleAttributesValueTask"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesVoidThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesVoidThreadingTests.cs index b49f6e3c14..197c7efc5d 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesVoidThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesVoidThreadingTests.cs @@ -26,7 +26,7 @@ public async Task LifecycleAttributesVoidThreading_WhenMainIsNotSTA_RunsettingsA testHostResult.AssertOutputContains("Passed!"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "LifecycleAttributesVoid"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleTests.cs index 44e871701d..fbfe7d1b92 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleTests.cs @@ -76,7 +76,7 @@ AssemblyCleanup called. """); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "LifecycleTests"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleWithParallelAttributesTaskThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleWithParallelAttributesTaskThreadingTests.cs index 94744fd188..b5b944a654 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleWithParallelAttributesTaskThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleWithParallelAttributesTaskThreadingTests.cs @@ -26,7 +26,7 @@ public async Task LifecycleAttributesTaskThreading_WhenMainIsNotSTA_RunsettingsA testHostResult.AssertOutputContains("Passed!"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "LifecycleWithParallelAttributesTask"; public const string AssemblyName = "LifecycleAttributesTask"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MSBuildRunnerTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MSBuildRunnerTests.cs index 94996ff92d..560997fba7 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MSBuildRunnerTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MSBuildRunnerTests.cs @@ -43,10 +43,10 @@ public async Task MSBuildTestTarget_SingleAndMultiTfm_Should_Run_Solution_Tests( } // Build the solution - DotnetMuxerResult restoreResult = await DotnetCli.RunAsync($"restore {solution.SolutionFile} --configfile {nugetFile}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult restoreResult = await DotnetCli.RunAsync($"restore {solution.SolutionFile} --configfile {nugetFile}", cancellationToken: TestContext.CancellationToken); restoreResult.AssertOutputDoesNotContain("An approximate best match of"); - DotnetMuxerResult testResult = await DotnetCli.RunAsync($"build --no-restore /t:Test {solution.SolutionFile}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: generator.TargetAssetPath, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult testResult = await DotnetCli.RunAsync($"build --no-restore /t:Test {solution.SolutionFile}", workingDirectory: generator.TargetAssetPath, cancellationToken: TestContext.CancellationToken); if (isMultiTfm) { diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs index 2d4c2aabaa..aa0cef38b4 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs @@ -36,7 +36,7 @@ public async Task SimpleMaxFailedTestsScenario(string tfm) Assert.AreEqual(12, total); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string Sources = """ #file MaxFailedTestsExtensionTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/NativeAotTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/NativeAotTests.cs index c33fffe4df..3e6b26f896 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/NativeAotTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/NativeAotTests.cs @@ -103,7 +103,6 @@ public async Task NativeAotTests_WillRunWithExitCodeZero(string tfm) DotnetMuxerResult compilationResult = await DotnetCli.RunAsync( $"publish {generator.TargetAssetPath} -r {RID} -f {tfm}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, retryCount: 0, cancellationToken: TestContext.CancellationToken); compilationResult.AssertOutputContains("Generating native code"); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataRowTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataRowTests.cs index f135ebf6fa..aec64687dd 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataRowTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataRowTests.cs @@ -32,7 +32,7 @@ private static async Task UsingDataRowThatDoesNotRoundTripUsingDataContractJsonS testHostResult.AssertOutputContainsSummary(failed: 0, passed: 3, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public override (string ID, string Name, string Code) GetAssetsToGenerate() => (DataRowAssetName, DataRowAssetName, SourceCodeDataRow diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataSourceTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataSourceTests.cs index 483527765c..f5a552beb9 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataSourceTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataSourceTests.cs @@ -63,7 +63,7 @@ private static async Task RunTestsAsync(string currentTfm, string assetName, boo } } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public override (string ID, string Name, string Code) GetAssetsToGenerate() => (DataSourceAssetName, DataSourceAssetName, SourceCodeDataSource diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedTestTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedTestTests.cs index 60dd4f5c2c..e8de47e559 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedTestTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedTestTests.cs @@ -135,7 +135,7 @@ private static async Task RunTestsAsync(string currentTfm, string assetName, boo } } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public override (string ID, string Name, string Code) GetAssetsToGenerate() => (DynamicDataAssetName, DynamicDataAssetName, SourceCodeDynamicData diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PlaywrightSdkTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PlaywrightSdkTests.cs index dbd4da49de..7b4f3ab39e 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PlaywrightSdkTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PlaywrightSdkTests.cs @@ -46,7 +46,6 @@ public async Task EnablePlaywrightProperty_WhenUsingVSTest_AllowsToRunPlaywright : testHost.FullName + ".dll"; DotnetMuxerResult dotnetTestResult = await DotnetCli.RunAsync( $"test {exeOrDllName}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: AssetFixture.PlaywrightProjectPath, failIfReturnValueIsNotZero: false, warnAsError: false, @@ -74,7 +73,7 @@ public async Task EnablePlaywrightProperty_WhenUsingVSTest_AllowsToRunPlaywright } } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string PlaywrightProjectName = "PlaywrightProject"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PublishAotNonNativeTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PublishAotNonNativeTests.cs index 3145c27267..d5c9c3986e 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PublishAotNonNativeTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PublishAotNonNativeTests.cs @@ -24,7 +24,7 @@ public async Task RunTests_ThatEnablePublishAOT_ButDontBuildToNative() .PatchCodeWithReplace("$TargetFramework$", $"{TargetFrameworks.NetCurrent}") .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -t:Test -c Debug {generator.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: generator.TargetAssetPath, failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -t:Test -c Debug {generator.TargetAssetPath}", workingDirectory: generator.TargetAssetPath, failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); // In the real-world issue, access to path C:\Program Files\dotnet\ is denied, but we run this from a local .dotnet folder, where we have write access. // So instead of relying on the test run failing because of AccessDenied, we check the output, and see where TestResults were placed. diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RetryTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RetryTests.cs index 6b41287a86..4b34bb1b53 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RetryTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RetryTests.cs @@ -30,7 +30,7 @@ TestMethod5 executed 4 times. testHostResult.AssertOutputContainsSummary(failed: 1, passed: 4, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "RetryTests"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunnerTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunnerTests.cs index f7f0cdc4c0..dc5c25bb73 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunnerTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunnerTests.cs @@ -30,7 +30,7 @@ public async SystemTask EnableMSTestRunner_True_Will_Run_Standalone(string tfm, DotnetMuxerResult compilationResult = await DotnetCli.RunAsync( $"{verb} {generator.TargetAssetPath} -c {buildConfiguration} -r {RID}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + cancellationToken: TestContext.CancellationToken); Build binLog = Serialization.Read(compilationResult.BinlogPath); Assert.AreNotEqual(0, binLog.FindChildrenRecursive() @@ -69,7 +69,7 @@ public async SystemTask EnableMSTestRunner_True_WithCustomEntryPoint_Will_Run_St await DotnetCli.RunAsync( $"{verb} {generator.TargetAssetPath} -c {buildConfiguration} -r {RID}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + cancellationToken: TestContext.CancellationToken); var testHost = TestHost.LocateFrom(generator.TargetAssetPath, AssetName, tfm, buildConfiguration: buildConfiguration, verb: verb); TestHostResult testHostResult = await testHost.ExecuteAsync(cancellationToken: TestContext.CancellationToken); testHostResult.AssertOutputContainsSummary(failed: 0, passed: 1, skipped: 0); @@ -92,13 +92,13 @@ public async SystemTask EnableMSTestRunner_False_Will_Run_Empty_Program_EntryPoi if (TargetFrameworks.NetFramework.Any(x => x == tfm)) { // Running under .NET Framework, which doesn't generate an empty entry point. - Exception ex = await Assert.ThrowsAsync(async () => await DotnetCli.RunAsync($"{verb} {generator.TargetAssetPath} -c {buildConfiguration} -r {RID}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken)); + Exception ex = await Assert.ThrowsAsync(async () => await DotnetCli.RunAsync($"{verb} {generator.TargetAssetPath} -c {buildConfiguration} -r {RID}", cancellationToken: TestContext.CancellationToken)); Assert.Contains("Program does not contain a static 'Main' method suitable for an entry point", ex.Message); return; } // Running on .NET (Core), building should succeed and we should run empty entry point. - await DotnetCli.RunAsync($"{verb} {generator.TargetAssetPath} -c {buildConfiguration} -r {RID}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + await DotnetCli.RunAsync($"{verb} {generator.TargetAssetPath} -c {buildConfiguration} -r {RID}", cancellationToken: TestContext.CancellationToken); var testHost = TestHost.LocateFrom(generator.TargetAssetPath, AssetName, tfm, buildConfiguration: buildConfiguration, verb: verb); TestHostResult testHostResult = await testHost.ExecuteAsync(cancellationToken: TestContext.CancellationToken); Assert.AreEqual(string.Empty, testHostResult.StandardOutput); @@ -119,7 +119,7 @@ public async SystemTask EnableMSTestRunner_False_Wont_Flow_TestingPlatformServer .PatchCodeWithReplace("$OutputType$", string.Empty) .PatchCodeWithReplace("$Extra$", string.Empty)); - DotnetMuxerResult result = await DotnetCli.RunAsync($"{verb} {generator.TargetAssetPath} -c {buildConfiguration} -r {RID} ", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult result = await DotnetCli.RunAsync($"{verb} {generator.TargetAssetPath} -c {buildConfiguration} -r {RID} ", cancellationToken: TestContext.CancellationToken); Build binLog = Serialization.Read(result.BinlogPath); Assert.DoesNotContain(x => x.Title.Contains("ProjectCapability") && x.Children.Any(c => ((Item)c).Name == "TestingPlatformServer"), binLog.FindChildrenRecursive()); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs index 20fe8691c7..f24744189f 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs @@ -90,7 +90,7 @@ public async Task UnsupportedRunSettingsEntriesAreFlagged_Localization(string? t } } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "TestRunSettings"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassCooperativeTimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassCooperativeTimeoutTests.cs index b51d71f437..b583deb587 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassCooperativeTimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassCooperativeTimeoutTests.cs @@ -55,7 +55,7 @@ public async Task STATestClass_OnWindows_OnLifeCycleTestClassWithLastTestSkipped testHostResult.AssertOutputContains("LifeCycleTestClass.AssemblyCleanup"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs index ea1f3ac056..a620657794 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs @@ -55,7 +55,7 @@ public async Task STATestClass_OnWindows_OnLifeCycleTestClassWithLastTestSkipped testHostResult.AssertOutputContains("LifeCycleTestClass.AssemblyCleanup"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTimeoutTests.cs index 9b932db03d..a7277da53e 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTimeoutTests.cs @@ -55,7 +55,7 @@ public async Task STATestClass_OnWindows_OnLifeCycleTestClassWithLastTestSkipped testHostResult.AssertOutputContains("LifeCycleTestClass.AssemblyCleanup"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodCooperativeTimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodCooperativeTimeoutTests.cs index cdaeb379c9..f2d5d71fc8 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodCooperativeTimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodCooperativeTimeoutTests.cs @@ -58,7 +58,7 @@ public async Task STATestMethod_OnWindows_OnTestClassWithMultipleTests_WithCoope testHostResult.AssertOutputContains("LifeCycleTestClass.AssemblyCleanup"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs index ccfbc1b175..bcc4b9d82e 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs @@ -58,7 +58,7 @@ public async Task STATestMethod_OnWindows_OnTestClassWithMultipleTests_MethodsAr testHostResult.AssertOutputContains("LifeCycleTestClass.AssemblyCleanup"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTimeoutTests.cs index 96749a3226..77ff9420ed 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTimeoutTests.cs @@ -58,7 +58,7 @@ public async Task STATestMethod_OnWindows_OnTestClassWithMultipleTests_WithTimeo testHostResult.AssertOutputContains("LifeCycleTestClass.AssemblyCleanup"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STAThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STAThreadingTests.cs index df8527178c..1af404a082 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STAThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STAThreadingTests.cs @@ -62,7 +62,7 @@ public async Task TestMethodThreading_MainIsSTAThread_OnWindows_RunsettingsAsksF testHostResult.AssertOutputContains("Passed!"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "STATestThreading"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SdkTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SdkTests.cs index 0800518d05..be58d73909 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SdkTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SdkTests.cs @@ -72,7 +72,7 @@ public async Task RunTests_With_VSTest(string multiTfm, BuildConfiguration build .PatchCodeWithReplace("$TargetFramework$", multiTfm) .PatchCodeWithReplace("$ExtraProperties$", "true")); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test -c {buildConfiguration} {testAsset.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: testAsset.TargetAssetPath, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test -c {buildConfiguration} {testAsset.TargetAssetPath}", workingDirectory: testAsset.TargetAssetPath, cancellationToken: TestContext.CancellationToken); compilationResult.AssertExitCodeIs(0); compilationResult.AssertOutputMatchesRegex(@"Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: .* [m]?s - MSTestSdk.dll \(net10\.0\)"); @@ -97,7 +97,7 @@ public async Task RunTests_With_MSTestRunner_DotnetTest(string multiTfm, BuildCo .PatchCodeWithReplace("$TargetFramework$", multiTfm) .PatchCodeWithReplace("$ExtraProperties$", string.Empty)); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test -c {buildConfiguration} --project {testAsset.TargetAssetPath} --no-progress --no-ansi", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: testAsset.TargetAssetPath, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test -c {buildConfiguration} --project {testAsset.TargetAssetPath} --no-progress --no-ansi", workingDirectory: testAsset.TargetAssetPath, cancellationToken: TestContext.CancellationToken); compilationResult.AssertExitCodeIs(0); compilationResult.AssertOutputMatchesRegex(@"MSTestSdk.*? \(net10\.0\|x64\) passed"); @@ -122,7 +122,7 @@ public async Task RunTests_With_MSTestRunner_Standalone(string multiTfm, BuildCo .PatchCodeWithReplace("$TargetFramework$", multiTfm) .PatchCodeWithReplace("$ExtraProperties$", string.Empty)); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", cancellationToken: TestContext.CancellationToken); compilationResult.AssertExitCodeIs(0); foreach (string tfm in multiTfm.Split(";")) { @@ -143,7 +143,7 @@ public async Task RunTests_With_CentralPackageManagement_Standalone(string multi .PatchCodeWithReplace("$TargetFramework$", multiTfm) .PatchCodeWithReplace("$ExtraProperties$", string.Empty)); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", cancellationToken: TestContext.CancellationToken); compilationResult.AssertExitCodeIs(0); foreach (string tfm in multiTfm.Split(";")) { @@ -203,7 +203,7 @@ public async Task RunTests_With_MSTestRunner_Standalone_Selectively_Enabled_Exte .PatchCodeWithReplace("$TargetFramework$", multiTfm) .PatchCodeWithReplace("$ExtraProperties$", msbuildExtensionEnableFragment)); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", cancellationToken: TestContext.CancellationToken); compilationResult.AssertExitCodeIs(0); foreach (string tfm in multiTfm.Split(";")) { @@ -227,7 +227,7 @@ public async Task RunTests_With_MSTestRunner_Standalone_EnableAll_Extensions(str .PatchCodeWithReplace("$TargetFramework$", multiTfm) .PatchCodeWithReplace("$ExtraProperties$", "AllMicrosoft"), addPublicFeeds: true); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", cancellationToken: TestContext.CancellationToken); compilationResult.AssertExitCodeIs(0); foreach (string tfm in multiTfm.Split(";")) { @@ -257,7 +257,7 @@ public async Task RunTests_With_MSTestRunner_Standalone_Enable_Default_Extension .PatchCodeWithReplace("$TargetFramework$", multiTfm) .PatchCodeWithReplace("$ExtraProperties$", enableDefaultExtensions ? string.Empty : "None")); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", cancellationToken: TestContext.CancellationToken); compilationResult.AssertExitCodeIs(0); foreach (string tfm in multiTfm.Split(";")) { @@ -285,7 +285,7 @@ public async Task Invalid_TestingProfile_Name_Should_Fail(string multiTfm, Build .PatchCodeWithReplace("$TargetFramework$", multiTfm) .PatchCodeWithReplace("$ExtraProperties$", "WrongName")); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build -c {buildConfiguration} {testAsset.TargetAssetPath}", failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); compilationResult.AssertExitCodeIs(1); compilationResult.AssertOutputContains("Invalid value for property TestingExtensionsProfile. Valid values are 'Default', 'AllMicrosoft' and 'None'."); } @@ -309,7 +309,6 @@ public async Task NativeAot_Smoke_Test() DotnetMuxerResult compilationResult = await DotnetCli.RunAsync( $"publish -r {RID} -f {TargetFrameworks.NetCurrent} {testAsset.TargetAssetPath}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, retryCount: 0, cancellationToken: TestContext.CancellationToken); compilationResult.AssertOutputContains("Generating native code"); @@ -330,7 +329,7 @@ public async Task SettingIsTestApplicationToFalseReducesAddedExtensionsAndMakesP .PatchCodeWithReplace("$TargetFramework$", TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$ExtraProperties$", "false")); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test {testAsset.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: testAsset.TargetAssetPath, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"test {testAsset.TargetAssetPath}", workingDirectory: testAsset.TargetAssetPath, cancellationToken: TestContext.CancellationToken); compilationResult.AssertExitCodeIs(0); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ServerModeTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ServerModeTests.cs index 734811b0c7..94dd16c3bf 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ServerModeTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ServerModeTests.cs @@ -69,7 +69,7 @@ public async Task WhenClientDies_Server_ShouldClose_Gracefully(string tfm) Assert.AreEqual(3, exitCode); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "MSTestProject"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SynchronizationContextTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SynchronizationContextTests.cs index 6d3569f085..56c3974a96 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SynchronizationContextTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SynchronizationContextTests.cs @@ -39,7 +39,7 @@ public async Task SynchronizationContext_WhenSetInGlobalTestInitialize_IsPreserv testHostResult.AssertOutputContainsSummary(failed: 0, passed: 1, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "SynchronizationContextProject"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs index baf14251f0..52f3fb4644 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs @@ -79,7 +79,7 @@ public async Task TestContext_Current_ReturnsCorrectInstance(string tfm) testHostResult.AssertOutputContainsSummary(failed: 0, passed: 1, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "TestTestContext"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs index b5ae31cefd..11ac63ef82 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs @@ -40,7 +40,7 @@ public async Task DiscoverTests_WithFilter_FindsOnlyFilteredOnes(string currentT testHostResult.AssertOutputDoesNotContain("Test2"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs index fa710aa1ac..b970ea22a4 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs @@ -47,7 +47,7 @@ public async Task DiscoverTests_ShowsWarningsForTestsThatFailedToDiscover(string } } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestFilterTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestFilterTests.cs index 7f31acfca0..7eccd640c5 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestFilterTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestFilterTests.cs @@ -83,7 +83,7 @@ public async Task RunWithFilterFromRunsettings(string currentTfm) testHostResult.AssertExitCodeIs(ExitCodes.Success); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestRunParametersTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestRunParametersTests.cs index 29d101fbc5..f4a206fc1a 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestRunParametersTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestRunParametersTests.cs @@ -33,7 +33,7 @@ public async Task TestRunParameters_WhenProvidingMultipleMultipleTimesTheOptionA testHostResult.AssertOutputContainsSummary(failed: 0, passed: 1, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "TestRunParameters"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsInheritanceTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsInheritanceTests.cs index 0e87f421b6..2b2fb284a6 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsInheritanceTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsInheritanceTests.cs @@ -52,7 +52,7 @@ public async Task ThreadingContext_Inheritance_WhenUsingTimeout_CurrentCultureFl testHostResult.AssertOutputContainsSummary(failed: 0, passed: 16, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "CultureFlowsInheritanceThreadContextProject"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsTests.cs index c36a0e1651..1561c0029e 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsTests.cs @@ -52,7 +52,7 @@ public async Task ThreadingContext_WhenUsingTimeout_CurrentCultureFlowsBetweenMe testHostResult.AssertOutputContainsSummary(failed: 0, passed: 1, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "CultureFlowsThreadContextProject"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextTests.cs index 0f18055f63..9bd0afc140 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextTests.cs @@ -41,7 +41,7 @@ private static async Task SetCultureInFixtureMethodAndRunTests(string tfm, strin testHostResult.AssertOutputContainsSummary(failed: 0, passed: 2, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string InitToTestProjectName = "InitToTestThreadContextProject"; private const string InitToTestSourceCode = """ diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadingTests.cs index bb1a996b19..9c486b6e78 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadingTests.cs @@ -72,7 +72,7 @@ public async Task TestMethodThreading_WhenMainIsNotSTA_RunsettingsAsksForMTA_Thr testHostResult.AssertOutputDoesNotContain("Runsettings entry 'STA' is not supported on non-Windows OSes"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "TestThreading"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeCancellationTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeCancellationTests.cs index f05652755d..ac2a78dcc7 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeCancellationTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeCancellationTests.cs @@ -196,7 +196,7 @@ public async Task CooperativeCancellation_WhenTestCleanupTimeoutExpiresAndUserCh testHostResult.AssertOutputContains("Test cleanup method 'TestClass.TestCleanup' timed out after 1000ms"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture : TestAssetFixtureBase { public const string ProjectName = "TimeoutCooperativeTimeout"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeTestMethodTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeTestMethodTests.cs index 6bc8b552b7..437d80b1aa 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeTestMethodTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeTestMethodTests.cs @@ -74,7 +74,7 @@ public async Task CooperativeTimeout_WhenMethodTimeoutAndWaitInTestMethod_TestGe testHostResult.AssertOutputContains("Test 'TestMethod' timed out after 1000ms"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture : TestAssetFixtureBase { public const string ProjectName = "TimeoutCooperativeTestMethodTimeout"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutFromRunSettingsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutFromRunSettingsTests.cs index 3923cc0295..0b7d4e49c7 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutFromRunSettingsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutFromRunSettingsTests.cs @@ -84,7 +84,7 @@ private static async Task RunAndAssertFromRunSettingsAsync(string tfm, string en testHostResult.AssertOutputContains($"{InfoByKind[entryKind].Prefix} method '{InfoByKind[entryKind].MethodFullName}' timed out after {timeoutValue}ms"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture : TestAssetFixtureBase { public const string ProjectName = "TimeoutCodeWithNoTimeout"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTestMethodTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTestMethodTests.cs index 82a6f3afb7..ea164974ad 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTestMethodTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTestMethodTests.cs @@ -74,7 +74,7 @@ public async Task Timeout_WhenMethodTimeoutAndWaitInTestMethod_TestGetsCanceled( testHostResult.AssertOutputContains("Test 'TestMethod' timed out after 1000ms"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture : TestAssetFixtureBase { public const string ProjectName = "TimeoutTestMethodTimeout"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs index 5958a3d9b3..1e7dbe6ae5 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs @@ -66,7 +66,7 @@ public async Task Timeout_WhenTimeoutValueGreaterThanTestDuration_OutputDoesNotC testHostResult.AssertOutputDoesNotContain("Canceling the test session"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture : TestAssetFixtureBase { public const string ProjectName = "TimeoutTest"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenCanceledTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenCanceledTests.cs index 99a539d2fd..112314e7fd 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenCanceledTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenCanceledTests.cs @@ -38,7 +38,7 @@ private static async Task RunAndAssertTestWasCanceledAsync(string tfm, string en testHostResult.AssertOutputContains($"{InfoByKind[entryKind].Prefix} method '{InfoByKind[entryKind].MethodFullName}' was canceled"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture : TestAssetFixtureBase { public const string ProjectName = "TimeoutCodeWithSixtySecTimeout"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenExpiresTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenExpiresTests.cs index 6babcaa655..1483e7ee7f 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenExpiresTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenExpiresTests.cs @@ -149,7 +149,7 @@ private static async Task RunAndAssertAttributeTakesPrecedenceAsync(string tfm, testHostResult.AssertOutputContains($"{InfoByKind[entryKind].Prefix} method '{InfoByKind[entryKind].MethodFullName}' timed out after 1000ms"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture : TestAssetFixtureBase { public const string ProjectName = "TimeoutCodeWithOneSecTimeout"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrimTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrimTests.cs index b3ed74b3b4..ca9398298c 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrimTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrimTests.cs @@ -58,7 +58,6 @@ public async Task Publish_ShouldNotProduceTrimWarnings(string tfm) await DotnetCli.RunAsync( $"publish {generator.TargetAssetPath} -r {RID} -f {tfm}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, retryCount: 0, cancellationToken: TestContext.CancellationToken); } diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrxReportTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrxReportTests.cs index feebbcf523..5453af5894 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrxReportTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrxReportTests.cs @@ -40,7 +40,7 @@ public async Task TrxReport_WhenTestFails_ContainsExceptionInfoInOutput(string t Assert.Contains("at MSTestTrxReport.UnitTest1.FailingTest()", trxContent, trxContent); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "MSTestTrxReport"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TupleDynamicDataTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TupleDynamicDataTests.cs index 2ed2171f62..6beef180cf 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TupleDynamicDataTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TupleDynamicDataTests.cs @@ -52,7 +52,7 @@ public async Task TupleSupportDoesNotBreakObjectArraySupport(string tfm) testHostResult.AssertOutputContainsSummary(failed: 0, passed: 1, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "TupleDynamicDataTests"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ValueTaskTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ValueTaskTests.cs index 03a19b74d7..7d9a727702 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ValueTaskTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ValueTaskTests.cs @@ -21,7 +21,7 @@ public async Task CanUseValueTaskForAllKnownLocations(string tfm) testHostResult.AssertOutputContainsSummary(failed: 1, passed: 2, skipped: 1); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "TestValueTask"; diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WinUITests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WinUITests.cs index 77f5c313ef..e2d4531f84 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WinUITests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WinUITests.cs @@ -24,7 +24,7 @@ public async Task SimpleWinUITestCase() testHostResult.AssertOutputContainsSummary(failed: 0, passed: 1, skipped: 0); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string ProjectName = "WinUITests"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/AbortionTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/AbortionTests.cs index 41fbe30ea9..1d64bedf6c 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/AbortionTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/AbortionTests.cs @@ -27,7 +27,7 @@ public async Task AbortWithCTRLPlusC_TestHost_Succeeded(string tfm) testHostResult.AssertOutputContainsSummary(failed: 0, passed: 0, skipped: 0, aborted: true); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string Sources = """ #file Abort.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ConsoleTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ConsoleTests.cs index 751891b9c6..377578b012 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ConsoleTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ConsoleTests.cs @@ -72,7 +72,7 @@ private async Task ConsoleTestsCoreAsync(string tfm, string? environmentVariable testHostResult.AssertOutputContains("ABCDEF123"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string Sources = """ #file ConsoleTests.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs index 80c88b06d2..77b69bc77a 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs @@ -54,7 +54,7 @@ public async Task CrashDump_InvalidFormat_ShouldFail() testHostResult.AssertOutputContains("Option '--crashdump-type' has invalid arguments: 'invalid' is not a valid dump type. Valid options are 'Mini', 'Heap', 'Triage' and 'Full'"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string AssetName = "CrashDumpFixture"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashPlusHangDumpTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashPlusHangDumpTests.cs index 4859b255ca..7ef7a62030 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashPlusHangDumpTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashPlusHangDumpTests.cs @@ -54,7 +54,7 @@ public async Task CrashPlusHangDump_InCaseOfHang_CreateHangDump() Assert.IsGreaterThan(0, Directory.GetFiles(resultDirectory, "CrashPlusHangDump*_hang.dmp", SearchOption.AllDirectories).Length, $"Dump file not found '{TargetFrameworks.NetCurrent}'\n{testHostResult}'"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string AssetName = "AssetFixture"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CustomBannerTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CustomBannerTests.cs index fb45f259ec..5777814564 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CustomBannerTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CustomBannerTests.cs @@ -64,7 +64,7 @@ public async Task WithoutUsingNoBanner_TheBannerAppears(string tfm) testHostResult.AssertOutputMatchesRegex($"{TestAssetFixture.CustomBannerPrefix} Platform info: Name: Microsoft.Testing.Platform, Version: .+?, Hash: .*?, Date: .+?"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string CustomBannerPrefix = "Custom banner |"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DataConsumerThroughputTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DataConsumerThroughputTests.cs index 03f36c212a..a0d318e1b3 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DataConsumerThroughputTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DataConsumerThroughputTests.cs @@ -24,7 +24,7 @@ public async Task MultipleDataConsumers_ShouldCompleteInReasonableTime(string tf Assert.IsLessThan(7, stopwatch.Elapsed.TotalSeconds, testHostResult.ToString()); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string TestCode = """ #file DataConsumerThroughputTests.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs index e292e66436..af24d00318 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs @@ -229,7 +229,7 @@ private static async Task AssertDiagnosticReportWasGeneratedAsync(TestHo return (Regex.IsMatch(content, pattern), content); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string TestCode = """ #file DiagnosticTest.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/EnvironmentVariablesConfigurationProviderTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/EnvironmentVariablesConfigurationProviderTests.cs index eb7b66fb0c..0c5585c113 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/EnvironmentVariablesConfigurationProviderTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/EnvironmentVariablesConfigurationProviderTests.cs @@ -62,7 +62,7 @@ public async Task TestHostMessesUpExitCode(string currentTfm) testHostResult.AssertExitCodeIs(ExitCodes.ZeroTests); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string Sources = """ #file EnvironmentVariablesConfigurationProvider.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionRequestCompleteTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionRequestCompleteTests.cs index a733287649..62af57f232 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionRequestCompleteTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionRequestCompleteTests.cs @@ -20,7 +20,7 @@ public async Task Exec_Honor_Request_Complete(string tfm) Assert.IsGreaterThan(3, stopwatch.Elapsed.TotalSeconds); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string TestCode = """ #file ExecutionTests2.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionTests.cs index 87a28203ab..03a3c2d393 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionTests.cs @@ -160,7 +160,7 @@ public async Task Exec_WhenListTestsAndMinimumExpectedTestsAreSpecified_Discover testHostResult.AssertOutputContains("Error: '--list-tests' and '--minimum-expected-tests' are incompatible options"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string TestCode = """ #file ExecutionTests.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExitOnProcessExitTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExitOnProcessExitTests.cs index 1cd13953d3..078cd00584 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExitOnProcessExitTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExitOnProcessExitTests.cs @@ -56,7 +56,7 @@ public void ExitOnProcessExit_Succeed(string tfm) } } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string TestCode = """ #file ExecutionTests.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs index c9edc53e61..314bf28bab 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs @@ -24,7 +24,7 @@ public async Task NewerPlatform_WithPreviousExtensions_ShouldExecuteTests() Assert.IsNotEmpty(trxFiles, $"At least one TRX file should be generated in: {testResultsPath}"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string PreviousExtensionVersion = "2.0.0"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpOutputTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpOutputTests.cs index 9b864782d9..137afff2cd 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpOutputTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpOutputTests.cs @@ -29,7 +29,7 @@ public async Task HangDump_Outputs_HangingTests_EvenWhenHangingTestsHaveTheSameD testHostResult.AssertOutputContains("Test1"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string AssetName = "AssetFixture"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpProcessTreeTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpProcessTreeTests.cs index 7c31a3fab2..6a3f25a0ea 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpProcessTreeTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpProcessTreeTests.cs @@ -25,7 +25,7 @@ public async Task HangDump_DumpAllChildProcesses_CreateDump(string tfm) Assert.HasCount(4, dumpFiles, $"There should be 4 dumps, one for each process in the tree. {testHostResult}"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string AssetName = "AssetFixture"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs index f1600046a4..7bb3db9d20 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs @@ -32,7 +32,6 @@ public async Task HangDump_WithDotnetTest_CreateDump() DotnetMuxerResult testResult = await DotnetCli.RunAsync( $"test --project \"{AssetFixture.TargetAssetPath}\" --no-build -c Release -f {TargetFrameworks.NetCurrent} --hangdump --hangdump-timeout 8s --results-directory \"{resultDirectory}\"", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, environmentVariables: new Dictionary { { "SLEEPTIMEMS1", "4000" }, @@ -54,7 +53,6 @@ public async Task HangDump_WithDotnetTest_NoHangButOverallTimeGreaterThanTimeout DotnetMuxerResult testResult = await DotnetCli.RunAsync( $"test --project \"{AssetFixture.TargetAssetPath}\" --no-build -c Release -f {TargetFrameworks.NetCurrent} --hangdump --hangdump-timeout 7s --results-directory \"{resultDirectory}\"", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, environmentVariables: new Dictionary { { "SLEEPTIMEMS1", "5000" }, @@ -176,7 +174,7 @@ public async Task HangDump_WithForegroundThreadAfterSessionFinish_CreateDump() Assert.ContainsSingle(dumpFiles, $"Expected single dump file. Found: {Environment.NewLine}{string.Join(Environment.NewLine, dumpFiles)}{Environment.NewLine}{testHostResult}"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string AssetName = "AssetFixture"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs index 29e749a9fa..ce56972dbe 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs @@ -388,7 +388,7 @@ Default type is 'Full' testHostResult.AssertOutputMatchesLines(wildcardPattern); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string AllExtensionsAssetName = "AllExtensionsInfoTest"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs index 74a6900b10..2e44de3b98 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs @@ -335,7 +335,7 @@ public async Task Info_DoesNotCreateTestResultsFolder(string tfm) Assert.IsFalse(Directory.Exists(testResultsPath), "TestResults folder should not be created for info command"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string NoExtensionAssetName = "NoExtensionInfoTest"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceFixture.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceFixture.cs index 573fd3456e..4e5af2455e 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceFixture.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceFixture.cs @@ -6,16 +6,36 @@ namespace Microsoft.Testing.Platform.Acceptance.IntegrationTests; [TestClass] public static class AcceptanceFixture { - public static TempDirectory NuGetGlobalPackagesFolder { get; private set; } = null!; + private static string? s_nugetCache; [AssemblyInitialize] public static void AssemblyInitialize(TestContext context) { - NuGetGlobalPackagesFolder = new(".packages"); Environment.SetEnvironmentVariable("MSBUILDDISABLENODEREUSE", "1"); + + // Ensure all integration tests restore packages in a centralized place other than the NuGet cache. + // The centralized place also changes between runs (RandomId.Next()) so that re-packaging locally works as expected. + // So, when running Build.cmd -pack, running test, running Build.cmd -pack again, and running test again, the latest + // packages should be picked. + // If we restore to the same place (whether or not it is the machine-wide cache), NuGet will consider restore up-to-date and + // will use stale packages. + s_nugetCache = Path.Combine(TempDirectory.TestSuiteDirectory, RandomId.Next(), ".packages"); + Directory.CreateDirectory(s_nugetCache); + Environment.SetEnvironmentVariable("NUGET_PACKAGES", s_nugetCache); } [AssemblyCleanup] - public static void AssemblyCleanup() - => NuGetGlobalPackagesFolder.Dispose(); + public static void AssemblyCleanup(TestContext context) + { + if (s_nugetCache is not null) + { + try + { + Directory.Delete(s_nugetCache, recursive: true); + } + catch (IOException) + { + } + } + } } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/IgnoreExitCodeTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/IgnoreExitCodeTests.cs index 2b9204b1da..b183572e01 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/IgnoreExitCodeTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/IgnoreExitCodeTests.cs @@ -99,8 +99,7 @@ public async Task If_IgnoreExitCode_Specified_Should_Return_Success_ExitCode(str .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); string assetPath = generator.TargetAssetPath; - string globalPackagesPath = AcceptanceFixture.NuGetGlobalPackagesFolder.Path; - await DotnetCli.RunAsync($"build {assetPath} -c {buildConfiguration} -r {RID}", globalPackagesPath, cancellationToken: TestContext.CancellationToken); + await DotnetCli.RunAsync($"build {assetPath} -c {buildConfiguration} -r {RID}", cancellationToken: TestContext.CancellationToken); var host = TestInfrastructure.TestHost.LocateFrom(assetPath, AssetName, tfm, buildConfiguration: buildConfiguration); TestHostResult hostResult = await host.ExecuteAsync( command: commandLine, diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationFailingTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationFailingTests.cs index 4673dc3290..d36239551b 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationFailingTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationFailingTests.cs @@ -43,7 +43,7 @@ public async Task Execution_WithFailingTest_OutputContainsTranslatedFailureSumma AssertOutputContainsNormalized(testHostResult, "échec: 1"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string FailingAssetName = "LocalizationTestsFailing"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationTests.cs index 29e8902069..267fb8467d 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationTests.cs @@ -106,7 +106,7 @@ public async Task Execution_WithTestingPlatformUILanguage_TakesPrecedenceOverDot AssertOutputDoesNotContainNormalized(testHostResult, "Resumen de la serie de pruebas:"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string TestCode = """ #file LocalizationTests.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuild.KnownExtensionRegistration.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuild.KnownExtensionRegistration.cs index 58df8c81f0..a069f5d16b 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuild.KnownExtensionRegistration.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuild.KnownExtensionRegistration.cs @@ -19,7 +19,7 @@ public async Task Microsoft_Testing_Platform_Extensions_ShouldBe_Correctly_Regis SourceCode .PatchCodeWithReplace("$TargetFrameworks$", tfm) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - DotnetMuxerResult result = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -c {compilationMode} -r {RID} {testAsset.TargetAssetPath} -v:n", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult result = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -c {compilationMode} -r {RID} {testAsset.TargetAssetPath} -v:n", cancellationToken: TestContext.CancellationToken); string binlogFile = result.BinlogPath!; var testHost = TestInfrastructure.TestHost.LocateFrom(testAsset.TargetAssetPath, AssetName, tfm, rid: RID, verb: verb, buildConfiguration: compilationMode); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.ConfigurationFile.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.ConfigurationFile.cs index 776e60a032..9334ebe3b3 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.ConfigurationFile.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.ConfigurationFile.cs @@ -17,7 +17,7 @@ public async Task ConfigFileGeneration_CorrectlyCreateAndCacheAndCleaned(string .PatchCodeWithReplace("$JsonContent$", ConfigurationContent) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -v:normal {testAsset.TargetAssetPath} -c {compilationMode}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -v:normal {testAsset.TargetAssetPath} -c {compilationMode}", cancellationToken: TestContext.CancellationToken); var testHost = TestInfrastructure.TestHost.LocateFrom(testAsset.TargetAssetPath, "MSBuildTests", tfm, verb: verb, buildConfiguration: compilationMode); string generatedConfigurationFile = Path.Combine(testHost.DirectoryName, "MSBuildTests.testconfig.json"); @@ -25,7 +25,7 @@ public async Task ConfigFileGeneration_CorrectlyCreateAndCacheAndCleaned(string Assert.AreEqual(ConfigurationContent.Trim(), File.ReadAllText(generatedConfigurationFile).Trim()); Assert.Contains("Microsoft Testing Platform configuration file written", compilationResult.StandardOutput); - compilationResult = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -v:normal {testAsset.TargetAssetPath} -c {compilationMode}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + compilationResult = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -v:normal {testAsset.TargetAssetPath} -c {compilationMode}", cancellationToken: TestContext.CancellationToken); Assert.IsTrue(File.Exists(generatedConfigurationFile)); Assert.AreEqual(ConfigurationContent.Trim(), File.ReadAllText(generatedConfigurationFile).Trim()); // Assert is failing, probably the MSBuild regression which is being fixed in https://github.com/dotnet/msbuild/pull/12431 ? @@ -36,7 +36,7 @@ public async Task ConfigFileGeneration_CorrectlyCreateAndCacheAndCleaned(string \s*_GenerateTestingPlatformConfigurationFileCore: \s*Skipping target "_GenerateTestingPlatformConfigurationFileCore" because all output files are up\-to\-date with respect to the input files\. """)); - await DotnetCli.RunAsync($"clean -c {compilationMode} -v:normal {testAsset.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + await DotnetCli.RunAsync($"clean -c {compilationMode} -v:normal {testAsset.TargetAssetPath}", cancellationToken: TestContext.CancellationToken); // dotnet clean doesn't clean the publish output folder if (verb == Verb.build) @@ -58,7 +58,7 @@ public async Task ConfigFileGeneration_NoConfigurationFile_TaskWontRun(string tf File.Delete(Path.Combine(testAsset.TargetAssetPath, "testconfig.json")); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -v:diagnostic {testAsset.TargetAssetPath} -c {compilationMode}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -v:diagnostic {testAsset.TargetAssetPath} -c {compilationMode}", cancellationToken: TestContext.CancellationToken); var testHost = TestInfrastructure.TestHost.LocateFrom(testAsset.TargetAssetPath, "MSBuildTests", tfm, verb: verb, buildConfiguration: compilationMode); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.GenerateEntryPoint.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.GenerateEntryPoint.cs index b820c06af2..dfb13db03f 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.GenerateEntryPoint.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.GenerateEntryPoint.cs @@ -22,7 +22,6 @@ public async Task When_GenerateTestingPlatformEntryPoint_IsFalse_NoEntryPointInj DotnetMuxerResult compilationResult = await DotnetCli.RunAsync( $"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -c {compilationMode} -r {RID} -p:GenerateTestingPlatformEntryPoint=False {testAsset.TargetAssetPath} -v:n", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); SL.Build binLog = SL.Serialization.Read(compilationResult.BinlogPath!); @@ -134,7 +133,7 @@ private async Task GenerateAndVerifyLanguageSpecificEntryPointAsync(string asset .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion); using TestAsset testAsset = await TestAsset.GenerateAssetAsync(assetName, finalSourceCode); - DotnetMuxerResult buildResult = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -c {compilationMode} -r {RID} {testAsset.TargetAssetPath} -v:n", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult buildResult = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -c {compilationMode} -r {RID} {testAsset.TargetAssetPath} -v:n", cancellationToken: TestContext.CancellationToken); SL.Build binLog = SL.Serialization.Read(buildResult.BinlogPath!); SL.Target[] generateTestingPlatformEntryPointTargets = binLog.FindChildrenRecursive().Where(t => t.Name == "_GenerateTestingPlatformEntryPoint").ToArray(); Assert.HasCount(1, generateTestingPlatformEntryPointTargets, "Expected exactly one _GenerateTestingPlatformEntryPoint target"); @@ -162,7 +161,7 @@ private async Task GenerateAndVerifyLanguageSpecificEntryPointAsync(string asset Assert.IsNotNull(sourceFilePathInObj); File.Delete(buildResult.BinlogPath!); - buildResult = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -c {compilationMode} -r {RID} {testAsset.TargetAssetPath} -v:n", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + buildResult = await DotnetCli.RunAsync($"{(verb == Verb.publish ? $"publish -f {tfm}" : "build")} -c {compilationMode} -r {RID} {testAsset.TargetAssetPath} -v:n", cancellationToken: TestContext.CancellationToken); binLog = SL.Serialization.Read(buildResult.BinlogPath!); generateTestingPlatformEntryPointTargets = binLog.FindChildrenRecursive().Where(t => t.Name == "_GenerateTestingPlatformEntryPoint" && t.Children.Count > 0).ToArray(); Assert.HasCount(1, generateTestingPlatformEntryPointTargets, "Expected exactly one _GenerateTestingPlatformEntryPoint target with children on rebuild"); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Solution.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Solution.cs index e593906c77..2660b93313 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Solution.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Solution.cs @@ -45,9 +45,9 @@ public async Task MSBuildTests_UseMSBuildTestInfrastructure_Should_Run_Solution_ } // Build the solution - DotnetMuxerResult restoreResult = await DotnetCli.RunAsync($"restore {solution.SolutionFile} --configfile {nugetFile}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult restoreResult = await DotnetCli.RunAsync($"restore {solution.SolutionFile} --configfile {nugetFile}", cancellationToken: TestContext.CancellationToken); restoreResult.AssertOutputDoesNotContain("An approximate best match of"); - DotnetMuxerResult testResult = await DotnetCli.RunAsync($"build --no-restore -t:Test -p:UseMSBuildTestInfrastructure=true {solution.SolutionFile}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: solution.FolderPath, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult testResult = await DotnetCli.RunAsync($"build --no-restore -t:Test -p:UseMSBuildTestInfrastructure=true {solution.SolutionFile}", workingDirectory: solution.FolderPath, cancellationToken: TestContext.CancellationToken); if (isMultiTfm) { diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Test.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Test.cs index ccd340b91f..1b8c2acf77 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Test.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Test.cs @@ -53,7 +53,7 @@ private async Task InvokeTestingPlatform_Target_Should_Execute_Tests_Without_Sho .PatchCodeWithReplace("$AssertValue$", testSucceeded.ToString().ToLowerInvariant()) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); string testResultFolder = Path.Combine(testAsset.TargetAssetPath, Guid.NewGuid().ToString("N")); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"{testCommand} -p:TestingPlatformCommandLineArguments=\"--results-directory %22{testResultFolder}%22\" -p:Configuration={compilationMode} \"{testAsset.TargetAssetPath}\"", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: testAsset.TargetAssetPath, failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"{testCommand} -p:TestingPlatformCommandLineArguments=\"--results-directory %22{testResultFolder}%22\" -p:Configuration={compilationMode} \"{testAsset.TargetAssetPath}\"", workingDirectory: testAsset.TargetAssetPath, failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); foreach (string tfmToAssert in tfmsToAssert) { @@ -85,11 +85,9 @@ private async Task InvokeTestingPlatform_Target_Should_Build_Without_Warnings_An DotnetMuxerResult compilationResult = testCommand.StartsWith("test", StringComparison.OrdinalIgnoreCase) ? await DotnetCli.RunAsync( $"{testCommand} -p:Configuration={compilationMode} \"{testAsset.TargetAssetPath}\" -- --treenode-filter --results-directory \"{testResultFolder}\"", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: testAsset.TargetAssetPath, cancellationToken: TestContext.CancellationToken) : await DotnetCli.RunAsync( $"{testCommand} -p:TestingPlatformCommandLineArguments=\"--treenode-filter --results-directory \"{testResultFolder}\"\" -p:Configuration={compilationMode} \"{testAsset.TargetAssetPath}\"", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: testAsset.TargetAssetPath, cancellationToken: TestContext.CancellationToken); foreach (string tfmToAssert in tfmsToAssert) @@ -144,7 +142,6 @@ public async Task Invoke_TestTarget_With_Arch_Switch_x86_Should_Work() .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); await DotnetCli.RunAsync( $"build -t:Test --arch x86 -p:Configuration=Release \"{testAsset.TargetAssetPath}\"", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: testAsset.TargetAssetPath, environmentVariables: dotnetRootX86, failIfReturnValueIsNotZero: false, @@ -179,7 +176,6 @@ public async Task Invoke_TestTarget_With_Incompatible_Arch() .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); DotnetMuxerResult result = await DotnetCli.RunAsync( $"build -t:Test --arch {incompatibleArchitecture} \"{testAsset.TargetAssetPath}\"", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: testAsset.TargetAssetPath, failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); @@ -231,7 +227,6 @@ public async Task Invoke_TestTarget_With_DOTNET_HOST_PATH_Should_Work() .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); await DotnetCli.RunAsync( $"build -t:Test -p:Configuration=Release \"{testAsset.TargetAssetPath}\"", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: testAsset.TargetAssetPath, environmentVariables: dotnetHostPathEnvVar, failIfReturnValueIsNotZero: false, @@ -281,7 +276,7 @@ public async Task InvokeTestingPlatform_Target_Showing_Error_And_Do_Not_Capture_ .PatchCodeWithReplace("$TargetFrameworks$", $"{tfm}") .PatchCodeWithReplace("$AssertValue$", testSucceeded.ToString().ToLowerInvariant()) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"{testCommand} -p:TestingPlatformShowTestsFailure=True -p:TestingPlatformCaptureOutput=False -p:Configuration={compilationMode} {testAsset.TargetAssetPath}", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: testAsset.TargetAssetPath, failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"{testCommand} -p:TestingPlatformShowTestsFailure=True -p:TestingPlatformCaptureOutput=False -p:Configuration={compilationMode} {testAsset.TargetAssetPath}", workingDirectory: testAsset.TargetAssetPath, failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); compilationResult.AssertOutputContains("error test failed: Test2 ("); compilationResult.AssertOutputContains("FAILED: Expected 'true', but got 'false'."); @@ -298,7 +293,7 @@ public async Task TestingPlatformDisableCustomTestTarget_Should_Cause_UserDefine .PatchCodeWithReplace("$TargetFrameworks$", $"{TargetFrameworks.NetCurrent}") .PatchCodeWithReplace("$AssertValue$", "true") .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build {testAsset.TargetAssetPath} -p:TestingPlatformDisableCustomTestTarget=true -p:ImportUserDefinedTestTarget=true -t:\"Build;Test\"", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); + DotnetMuxerResult compilationResult = await DotnetCli.RunAsync($"build {testAsset.TargetAssetPath} -p:TestingPlatformDisableCustomTestTarget=true -p:ImportUserDefinedTestTarget=true -t:\"Build;Test\"", failIfReturnValueIsNotZero: false, cancellationToken: TestContext.CancellationToken); compilationResult.AssertOutputContains("Error from UserDefinedTestTarget.targets"); } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs index c4abd9c203..a58aaed423 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs @@ -36,7 +36,7 @@ public async Task WhenCapabilityIsMissingShouldFail() testHostResult.AssertOutputContains("The current test framework does not implement 'IGracefulStopTestExecutionCapability' which is required for '--maximum-failed-tests' feature."); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string Sources = """ #file MaxFailedTestsExtensionTests.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NativeAotTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NativeAotTests.cs index 8ab182749e..e4acea3c4c 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NativeAotTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NativeAotTests.cs @@ -87,7 +87,6 @@ public async Task NativeAotTests_WillRunWithExitCodeZero(string tfm) DotnetMuxerResult compilationResult = await DotnetCli.RunAsync( $"publish {generator.TargetAssetPath} -r {RID}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, retryCount: 0, cancellationToken: TestContext.CancellationToken); compilationResult.AssertOutputContains("Generating native code"); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NoBannerTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NoBannerTests.cs index 4574e544c0..9af14600dd 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NoBannerTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NoBannerTests.cs @@ -65,7 +65,7 @@ public async Task WithoutUsingNoBanner_TheBannerAppears(string tfm) testHostResult.AssertOutputMatchesRegex(_bannerRegexMatchPattern); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string NoBannerTestCode = """ #file NoBannerTest.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs index 5597b9ce58..bfb53fd5e0 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs @@ -187,7 +187,6 @@ public async Task RetryFailedTests_PassingFromFirstTime_UsingTestTarget_MoveFile DotnetMuxerResult result = await DotnetCli.RunAsync( $"build \"{AssetFixture.TargetAssetPath}\" -c Release -t:DispatchToInnerBuildsWithMTPTestTarget -p:TestingPlatformCommandLineArguments=\"--retry-failed-tests 1 --results-directory %22{resultDirectory}%22\"", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: AssetFixture.TargetAssetPath, cancellationToken: TestContext.CancellationToken); result.AssertExitCodeIs(ExitCodes.Success); @@ -205,7 +204,7 @@ public async Task RetryFailedTests_PassingFromFirstTime_UsingTestTarget_MoveFile } } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ServerLoggingTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ServerLoggingTests.cs index b7e7a9b7ff..c05c1286ab 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ServerLoggingTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ServerLoggingTests.cs @@ -78,7 +78,7 @@ public async Task RunningInServerMode_BannerIsSkipped() await jsonClient.Exit(); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string AssetName = "AssetFixture"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryDisabledTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryDisabledTests.cs index 27d066f6bd..b832ade98c 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryDisabledTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryDisabledTests.cs @@ -55,7 +55,7 @@ private static async Task AssertDiagnosticReportAsync(TestHostResult tes return (Regex.IsMatch(content, pattern), content); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string WithoutTelemetry = nameof(WithoutTelemetry); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryTests.cs index dea635ba32..ceec796581 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryTests.cs @@ -111,7 +111,7 @@ private static async Task AssertDiagnosticReportAsync(TestHostResult tes return (Regex.IsMatch(content, pattern), content); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string WithTelemetry = nameof(WithTelemetry); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TestHostProcessLifetimeHandlerTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TestHostProcessLifetimeHandlerTests.cs index 13e935b465..3b352e224d 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TestHostProcessLifetimeHandlerTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TestHostProcessLifetimeHandlerTests.cs @@ -20,7 +20,7 @@ public async Task All_Interface_Methods_ShouldBe_Invoked(string currentTfm) Assert.AreEqual("TestHostProcessLifetimeHandler.OnTestHostProcessExitedAsync", File.ReadAllText(Path.Combine(testHost.DirectoryName, "OnTestHostProcessExitedAsync.txt"))); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string Sources = """ #file TestHostProcessLifetimeHandler.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs index d56bbcc26e..8c4005a3a5 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs @@ -83,7 +83,7 @@ public async Task TimeoutWithValidArg_WithHourAsSuffix_WithTestNotTimeOut_Output testHostResult.AssertOutputDoesNotContain("Canceling the test session"); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string AssetName = "TimeoutTest"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrimTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrimTests.cs index 06d71cd477..aa72cc5ba1 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrimTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrimTests.cs @@ -49,7 +49,6 @@ public async Task Publish_ShouldNotProduceTrimWarnings(string tfm) await DotnetCli.RunAsync( $"publish {generator.TargetAssetPath} -r {RID}", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, retryCount: 0, cancellationToken: TestContext.CancellationToken); } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxDataRowTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxDataRowTests.cs index a93234109e..3353c81700 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxDataRowTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxDataRowTests.cs @@ -47,7 +47,7 @@ private static async Task CheckTrxContentsMatchAsync(string path, string p return Regex.IsMatch(await reader.ReadToEndAsync(), pattern); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string AssetNameUsingMSTest = "TrxTestUsingMSTest"; private const string WithDataRow = nameof(WithDataRow); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxFailingTestTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxFailingTestTests.cs index e63ce58f5c..88e93378ba 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxFailingTestTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxFailingTestTests.cs @@ -38,7 +38,7 @@ public async Task Trx_WhenTestFails_ContainsExceptionInfoInOutput(string tfm) Assert.Contains("at DummyTestFramework.ExecuteRequestAsync", trxContent, trxContent); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string AssetName = "TrxTest"; private const string WithFailingTest = nameof(WithFailingTest); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxSkippedTestTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxSkippedTestTests.cs index 7811e00c13..49ae0774a3 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxSkippedTestTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxSkippedTestTests.cs @@ -53,7 +53,7 @@ public async Task Trx_UsingDataDriven_CreatesUnitTestTagForEachOneInsideTheTrx(s Assert.IsTrue(Regex.IsMatch(trxContent, trxContentsPattern)); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string AssetNameUsingMSTest = "TrxTestUsingMSTest"; private const string WithSkippedTest = nameof(WithSkippedTest); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxTests.cs index 44fe89de66..fadc3dac8f 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxTests.cs @@ -65,7 +65,6 @@ public async Task Trx_WhenTestHostCrash_RunningUnderDotnetTest_ErrorIsDisplayedI DotnetMuxerResult result = await DotnetCli.RunAsync( $"test --project \"{AssetFixture.TargetAssetPath}\" --no-build -c Release -f {tfm} --crashdump --report-trx --report-trx-filename {fileName}.trx --results-directory \"{testResultsPath}\"", - AcceptanceFixture.NuGetGlobalPackagesFolder.Path, workingDirectory: AssetFixture.TargetAssetPath, environmentVariables: new() { { "CRASHPROCESS", "1" } }, failIfReturnValueIsNotZero: false, @@ -173,7 +172,7 @@ private static async Task CheckTrxContentsMatchAsync(string path, string p return Regex.IsMatch(await reader.ReadToEndAsync(), pattern); } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { public const string AssetName = "TrxTest"; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TypeForwardingTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TypeForwardingTests.cs index 1da6bef30c..67aa81c055 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TypeForwardingTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TypeForwardingTests.cs @@ -68,7 +68,7 @@ public async Task SettingDisplayNameFromNetStandardLibraryDuringNetCurrentRuntim .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion); using TestAsset testAsset = await TestAsset.GenerateAssetAsync(AssetName, patchedSources); - await DotnetCli.RunAsync($"build {testAsset.TargetAssetPath}/ConsoleApp -c Release", AcceptanceFixture.NuGetGlobalPackagesFolder.Path, cancellationToken: TestContext.CancellationToken); + await DotnetCli.RunAsync($"build {testAsset.TargetAssetPath}/ConsoleApp -c Release", cancellationToken: TestContext.CancellationToken); var testHost = TestInfrastructure.TestHost.LocateFrom($"{testAsset.TargetAssetPath}/ConsoleApp", "ConsoleApp", TargetFrameworks.NetCurrent); TestHostResult testHostResult = await testHost.ExecuteAsync(cancellationToken: TestContext.CancellationToken); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/UnhandledExceptionPolicyTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/UnhandledExceptionPolicyTests.cs index 82d7fe4712..1447ca364f 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/UnhandledExceptionPolicyTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/UnhandledExceptionPolicyTests.cs @@ -157,7 +157,7 @@ public async Task UnhandledExceptionPolicy_EnvironmentVariable_UnhandledExceptio } } - public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) + public sealed class TestAssetFixture() : TestAssetFixtureBase() { private const string AssetName = "UnhandledExceptionPolicyTests"; diff --git a/test/Performance/MSTest.Performance.Runner/Steps/DotnetMuxer.cs b/test/Performance/MSTest.Performance.Runner/Steps/DotnetMuxer.cs index 71a40f3f27..5b19dba9e8 100644 --- a/test/Performance/MSTest.Performance.Runner/Steps/DotnetMuxer.cs +++ b/test/Performance/MSTest.Performance.Runner/Steps/DotnetMuxer.cs @@ -20,10 +20,9 @@ public async Task ExecuteAsync(SingleProject payload, IContext co throw new NotSupportedException(); } - string nugetRestoreFolder = Path.Combine(payload.TestAsset.TargetAssetPath, ".packages"); string buildCommand = $"build {payload.TestAsset.TargetAssetPath} -c {_buildConfiguration}"; Console.WriteLine($"Building: '{buildCommand}'"); - await DotnetCli.RunAsync(buildCommand, nugetRestoreFolder); + await DotnetCli.RunAsync(buildCommand); var testHost = TestHost.LocateFrom(payload.TestAsset.TargetAssetPath, payload.AssetName, payload.Tfms.Single(), buildConfiguration: _buildConfiguration); return new BuildArtifact(testHost, payload.TestAsset); } diff --git a/test/Performance/MSTest.Performance.Runner/Steps/DotnetTrace.cs b/test/Performance/MSTest.Performance.Runner/Steps/DotnetTrace.cs index 5742d70b20..7c67087ec3 100644 --- a/test/Performance/MSTest.Performance.Runner/Steps/DotnetTrace.cs +++ b/test/Performance/MSTest.Performance.Runner/Steps/DotnetTrace.cs @@ -24,8 +24,7 @@ public DotnetTrace(string arguments, string reportFileName, CompressionLevel com public async Task ExecuteAsync(BuildArtifact payload, IContext context) { - string nugetRestoreFolder = Path.Combine(payload.TestAsset.TargetAssetPath, ".packages"); - await DotnetCli.RunAsync($"tool install --tool-path \"{payload.TestAsset.TargetAssetPath}\" dotnet-trace", nugetRestoreFolder); + await DotnetCli.RunAsync($"tool install --tool-path \"{payload.TestAsset.TargetAssetPath}\" dotnet-trace"); string dotnetTrace = Path.Combine(payload.TestAsset.TargetAssetPath, "dotnet-trace" + (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : string.Empty)); diff --git a/test/Utilities/Automation.CLI/VSTestConsoleLocator.cs b/test/Utilities/Automation.CLI/VSTestConsoleLocator.cs index 3966fa7f8e..75206bd4a0 100644 --- a/test/Utilities/Automation.CLI/VSTestConsoleLocator.cs +++ b/test/Utilities/Automation.CLI/VSTestConsoleLocator.cs @@ -20,10 +20,7 @@ public static class VSTestConsoleLocator /// Full path to vstest.console.exe. public static string GetConsoleRunnerPath() { - string testPlatformNuGetPackageFolder = Path.Combine( - GetNugetPackageFolder(), - TestPlatformPackageName, - GetTestPlatformVersion()); + string testPlatformNuGetPackageFolder = GetNugetPackageFolder(TestPlatformPackageName, GetTestPlatformVersion()); if (!Directory.Exists(testPlatformNuGetPackageFolder)) { throw new DirectoryNotFoundException($"Test platform NuGet package folder '{testPlatformNuGetPackageFolder}' does not exist"); @@ -51,14 +48,17 @@ InvalidOperationException GetExceptionForVSTestConsoleNotFound(string expectedPa } } - private static string GetNugetPackageFolder() + private static string GetNugetPackageFolder(string packageName, string packageVersion) { string? nugetPackagesFolderPath = Environment.GetEnvironmentVariable("NUGET_PACKAGES"); if (!string.IsNullOrEmpty(nugetPackagesFolderPath)) { Assert.IsTrue(Directory.Exists(nugetPackagesFolderPath), $"Found environment variable 'NUGET_PACKAGES' and NuGet package folder '{nugetPackagesFolderPath}' should exist"); - - return nugetPackagesFolderPath; + string fullPackagePath = Path.Combine(nugetPackagesFolderPath, packageName, packageVersion); + if (Directory.Exists(fullPackagePath)) + { + return fullPackagePath; + } } string? userProfile = Environment.GetEnvironmentVariable("USERPROFILE"); @@ -70,7 +70,9 @@ private static string GetNugetPackageFolder() nugetPackagesFolderPath = Path.Combine(userProfile, ".nuget", "packages"); Assert.IsTrue(Directory.Exists(nugetPackagesFolderPath), $"NuGet package folder '{nugetPackagesFolderPath}' should exist"); - return nugetPackagesFolderPath; + string fullPackagePathFromUserProfile = Path.Combine(nugetPackagesFolderPath, packageName, packageVersion); + Assert.IsTrue(Directory.Exists(fullPackagePathFromUserProfile), $"NuGet package folder '{fullPackagePathFromUserProfile}' should exist"); + return fullPackagePathFromUserProfile; } private static string GetTestPlatformVersion() diff --git a/test/Utilities/Microsoft.Testing.TestInfrastructure/DotnetCli.cs b/test/Utilities/Microsoft.Testing.TestInfrastructure/DotnetCli.cs index 6b89e1600a..af080999b7 100644 --- a/test/Utilities/Microsoft.Testing.TestInfrastructure/DotnetCli.cs +++ b/test/Utilities/Microsoft.Testing.TestInfrastructure/DotnetCli.cs @@ -48,7 +48,6 @@ public static int MaxOutstandingCommands public static async Task RunAsync( string args, - string nugetGlobalPackagesFolder, string? workingDirectory = null, Dictionary? environmentVariables = null, bool failIfReturnValueIsNotZero = true, @@ -94,8 +93,6 @@ public static async Task RunAsync( environmentVariables.Add("DOTNET_CLI_TELEMETRY_OPTOUT", "1"); } - environmentVariables["NUGET_PACKAGES"] = nugetGlobalPackagesFolder; - string extraArgs = warnAsError ? " -p:MSBuildTreatWarningsAsErrors=true -p:TreatWarningsAsErrors=true" : string.Empty; extraArgs += suppressPreviewDotNetMessage ? " -p:SuppressNETCoreSdkPreviewMessage=true" : string.Empty; if (args.IndexOf("-- ", StringComparison.Ordinal) is int platformArgsIndex && platformArgsIndex > 0) diff --git a/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAsset.cs b/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAsset.cs index 61b0849333..fc48834022 100644 --- a/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAsset.cs +++ b/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAsset.cs @@ -135,9 +135,6 @@ public static string GetNuGetConfig(bool addPublicFeeds = false, bool addHashFil - - - {publicFeedsMapping} diff --git a/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs b/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs index 97e80cb3eb..1a73d28d4b 100644 --- a/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs +++ b/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs @@ -21,12 +21,8 @@ public abstract class TestAssetFixtureBase : ITestAssetFixture { private readonly ConcurrentDictionary _testAssets = new(); private readonly TempDirectory _tempDirectory = new(); - private readonly TempDirectory _nugetGlobalPackagesDirectory; private bool _disposedValue; - protected TestAssetFixtureBase(TempDirectory nugetGlobalPackagesDirectory) - => _nugetGlobalPackagesDirectory = nugetGlobalPackagesDirectory; - public string GetAssetPath(string assetID) => !_testAssets.TryGetValue(assetID, out TestAsset? testAsset) ? throw new ArgumentNullException(nameof(assetID), $"Cannot find target path for test asset '{assetID}'") @@ -36,7 +32,7 @@ public async Task InitializeAsync(CancellationToken cancellationToken) { (string assetId, string assetName, string assetCode) = GetAssetsToGenerate(); TestAsset testAsset = await TestAsset.GenerateAssetAsync(assetId, assetCode, _tempDirectory); - DotnetMuxerResult result = await DotnetCli.RunAsync($"build {testAsset.TargetAssetPath} -c Release", _nugetGlobalPackagesDirectory.Path, callerMemberName: assetName, cancellationToken: cancellationToken); + DotnetMuxerResult result = await DotnetCli.RunAsync($"build {testAsset.TargetAssetPath} -c Release", callerMemberName: assetName, cancellationToken: cancellationToken); testAsset.DotnetResult = result; _testAssets.TryAdd(assetId, testAsset); }