Skip to content

Commit f2cf1d5

Browse files
committed
Remove RunSettingsFilePath support from dotnet test for MTP
1 parent 5ac3352 commit f2cf1d5

8 files changed

+5
-21
lines changed

src/Cli/dotnet/commands/dotnet-test/CliConstants.cs

-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ internal static class CliConstants
4141

4242
public const string BinLogFileName = "msbuild.binlog";
4343

44-
public const string TestingPlatformVsTestBridgeRunSettingsFileEnvVar = "TESTINGPLATFORM_VSTESTBRIDGE_RUNSETTINGS_FILE";
4544
public const string DLLExtension = ".dll";
4645

4746
public const string MTPTarget = "_MTPBuild";
@@ -91,7 +90,6 @@ internal static class ProjectProperties
9190
internal const string TargetFrameworks = "TargetFrameworks";
9291
internal const string TargetPath = "TargetPath";
9392
internal const string ProjectFullPath = "MSBuildProjectFullPath";
94-
internal const string RunSettingsFilePath = "RunSettingsFilePath";
9593
internal const string RunCommand = "RunCommand";
9694
internal const string RunArguments = "RunArguments";
9795
internal const string RunWorkingDirectory = "RunWorkingDirectory";

src/Cli/dotnet/commands/dotnet-test/IPC/Models/ModuleMessage.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
namespace Microsoft.DotNet.Tools.Test;
55

6-
internal sealed record ModuleMessage(string? DllOrExePath, string? ProjectPath, string? TargetFramework, string? RunSettingsFilePath, string IsTestingPlatformApplication) : IRequest;
6+
internal sealed record ModuleMessage(string? DllOrExePath, string? ProjectPath, string? TargetFramework, string IsTestingPlatformApplication) : IRequest;

src/Cli/dotnet/commands/dotnet-test/IPC/Serializers/ModuleMessageSerializer.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ public object Deserialize(Stream stream)
1212
string modulePath = ReadString(stream);
1313
string projectPath = ReadString(stream);
1414
string targetFramework = ReadString(stream);
15-
string runSettingsFilePath = ReadString(stream);
1615
string isTestingPlatformApplication = ReadString(stream);
17-
return new ModuleMessage(modulePath.Trim(), projectPath.Trim(), targetFramework.Trim(), runSettingsFilePath.Trim(), isTestingPlatformApplication.Trim());
16+
return new ModuleMessage(modulePath.Trim(), projectPath.Trim(), targetFramework.Trim(), isTestingPlatformApplication.Trim());
1817
}
1918

2019
public void Serialize(object objectToSerialize, Stream stream)
2120
{
2221
WriteString(stream, ((ModuleMessage)objectToSerialize).DllOrExePath);
2322
WriteString(stream, ((ModuleMessage)objectToSerialize).ProjectPath);
2423
WriteString(stream, ((ModuleMessage)objectToSerialize).TargetFramework);
25-
WriteString(stream, ((ModuleMessage)objectToSerialize).RunSettingsFilePath);
2624
WriteString(stream, ((ModuleMessage)objectToSerialize).IsTestingPlatformApplication);
2725
}
2826
}

src/Cli/dotnet/commands/dotnet-test/MSBuildHandler.cs

-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ private void LogProjectProperties(IEnumerable<TestModule> modules)
162162
logMessageBuilder.AppendLine($"{ProjectProperties.RunCommand}: {module.RunProperties.RunCommand}");
163163
logMessageBuilder.AppendLine($"{ProjectProperties.RunArguments}: {module.RunProperties.RunArguments}");
164164
logMessageBuilder.AppendLine($"{ProjectProperties.RunWorkingDirectory}: {module.RunProperties.RunWorkingDirectory}");
165-
logMessageBuilder.AppendLine($"{ProjectProperties.RunSettingsFilePath}: {module.RunSettingsFilePath}");
166165
logMessageBuilder.AppendLine();
167166
}
168167

src/Cli/dotnet/commands/dotnet-test/Models.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Microsoft.DotNet.Cli;
55

6-
internal sealed record TestModule(RunProperties RunProperties, string? ProjectFullPath, string? TargetFramework, string? RunSettingsFilePath, bool IsTestingPlatformApplication, bool IsTestProject);
6+
internal sealed record TestModule(RunProperties RunProperties, string? ProjectFullPath, string? TargetFramework, bool IsTestingPlatformApplication, bool IsTestProject);
77

88
internal sealed record Handshake(Dictionary<byte, string>? Properties);
99

src/Cli/dotnet/commands/dotnet-test/SolutionAndProjectUtility.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,8 @@ public static IEnumerable<TestModule> GetProjectProperties(string projectFilePat
163163
string targetFramework = project.GetPropertyValue(ProjectProperties.TargetFramework);
164164
RunProperties runProperties = GetRunProperties(project, loggers);
165165
string projectFullPath = project.GetPropertyValue(ProjectProperties.ProjectFullPath);
166-
string runSettingsFilePath = project.GetPropertyValue(ProjectProperties.RunSettingsFilePath);
167166

168-
return new TestModule(runProperties, PathUtility.FixFilePath(projectFullPath), targetFramework, runSettingsFilePath, isTestingPlatformApplication, isTestProject);
167+
return new TestModule(runProperties, PathUtility.FixFilePath(projectFullPath), targetFramework, isTestingPlatformApplication, isTestProject);
169168

170169
static RunProperties GetRunProperties(ProjectInstance project, ICollection<ILogger>? loggers)
171170
{

src/Cli/dotnet/commands/dotnet-test/TestApplication.cs

-10
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ private ProcessStartInfo CreateProcessStartInfo(bool isDll, TestOptions testOpti
7979
processStartInfo.WorkingDirectory = _module.RunProperties.RunWorkingDirectory;
8080
}
8181

82-
AddRunSettingsFileToEnvironment(processStartInfo);
83-
8482
return processStartInfo;
8583
}
8684

@@ -99,14 +97,6 @@ private string GetArguments(TestOptions testOptions, bool isDll)
9997
return BuildArgsWithDotnetRun(testOptions);
10098
}
10199

102-
private void AddRunSettingsFileToEnvironment(ProcessStartInfo processStartInfo)
103-
{
104-
if (!string.IsNullOrEmpty(_module.RunSettingsFilePath))
105-
{
106-
processStartInfo.EnvironmentVariables.Add(CliConstants.TestingPlatformVsTestBridgeRunSettingsFileEnvVar, _module.RunSettingsFilePath);
107-
}
108-
}
109-
110100
private static bool IsArchitectureSpecified(TestOptions testOptions)
111101
{
112102
return !string.IsNullOrEmpty(testOptions.Architecture);

src/Cli/dotnet/commands/dotnet-test/TestModulesFilterHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public bool RunWithTestModulesFilter(ParseResult parseResult, BuildOptions build
5353

5454
foreach (string testModule in testModulePaths)
5555
{
56-
var testApp = new TestApplication(new TestModule(new RunProperties(testModule, null, null), null, null, null, true, true), buildOptions);
56+
var testApp = new TestApplication(new TestModule(new RunProperties(testModule, null, null), null, null, true, true), buildOptions);
5757
// Write the test application to the channel
5858
_actionQueue.Enqueue(testApp);
5959
}

0 commit comments

Comments
 (0)