Skip to content

Commit f9c489c

Browse files
committed
Progress
1 parent d01514c commit f9c489c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/Cli/dotnet/Commands/Test/Models.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public bool MoveNext()
111111
}
112112
}
113113

114-
internal sealed record TestModule(RunProperties RunProperties, string? ProjectFullPath, string? TargetFramework, bool IsTestingPlatformApplication, bool IsTestProject, ProjectLaunchSettingsModel? LaunchSettings);
114+
115+
internal sealed record TestModule(RunProperties RunProperties, string? ProjectFullPath, string? TargetFramework, bool IsTestingPlatformApplication, bool IsTestProject, ProjectLaunchSettingsModel? LaunchSettings, string TargetPath);
115116

116117
internal sealed record Handshake(Dictionary<byte, string>? Properties);
117118

src/Cli/dotnet/Commands/Test/SolutionAndProjectUtility.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public static IEnumerable<ParallelizableTestModuleGroupWithSequentialInnerModule
246246
// TODO: Support --launch-profile and pass it here.
247247
var launchSettings = TryGetLaunchProfileSettings(Path.GetDirectoryName(projectFullPath)!, project.GetPropertyValue(ProjectProperties.AppDesignerFolder), noLaunchProfile, profileName: null);
248248

249-
return new TestModule(runProperties, PathUtility.FixFilePath(projectFullPath), targetFramework, isTestingPlatformApplication, isTestProject, launchSettings);
249+
return new TestModule(runProperties, PathUtility.FixFilePath(projectFullPath), targetFramework, isTestingPlatformApplication, isTestProject, launchSettings, project.GetPropertyValue(ProjectProperties.TargetPath));
250250

251251
static RunProperties GetRunProperties(ProjectInstance project, ICollection<ILogger>? loggers)
252252
{
@@ -258,8 +258,7 @@ static RunProperties GetRunProperties(ProjectInstance project, ICollection<ILogg
258258
{
259259
if (!project.Build(s_computeRunArgumentsTarget, loggers: loggers))
260260
{
261-
Logger.LogTrace(() => $"The target {s_computeRunArgumentsTarget} failed to build. Falling back to TargetPath.");
262-
return new RunProperties(project.GetPropertyValue(ProjectProperties.TargetPath), null, null);
261+
throw new GracefulException(CliCommandStrings.RunCommandEvaluationExceptionBuildFailed, s_computeRunArgumentsTarget);
263262
}
264263
}
265264

src/Cli/dotnet/Commands/Test/TestApplicationEventHandlers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void OnHandshakeReceived(object sender, HandshakeArgs args)
2626
var executionId = args.Handshake.Properties[HandshakeMessagePropertyNames.ExecutionId];
2727
var arch = args.Handshake.Properties[HandshakeMessagePropertyNames.Architecture]?.ToLower();
2828
var tfm = TargetFrameworkParser.GetShortTargetFramework(args.Handshake.Properties[HandshakeMessagePropertyNames.Framework]);
29-
(string ModulePath, string TargetFramework, string Architecture, string ExecutionId) appInfo = new(testApplication.Module.RunProperties.RunCommand, tfm, arch, executionId);
29+
(string ModulePath, string TargetFramework, string Architecture, string ExecutionId) appInfo = new(testApplication.Module.TargetPath, tfm, arch, executionId);
3030
_executions[testApplication] = appInfo;
3131
_output.AssemblyRunStarted(appInfo.ModulePath, appInfo.TargetFramework, appInfo.Architecture, appInfo.ExecutionId);
3232
}
@@ -147,7 +147,7 @@ public void OnTestProcessExited(object sender, TestProcessExitEventArgs args)
147147
}
148148
else
149149
{
150-
_output.AssemblyRunCompleted(testApplication.Module.RunProperties.RunCommand ?? testApplication.Module.ProjectFullPath, testApplication.Module.TargetFramework, architecture: null, null, args.ExitCode, string.Join(Environment.NewLine, args.OutputData), string.Join(Environment.NewLine, args.ErrorData));
150+
_output.AssemblyRunCompleted(testApplication.Module.TargetPath ?? testApplication.Module.ProjectFullPath, testApplication.Module.TargetFramework, architecture: null, null, args.ExitCode, string.Join(Environment.NewLine, args.OutputData), string.Join(Environment.NewLine, args.ErrorData));
151151
}
152152

153153
LogTestProcessExit(args);

src/Cli/dotnet/Commands/Test/TestModulesFilterHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public bool RunWithTestModulesFilter(ParseResult parseResult)
5555
? new RunProperties(muxerPath, $@"exec ""{testModule}""", null)
5656
: new RunProperties(testModule, null, null);
5757

58-
var testApp = new ParallelizableTestModuleGroupWithSequentialInnerModules(new TestModule(runProperties, null, null, true, true, null));
58+
var testApp = new ParallelizableTestModuleGroupWithSequentialInnerModules(new TestModule(runProperties, null, null, true, true, null, testModule));
5959
// Write the test application to the channel
6060
_actionQueue.Enqueue(testApp);
6161
}

0 commit comments

Comments
 (0)