Skip to content

Commit ffa120c

Browse files
committed
Improved summary output
1 parent 5b1875c commit ffa120c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CompuMaster.TaskManagement/ProgressingTaskItem.vb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ Public Class ProgressingTaskItem
478478
If CurrentStep.EstimatedTimeToRun.HasValue Then Result.AppendLine("* Estimated time: " & CurrentStep.EstimatedTimeToRun.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture))
479479
If CurrentStep.ConsumedTime.HasValue Then Result.AppendLine("* Consumed time: " & CurrentStep.ConsumedTime.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture))
480480
If Not CurrentStep.EstimatedTimeToRun.HasValue AndAlso Not CurrentStep.ConsumedTime.HasValue Then Result.AppendLine("* No time information available")
481+
Select Case CurrentStep.Status
482+
Case ProgressingTaskStepStatus.Failed
483+
Result.AppendLine("* Step failed: " & Tools.IndentStringStartingWith2ndLine(CurrentStep.FoundException.Message, 2, System.Environment.NewLine))
484+
End Select
481485
Next
482486
Return Result.ToString
483487
End Function
@@ -605,8 +609,11 @@ Public Class ProgressingTaskItem
605609
Dim Result As New System.Text.StringBuilder
606610
Result.Append(Me.LoggedExceptionsToPlainText(fullLength)) 'either empty or contains exceptions with line-break after last exception
607611
If Result.Length <> 0 Then Result.AppendLine()
608-
Result.Append(CollectedWarningsText) 'either empty or contains warnings with line-break at end of last warning
609-
If Result.Length <> 0 Then Result.AppendLine()
612+
Dim Warnings = CollectedWarningsText()
613+
If Warnings <> Nothing Then
614+
Result.Append(CollectedWarningsText) 'either empty or contains warnings with line-break at end of last warning
615+
If Result.Length <> 0 Then Result.AppendLine()
616+
End If
610617
Result.Append(Me.ConsumedTimeStatisticsInfo(fullLength)) 'always contains some lines and line-break at last line
611618
Return Result.ToString
612619
End Function

CompuMaster.Test.TaskManagement/TaskBundleRunBehaviourTest.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Namespace CompuMaster.Test.TaskManagement
9494
Dim TaskBundle As ProgressingTaskBundle
9595
TaskBundle = DummyTaskBundlesExtended.DummyTaskBundleFailingStepActionWithFailAction(Function()
9696
'Catched exception failure - LogAndContinue
97-
Return New ProgressingTaskStepDynamicFailAction(New CustomException("Failure-Test in Dummy"), ProgressingTaskStepBase.ProgressingTaskStepFailAction.LogExceptionAndContinue)
97+
Return New ProgressingTaskStepDynamicFailAction(New CustomException("Failure-Test in Dummy" & System.Environment.NewLine & "with a 2nd line in exception message"), ProgressingTaskStepBase.ProgressingTaskStepFailAction.LogExceptionAndContinue)
9898
End Function)
9999
Assert.Catch(Of AggregateException)(Sub() TaskBundle.RunAllTasks())
100100
System.Console.WriteLine(TaskBundle.DisplaySummary)
@@ -111,7 +111,7 @@ Namespace CompuMaster.Test.TaskManagement
111111
Dim TaskBundle As ProgressingTaskBundle
112112
TaskBundle = DummyTaskBundlesExtended.DummyTaskBundleFailingStepActionWithFailAction(Function()
113113
'Catched exception failure - Throw
114-
Return New ProgressingTaskStepDynamicFailAction(New CustomException("Failure-Test in Dummy"), ProgressingTaskStepBase.ProgressingTaskStepFailAction.ThrowException)
114+
Return New ProgressingTaskStepDynamicFailAction(New CustomException("Failure-Test in Dummy" & System.Environment.NewLine & "with a 2nd line in exception message"), ProgressingTaskStepBase.ProgressingTaskStepFailAction.ThrowException)
115115
End Function)
116116
Assert.Catch(Of AggregateException)(Sub() TaskBundle.RunAllTasks())
117117
System.Console.WriteLine(TaskBundle.DisplaySummary)

0 commit comments

Comments
 (0)