Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 10 additions & 7 deletions src/Cli/dotnet/Commands/Test/MTP/Terminal/TerminalTestReporter.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Collections.Concurrent;
using Microsoft.TemplateEngine.Cli.Help;
using System.Globalization;
using System.Text.RegularExpressions;
using Microsoft.CodeAnalysis;
using Microsoft.Testing.Platform.OutputDevice.Terminal;
using Microsoft.DotNet.Cli.Commands.Test.IPC.Models;
using Microsoft.TemplateEngine.Cli.Help;
using Microsoft.Testing.Platform.OutputDevice.Terminal;

namespace Microsoft.DotNet.Cli.Commands.Test.Terminal;

Expand Down Expand Up @@ -397,7 +397,7 @@ internal void TestCompleted(
string displayName,
string? informativeMessage,
TestOutcome outcome,
TimeSpan duration,
TimeSpan? duration,
FlatException[]? exceptions,
string? expected,
string? actual,
Expand Down Expand Up @@ -458,7 +458,7 @@ internal void TestCompleted(
string displayName,
string? informativeMessage,
TestOutcome outcome,
TimeSpan duration,
TimeSpan? duration,
FlatException[]? flatExceptions,
string? expected,
string? actual,
Expand Down Expand Up @@ -496,9 +496,12 @@ internal void TestCompleted(
terminal.ResetColor();
terminal.Append(' ');
terminal.Append(displayName);
terminal.SetColor(TerminalColor.DarkGray);
terminal.Append(' ');
AppendLongDuration(terminal, duration);

if (duration.HasValue)
{
terminal.Append(' ');
AppendLongDuration(terminal, duration.Value);
}

if (!string.IsNullOrEmpty(informativeMessage))
{
Expand Down
4 changes: 2 additions & 2 deletions src/Cli/dotnet/Commands/Test/MTP/TestApplicationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ internal void OnTestResultsReceived(TestResultMessages testResultMessage)
testResult.DisplayName!,
testResult.Reason,
ToOutcome(testResult.State),
TimeSpan.FromTicks(testResult.Duration ?? 0),
testResult.Duration.HasValue ? TimeSpan.FromTicks(testResult.Duration.Value) : null,
exceptions: null,
expected: null,
actual: null,
Expand All @@ -158,7 +158,7 @@ internal void OnTestResultsReceived(TestResultMessages testResultMessage)
testResult.DisplayName!,
testResult.Reason,
ToOutcome(testResult.State),
TimeSpan.FromTicks(testResult.Duration ?? 0),
testResult.Duration.HasValue ? TimeSpan.FromTicks(testResult.Duration.Value) : null,
exceptions: [.. testResult.Exceptions!.Select(fe => new Terminal.FlatException(fe.ErrorMessage, fe.ErrorType, fe.StackTrace))],
expected: null,
actual: null,
Expand Down
Loading