Skip to content

Simplfy NuGet cache folder handling in integration tests#7573

Merged
Youssef1313 merged 13 commits intomainfrom
dev/ygerges/use-global-cache
Apr 16, 2026
Merged

Simplfy NuGet cache folder handling in integration tests#7573
Youssef1313 merged 13 commits intomainfrom
dev/ygerges/use-global-cache

Conversation

@Youssef1313
Copy link
Copy Markdown
Member

@Youssef1313 Youssef1313 commented Mar 19, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 19, 2026 12:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the test infrastructure and integration tests to stop using a per-asset .packages restore location and instead rely on the ambient/global NuGet cache behavior (e.g., NUGET_PACKAGES from the environment or the default user global-packages folder).

Changes:

  • Remove the explicit NUGET_PACKAGES override from DotnetCli.RunAsync and remove .packages from generated NuGet.config.
  • Simplify acceptance test fixtures by removing the custom NuGet cache TempDirectory wiring and updating all derived fixtures.
  • Update performance runner steps and all test call sites to the updated DotnetCli.RunAsync signature.

Reviewed changes

Copilot reviewed 113 out of 113 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs Stop passing custom NuGet folder into builds
test/Utilities/Microsoft.Testing.TestInfrastructure/TestAsset.cs Remove .packages globalPackagesFolder in NuGet.config
test/Utilities/Microsoft.Testing.TestInfrastructure/DotnetCli.cs Remove NUGET_PACKAGES injection parameter
test/Performance/MSTest.Performance.Runner/Steps/DotnetTrace.cs Use updated DotnetCli invocation
test/Performance/MSTest.Performance.Runner/Steps/DotnetMuxer.cs Use updated DotnetCli invocation
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/UnhandledExceptionPolicyTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TypeForwardingTests.cs Remove custom NuGet folder argument
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxTests.cs Remove custom NuGet folder argument + fixture update
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxSkippedTestTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxFailingTestTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxDataRowTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrimTests.cs Remove custom NuGet folder argument
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TestHostProcessLifetimeHandlerTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryDisabledTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ServerLoggingTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs Remove custom NuGet folder argument + fixture update
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NoBannerTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NativeAotTests.cs Remove custom NuGet folder argument
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Test.cs Remove custom NuGet folder argument(s)
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Solution.cs Remove custom NuGet folder argument(s)
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.GenerateEntryPoint.cs Remove custom NuGet folder argument(s)
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.ConfigurationFile.cs Remove custom NuGet folder argument(s)
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuild.KnownExtensionRegistration.cs Remove custom NuGet folder argument
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationFailingTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/IgnoreExitCodeTests.cs Remove custom NuGet folder argument
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceFixture.cs Remove .packages TempDirectory management
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs Remove custom NuGet folder argument(s) + fixture update
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpProcessTreeTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpOutputTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExitOnProcessExitTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionRequestCompleteTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/EnvironmentVariablesConfigurationProviderTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DataConsumerThroughputTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CustomBannerTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashPlusHangDumpTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ConsoleTests.cs Update fixture base ctor call
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/AbortionTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WinUITests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ValueTaskTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TupleDynamicDataTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrxReportTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrimTests.cs Remove custom NuGet folder argument(s)
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadingTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsInheritanceTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestRunParametersTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestFilterTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SynchronizationContextTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ServerModeTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SdkTests.cs Remove custom NuGet folder argument(s)
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STAThreadingTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTimeoutTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodCooperativeTimeoutTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTimeoutTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassCooperativeTimeoutTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunnerTests.cs Remove custom NuGet folder argument(s)
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RetryTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PublishAotNonNativeTests.cs Remove custom NuGet folder argument
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PlaywrightSdkTests.cs Remove custom NuGet folder argument + fixture update
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedTestTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataSourceTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataRowTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/OutputTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/NativeAotTests.cs Remove custom NuGet folder argument(s)
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MSBuildRunnerTests.cs Remove custom NuGet folder argument(s)
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleWithParallelAttributesTaskThreadingTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesVoidThreadingTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesValueTaskThreadingTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesTaskThreadingTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LeakTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InconclusiveTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/IgnoreTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/GenericTestMethodTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/FrameworkOnlyTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DynamicDataMethodTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DuplicateTestClassAttributeTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DotnetTestCliTests.cs Remove custom NuGet folder argument
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeploymentItemTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeadlockTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DataSourceTests.cs Remove custom NuGet folder argument
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CustomAttributesTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationSettingsTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestV2SettingsTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestSettingsTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CancellationTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolverTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolutionTests.cs Remove custom NuGet folder argument
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyCleanupTests.cs Update fixture base ctor call
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AspireSdkTests.cs Remove custom NuGet folder argument + fixture update
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AppDomainTests.cs Remove custom NuGet folder argument + fixture update
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AnalyzersTests.cs Remove custom NuGet folder argument(s)
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AbortionTests.cs Update fixture base ctor call

