Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4f83a4f

Browse files
committedMar 18, 2025·
Remove RunSettingsFilePath support from dotnet test for MTP
1 parent 5ac3352 commit 4f83a4f

8 files changed

+5
-18
lines changed
 

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

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ internal static class ProjectProperties
9191
internal const string TargetFrameworks = "TargetFrameworks";
9292
internal const string TargetPath = "TargetPath";
9393
internal const string ProjectFullPath = "MSBuildProjectFullPath";
94-
internal const string RunSettingsFilePath = "RunSettingsFilePath";
9594
internal const string RunCommand = "RunCommand";
9695
internal const string RunArguments = "RunArguments";
9796
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

-8
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,6 @@ private string GetArguments(TestOptions testOptions, bool isDll)
9999
return BuildArgsWithDotnetRun(testOptions);
100100
}
101101

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-
110102
private static bool IsArchitectureSpecified(TestOptions testOptions)
111103
{
112104
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)
Please sign in to comment.