Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix CommandLine usage in AppDomainTests
Co-authored-by: Youssef1313 <[email protected]>
  • Loading branch information
Copilot and Youssef1313 committed Nov 7, 2025
commit b78d4c95fa2f4564e191fe39950dc36c5d74329a
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.MSTestV2.CLIAutomation;
using Microsoft.Testing.Platform.Acceptance.IntegrationTests;
using Microsoft.Testing.Platform.Acceptance.IntegrationTests.Helpers;
using Microsoft.Testing.TestInfrastructure;

namespace MSTest.Acceptance.IntegrationTests;

Expand Down Expand Up @@ -158,7 +159,7 @@ public async Task RunTests_With_VSTestConsole_Directly(bool? disableAppDomain)

// Run tests using vstest.console.exe directly
string vstestConsolePath = VSTestConsoleLocator.GetConsoleRunnerPath();
string arguments = $"\"{vstestConsolePath}\" \"{dllPath}\"";
string arguments = $"\"{dllPath}\"";
if (!string.IsNullOrEmpty(runSettings))
{
string runSettingsPath = Path.Combine(testAsset.TargetAssetPath, "test.runsettings");
Expand All @@ -168,7 +169,7 @@ public async Task RunTests_With_VSTestConsole_Directly(bool? disableAppDomain)

using var commandLine = new CommandLine();
int exitCode = await commandLine.RunAsyncAndReturnExitCodeAsync(
arguments,
$"\"{vstestConsolePath}\" {arguments}",
workingDirectory: testAsset.TargetAssetPath,
cancellationToken: TestContext.CancellationToken);

Expand Down Expand Up @@ -211,7 +212,7 @@ public async Task DiscoverTests_With_VSTestConsole_Directly(bool? disableAppDoma

// Run discovery using vstest.console.exe directly
string vstestConsolePath = VSTestConsoleLocator.GetConsoleRunnerPath();
string arguments = $"\"{vstestConsolePath}\" \"{dllPath}\" /ListTests";
string arguments = $"\"{dllPath}\" /ListTests";
if (!string.IsNullOrEmpty(runSettings))
{
string runSettingsPath = Path.Combine(testAsset.TargetAssetPath, "test.runsettings");
Expand All @@ -221,7 +222,7 @@ public async Task DiscoverTests_With_VSTestConsole_Directly(bool? disableAppDoma

using var commandLine = new CommandLine();
int exitCode = await commandLine.RunAsyncAndReturnExitCodeAsync(
arguments,
$"\"{vstestConsolePath}\" {arguments}",
workingDirectory: testAsset.TargetAssetPath,
cancellationToken: TestContext.CancellationToken);

Expand Down
Loading