You can also share your feedback on Copilot code review. Take the survey.

Comment thread test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs Outdated
@Youssef1313 Youssef1313 marked this pull request as ready for review March 19, 2026 13:41
Copy link
Copy Markdown
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is problematic when iterating locally (I have done a longer explanation in our team chat).

@Youssef1313 Youssef1313 marked this pull request as draft March 19, 2026 14:29
Copilot AI review requested due to automatic review settings March 24, 2026 11:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR changes the test infrastructure used by MSTest/Microsoft.Testing.Platform acceptance/performance tests so that generated test assets no longer restore/build against a per-asset (or per-assembly) .packages folder, and instead rely on the ambient NuGet global packages location (or ambient NUGET_PACKAGES).

Changes:

  • Remove the dedicated .packages global packages folder setup from acceptance test assembly initialization.
  • Stop forcing NUGET_PACKAGES in DotnetCli.RunAsync and remove the globalPackagesFolder override from generated NuGet.config.
  • Update all affected tests/steps to use the new DotnetCli.RunAsync signature and base fixture constructor.

Reviewed changes

Copilot reviewed 119 out of 119 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs Removes explicit NuGet packages temp directory usage when building generated assets.
test/Utilities/Microsoft.Testing.TestInfrastructure/TestAsset.cs Generated NuGet.config no longer pins globalPackagesFolder to .packages.
test/Utilities/Microsoft.Testing.TestInfrastructure/DotnetCli.cs Removes NUGET_PACKAGES injection; RunAsync no longer forces a packages folder.
test/Performance/MSTest.Performance.Runner/Steps/DotnetTrace.cs Stops using per-asset .packages folder when installing dotnet-trace.
test/Performance/MSTest.Performance.Runner/Steps/DotnetMuxer.cs Stops using per-asset .packages folder for restore/build.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/UnhandledExceptionPolicyTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TypeForwardingTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync and updates fixture base ctor.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxSkippedTestTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxFailingTestTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxDataRowTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrimTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TestHostProcessLifetimeHandlerTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryDisabledTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ServerLoggingTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync and updates fixture base ctor.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NoBannerTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NativeAotTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Test.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Solution.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.GenerateEntryPoint.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.ConfigurationFile.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuild.KnownExtensionRegistration.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationFailingTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/IgnoreExitCodeTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceFixture.cs Removes creation/disposal of a temp .packages folder at assembly scope.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync and updates fixture base ctor.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpProcessTreeTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpOutputTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExitOnProcessExitTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionRequestCompleteTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/EnvironmentVariablesConfigurationProviderTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DataConsumerThroughputTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CustomBannerTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashPlusHangDumpTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ConsoleTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/AbortionTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WinUITests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ValueTaskTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TupleDynamicDataTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrxReportTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrimTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenExpiresTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenCanceledTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTestMethodTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutFromRunSettingsTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeTestMethodTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeCancellationTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadingTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsInheritanceTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestRunParametersTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestFilterTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SynchronizationContextTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ServerModeTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SdkTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STAThreadingTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTimeoutTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodCooperativeTimeoutTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTimeoutTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassCooperativeTimeoutTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunnerTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RetryTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PublishAotNonNativeTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PlaywrightSdkTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync and updates fixture base ctor.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedTestTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataSourceTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataRowTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/OutputTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/NativeAotTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MSBuildRunnerTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleWithParallelAttributesTaskThreadingTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesVoidThreadingTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesValueTaskThreadingTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesTaskThreadingTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LeakTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InconclusiveTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/IgnoreTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/GenericTestMethodTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/FrameworkOnlyTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DynamicDataMethodTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DuplicateTestClassAttributeTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DotnetTestCliTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeploymentItemTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeadlockTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DataSourceTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CustomAttributesTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationSettingsTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestV2SettingsTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestSettingsTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CancellationTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolverTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolutionTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyCleanupTests.cs Updates fixture base constructor usage to the parameterless base.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AspireSdkTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync and updates fixture base ctor.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AppDomainTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync and updates fixture base ctor.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AnalyzersTests.cs Removes explicit packages folder argument from DotnetCli.RunAsync.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AbortionTests.cs Updates fixture base constructor usage to the parameterless base.

