From 4140827b7f3d1595f1ae3aff54f1f4668c3e4a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Fri, 15 Mar 2024 08:28:21 +0100 Subject: [PATCH] Add test name to MSBuild where we have frame. (#4935) --- src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs b/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs index f0f01d3dae..c9dff0acfe 100644 --- a/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs +++ b/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs @@ -201,7 +201,8 @@ protected override void LogEventsFromTextOutput(string singleLine, MessageImport var lineNumber = 0; var _ = !StringUtils.IsNullOrWhiteSpace(place) && int.TryParse(line, out lineNumber); - string? singleLineError = JoinSingleLineAndShorten(place, fullErrorMessage); + string? nameAndPlace = place == displayName ? place : $"{displayName}: {place}"; + string? singleLineError = JoinSingleLineAndShorten(nameAndPlace, fullErrorMessage); file ??= string.Empty;