Comment thread test/Utilities/Microsoft.Testing.TestInfrastructure/DotnetCli.cs
Comment thread test/Utilities/Microsoft.Testing.TestInfrastructure/TestAsset.cs
@Youssef1313 Youssef1313 changed the title Use global NuGet cache in acceptance integration tests Simplfy NuGet cache folder handling in integration tests Mar 24, 2026
@Youssef1313 Youssef1313 marked this pull request as ready for review March 24, 2026 13:02
Copilot AI review requested due to automatic review settings March 24, 2026 13:02
@Youssef1313
Copy link
Copy Markdown
Member Author

@Evangelink I'm now setting NUGET_PACKAGES env variable in assembly initialize. Does that address your concern?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 119 out of 119 changed files in this pull request and generated 5 comments.

Comment thread test/Performance/MSTest.Performance.Runner/Steps/DotnetTrace.cs
Comment thread test/Performance/MSTest.Performance.Runner/Steps/DotnetMuxer.cs
Copilot AI review requested due to automatic review settings March 26, 2026 16:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 120 out of 120 changed files in this pull request and generated 3 comments.

Comment thread test/Utilities/Automation.CLI/VSTestConsoleLocator.cs
Copilot AI review requested due to automatic review settings April 15, 2026 16:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 119 out of 119 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

test/Utilities/Automation.CLI/VSTestConsoleLocator.cs:1

  • When NUGET_PACKAGES is set but the specific package/version folder does not exist yet, this code silently falls back to the user-profile global cache. That undermines the goal of centralized, per-run caching and can mask problems by picking up stale packages from the machine cache. Prefer to not fall back when NUGET_PACKAGES is set; instead return the expected path under NUGET_PACKAGES (even if it doesn't exist yet) and let the existing error path report that it's missing, or explicitly throw/assert that the package path must exist under the overridden cache.
    test/Utilities/Automation.CLI/VSTestConsoleLocator.cs:1
  • This helper now returns a full package path (root + packageName + version), not a NuGet 'package folder' root. Renaming to something like GetNugetPackagePath (or adjusting implementation to return the root folder and letting the caller append package/version) would avoid confusion and reduce the chance of incorrect future reuse.
    test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceFixture.cs:1
  • Cleanup only swallows IOException. Directory.Delete(..., recursive: true) can also throw UnauthorizedAccessException (and other exceptions) depending on file locks/ACLs, which would fail the entire test assembly cleanup. Consider broadening the handled exceptions (at minimum UnauthorizedAccessException) and/or implementing a small retry/backoff before giving up, and optionally clearing NUGET_PACKAGES back to its prior value to avoid leaking state if other assemblies run in the same process.

Copilot AI review requested due to automatic review settings April 15, 2026 20:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 121 out of 121 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (6)

test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceFixture.cs:1

  • MSTest's [AssemblyCleanup] typically requires a parameterless static method. If the framework doesn't recognize this signature, cleanup won't run (and the per-run .packages folder will leak). Consider changing it back to public static void AssemblyCleanup() (or an async-returning equivalent supported by MSTest) and move any needed state into captured fields.
    test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceFixture.cs:1
  • The code sets NUGET_PACKAGES unconditionally but doesn't restore any previous value. If multiple test assemblies execute in the same process, this can leak configuration across assemblies. Consider capturing the previous NUGET_PACKAGES value during AssemblyInitialize and restoring/unsetting it during AssemblyCleanup.
    test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceFixture.cs:1
  • The code sets NUGET_PACKAGES unconditionally but doesn't restore any previous value. If multiple test assemblies execute in the same process, this can leak configuration across assemblies. Consider capturing the previous NUGET_PACKAGES value during AssemblyInitialize and restoring/unsetting it during AssemblyCleanup.
    test/Utilities/Automation.CLI/VSTestConsoleLocator.cs:1
  • If NUGET_PACKAGES is set but the specific package/version folder isn't present yet, this silently falls back to the user-profile cache. That undermines isolation (and can pick up a different version than the one restored into the configured cache). If NUGET_PACKAGES is present, consider treating it as authoritative: return the computed fullPackagePath (and let callers fail with a clear error), or assert/throw if the package isn't found there.
    test/Utilities/Automation.CLI/VSTestConsoleLocator.cs:1
  • This method now returns a specific package path (it combines packageName and packageVersion) rather than a NuGet packages folder root. Renaming it to something like GetNugetPackagePath (or adjusting it to return only the root folder) would make the contract clearer.
    test/Performance/MSTest.Performance.Runner/Steps/DotnetTrace.cs:1
  • The PR title/description focuses on integration tests, but this change also affects the performance runner by removing the per-asset .packages restore folder, which can change tool/package caching behavior across runs/machines. Either update the PR description/title to reflect the broader scope, or keep the previous isolated packages behavior for performance steps (e.g., by setting NUGET_PACKAGES via environmentVariables for these calls).

Copilot AI review requested due to automatic review settings April 16, 2026 05:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 121 out of 121 changed files in this pull request and generated 3 comments.

Comment thread test/Utilities/Microsoft.Testing.TestInfrastructure/TestAsset.cs
Copy link
Copy Markdown
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup! Removing the per-call nugetGlobalPackagesFolder plumbing from ~100+ files in favor of a centralized NUGET_PACKAGES env var is a welcome simplification. The randomized cache per run to avoid stale packages is well-motivated.

Main concerns:

  1. Scope of NUGET_PACKAGES setupAcceptanceFixture only covers one test assembly. Other assemblies using TestAssetFixtureBase (e.g., MSTest.Acceptance.IntegrationTests, perf runner) need equivalent setup, or they lose hermeticity.

  2. Cleanup robustnessDirectory.Delete cleanup catches only IOException; UnauthorizedAccessException (read-only files) can also occur and would fail the test run.

  3. Orphaned directories — Cleanup deletes .packages but not the parent <RandomId>/ directory.

  4. VSTestConsoleLocator silent fallback — When NUGET_PACKAGES is set but the package isn't there, silently falling back to %USERPROFILE%\.nuget\packages can mask real issues.

  5. PackageDownload for Microsoft.TestPlatform — Added in AppDomainTests but may be needed in other .NET Framework + UseVSTest assets too.

  6. Inconsistent constructor syntax — Mix of TestAssetFixture : TestAssetFixtureBase vs TestAssetFixture() : TestAssetFixtureBase().

Also, minor nit: PR title "Simplfy" → "Simplify".

Comment thread test/Utilities/Automation.CLI/VSTestConsoleLocator.cs
Comment thread test/Performance/MSTest.Performance.Runner/Steps/DotnetTrace.cs
Copilot AI review requested due to automatic review settings April 16, 2026 08:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 121 out of 121 changed files in this pull request and generated 4 comments.

Comment thread test/Utilities/Automation.CLI/VSTestConsoleLocator.cs
Comment thread test/Performance/MSTest.Performance.Runner/Steps/DotnetTrace.cs
Copilot AI review requested due to automatic review settings April 16, 2026 09:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 121 out of 121 changed files in this pull request and generated 1 comment.

@Youssef1313 Youssef1313 enabled auto-merge (squash) April 16, 2026 14:34
@Youssef1313 Youssef1313 merged commit 20b2f10 into main Apr 16, 2026
14 checks passed
@Youssef1313 Youssef1313 deleted the dev/ygerges/use-global-cache branch April 16, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants