-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When time increases by a digit, overwrite NodeStatus (#9563)
Fixes #9562 by triggering a full-line redraw when the length of the duration string increases.
- Loading branch information
1 parent
40f51a5
commit a1ad6b8
Showing
46 changed files
with
274 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Microsoft.Build.Logging.TerminalLogger; | ||
|
||
namespace Microsoft.Build.CommandLine.UnitTests; | ||
|
||
internal sealed class MockStopwatch : StopwatchAbstraction | ||
{ | ||
public override double ElapsedSeconds | ||
{ | ||
get | ||
{ | ||
return _elapsed; | ||
} | ||
} | ||
|
||
public override void Start() | ||
{ | ||
IsStarted = true; | ||
Tick(); | ||
} | ||
|
||
public override void Stop() => IsStarted = false; | ||
|
||
public bool IsStarted { get; private set; } | ||
|
||
private double _elapsed = 0d; | ||
|
||
public void Tick(double seconds = 0.1) | ||
{ | ||
_elapsed += seconds; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...ld.UnitTests/Snapshots/TerminalLogger_Tests.DisplayNodesOverwritesTime.Linux.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
]9;4;3;\[?25l[1F | ||
project [120G[14DBuild (111.2s) | ||
[?25h |
3 changes: 3 additions & 0 deletions
3
...uild.UnitTests/Snapshots/TerminalLogger_Tests.DisplayNodesOverwritesTime.OSX.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[?25l[1F | ||
project [120G[14DBuild (111.2s) | ||
[?25h |
3 changes: 3 additions & 0 deletions
3
....UnitTests/Snapshots/TerminalLogger_Tests.DisplayNodesOverwritesTime.Windows.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
]9;4;3;\[?25l[1F | ||
project [120G[14DBuild (111.2s) | ||
[?25h |
4 changes: 2 additions & 2 deletions
4
...hots/TerminalLogger_Tests.DisplayNodesOverwritesWithNewTargetFramework.Linux.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
]9;4;3;\[?25l[1F | ||
project [36;1mtfName[m [120G[12DBuild (0.0s) | ||
project [36;1mtfName[m [120G[12DBuild (0.2s) | ||
[?25h[?25l[2F | ||
[K project [36;1mtf2[m [120G[12DBuild (0.0s) | ||
[K project [36;1mtf2[m [120G[12DBuild (0.2s) | ||
[?25h |
4 changes: 2 additions & 2 deletions
4
...pshots/TerminalLogger_Tests.DisplayNodesOverwritesWithNewTargetFramework.OSX.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[?25l[1F | ||
project [36;1mtfName[m [120G[12DBuild (0.0s) | ||
project [36;1mtfName[m [120G[12DBuild (0.2s) | ||
[?25h[?25l[2F | ||
[K project [36;1mtf2[m [120G[12DBuild (0.0s) | ||
[K project [36;1mtf2[m [120G[12DBuild (0.2s) | ||
[?25h |
4 changes: 2 additions & 2 deletions
4
...ts/TerminalLogger_Tests.DisplayNodesOverwritesWithNewTargetFramework.Windows.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
]9;4;3;\[?25l[1F | ||
project [36;1mtfName[m [120G[12DBuild (0.0s) | ||
project [36;1mtfName[m [120G[12DBuild (0.2s) | ||
[?25h[?25l[2F | ||
[K project [36;1mtf2[m [120G[12DBuild (0.0s) | ||
[K project [36;1mtf2[m [120G[12DBuild (0.2s) | ||
[?25h |
2 changes: 1 addition & 1 deletion
2
...uild.UnitTests/Snapshots/TerminalLogger_Tests.DisplayNodesShowsCurrent.Linux.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
]9;4;3;\[?25l[1F | ||
project [120G[12DBuild (0.0s) | ||
project [120G[12DBuild (0.2s) | ||
[?25h |
2 changes: 1 addition & 1 deletion
2
...SBuild.UnitTests/Snapshots/TerminalLogger_Tests.DisplayNodesShowsCurrent.OSX.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[?25l[1F | ||
project [120G[12DBuild (0.0s) | ||
project [120G[12DBuild (0.2s) | ||
[?25h |
2 changes: 1 addition & 1 deletion
2
...ld.UnitTests/Snapshots/TerminalLogger_Tests.DisplayNodesShowsCurrent.Windows.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
]9;4;3;\[?25l[1F | ||
project [120G[12DBuild (0.0s) | ||
project [120G[12DBuild (0.2s) | ||
[?25h |
2 changes: 1 addition & 1 deletion
2
...uild.UnitTests/Snapshots/TerminalLogger_Tests.PrintBuildSummary_Failed.Linux.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
]9;4;3;\[?25l[1F | ||
[?25h | ||
Build [31;1mfailed[m in 0.0s | ||
Build [31;1mfailed[m in 5.0s | ||
]9;4;0;\ |
2 changes: 1 addition & 1 deletion
2
...SBuild.UnitTests/Snapshots/TerminalLogger_Tests.PrintBuildSummary_Failed.OSX.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[?25l[1F | ||
[?25h | ||
Build [31;1mfailed[m in 0.0s | ||
Build [31;1mfailed[m in 5.0s |
2 changes: 1 addition & 1 deletion
2
...ld.UnitTests/Snapshots/TerminalLogger_Tests.PrintBuildSummary_Failed.Windows.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
]9;4;3;\[?25l[1F | ||
[?25h | ||
Build [31;1mfailed[m in 0.0s | ||
Build [31;1mfailed[m in 5.0s | ||
]9;4;0;\ |
4 changes: 2 additions & 2 deletions
4
...ests/Snapshots/TerminalLogger_Tests.PrintBuildSummary_FailedWithErrors.Linux.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
]9;4;3;\ project [31;1mfailed with errors[m (0.0s) | ||
]9;4;3;\ project [31;1mfailed with errors[m (0.2s) | ||
directory/[1mfile[m(1,2,3,4): [31;1merror[m [31;1mAA0000[m: Error! | ||
[?25l[1F | ||
[?25h | ||
Build [31;1mfailed with errors[m in 0.0s | ||
Build [31;1mfailed with errors[m in 5.0s | ||
]9;4;0;\ |
4 changes: 2 additions & 2 deletions
4
...tTests/Snapshots/TerminalLogger_Tests.PrintBuildSummary_FailedWithErrors.OSX.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
project [31;1mfailed with errors[m (0.0s) | ||
project [31;1mfailed with errors[m (0.2s) | ||
directory/[1mfile[m(1,2,3,4): [31;1merror[m [31;1mAA0000[m: Error! | ||
[?25l[1F | ||
[?25h | ||
Build [31;1mfailed with errors[m in 0.0s | ||
Build [31;1mfailed with errors[m in 5.0s |
4 changes: 2 additions & 2 deletions
4
...ts/Snapshots/TerminalLogger_Tests.PrintBuildSummary_FailedWithErrors.Windows.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
]9;4;3;\ project [31;1mfailed with errors[m (0.0s) | ||
]9;4;3;\ project [31;1mfailed with errors[m (0.2s) | ||
directory/[1mfile[m(1,2,3,4): [31;1merror[m [31;1mAA0000[m: Error! | ||
[?25l[1F | ||
[?25h | ||
Build [31;1mfailed with errors[m in 0.0s | ||
Build [31;1mfailed with errors[m in 5.0s | ||
]9;4;0;\ |
4 changes: 2 additions & 2 deletions
4
...Snapshots/TerminalLogger_Tests.PrintBuildSummary_SucceededWithWarnings.Linux.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
]9;4;3;\ project [33;1msucceeded with warnings[m (0.0s) | ||
]9;4;3;\ project [33;1msucceeded with warnings[m (0.2s) | ||
directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: Warning! | ||
[?25l[1F | ||
[?25h | ||
Build [33;1msucceeded with warnings[m in 0.0s | ||
Build [33;1msucceeded with warnings[m in 5.0s | ||
]9;4;0;\ |
4 changes: 2 additions & 2 deletions
4
...s/Snapshots/TerminalLogger_Tests.PrintBuildSummary_SucceededWithWarnings.OSX.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
project [33;1msucceeded with warnings[m (0.0s) | ||
project [33;1msucceeded with warnings[m (0.2s) | ||
directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: Warning! | ||
[?25l[1F | ||
[?25h | ||
Build [33;1msucceeded with warnings[m in 0.0s | ||
Build [33;1msucceeded with warnings[m in 5.0s |
4 changes: 2 additions & 2 deletions
4
...apshots/TerminalLogger_Tests.PrintBuildSummary_SucceededWithWarnings.Windows.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
]9;4;3;\ project [33;1msucceeded with warnings[m (0.0s) | ||
]9;4;3;\ project [33;1msucceeded with warnings[m (0.2s) | ||
directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: Warning! | ||
[?25l[1F | ||
[?25h | ||
Build [33;1msucceeded with warnings[m in 0.0s | ||
Build [33;1msucceeded with warnings[m in 5.0s | ||
]9;4;0;\ |
2 changes: 1 addition & 1 deletion
2
...UnitTests/Snapshots/TerminalLogger_Tests.PrintImmediateMessage_Skipped.Linux.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
]9;4;3;\[?25l[1F | ||
[?25h | ||
Build [32;1msucceeded[m in 0.0s | ||
Build [32;1msucceeded[m in 5.0s | ||
]9;4;0;\ |
2 changes: 1 addition & 1 deletion
2
...d.UnitTests/Snapshots/TerminalLogger_Tests.PrintImmediateMessage_Skipped.OSX.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[?25l[1F | ||
[?25h | ||
Build [32;1msucceeded[m in 0.0s | ||
Build [32;1msucceeded[m in 5.0s |
2 changes: 1 addition & 1 deletion
2
...itTests/Snapshots/TerminalLogger_Tests.PrintImmediateMessage_Skipped.Windows.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
]9;4;3;\[?25l[1F | ||
[?25h | ||
Build [32;1msucceeded[m in 0.0s | ||
Build [32;1msucceeded[m in 5.0s | ||
]9;4;0;\ |
2 changes: 1 addition & 1 deletion
2
...UnitTests/Snapshots/TerminalLogger_Tests.PrintImmediateMessage_Success.Linux.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
]9;4;3;\The plugin credential provider could not acquire credentials.Authentication may require manual action. Consider re-running the command with --interactive for `dotnet`, /p:NuGetInteractive="true" for MSBuild or removing the -NonInteractive switch for `NuGet` | ||
[?25l[1F | ||
[?25h | ||
Build [32;1msucceeded[m in 0.0s | ||
Build [32;1msucceeded[m in 5.0s | ||
]9;4;0;\ |
2 changes: 1 addition & 1 deletion
2
...d.UnitTests/Snapshots/TerminalLogger_Tests.PrintImmediateMessage_Success.OSX.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
The plugin credential provider could not acquire credentials.Authentication may require manual action. Consider re-running the command with --interactive for `dotnet`, /p:NuGetInteractive="true" for MSBuild or removing the -NonInteractive switch for `NuGet` | ||
[?25l[1F | ||
[?25h | ||
Build [32;1msucceeded[m in 0.0s | ||
Build [32;1msucceeded[m in 5.0s |
2 changes: 1 addition & 1 deletion
2
...itTests/Snapshots/TerminalLogger_Tests.PrintImmediateMessage_Success.Windows.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
]9;4;3;\The plugin credential provider could not acquire credentials.Authentication may require manual action. Consider re-running the command with --interactive for `dotnet`, /p:NuGetInteractive="true" for MSBuild or removing the -NonInteractive switch for `NuGet` | ||
[?25l[1F | ||
[?25h | ||
Build [32;1msucceeded[m in 0.0s | ||
Build [32;1msucceeded[m in 5.0s | ||
]9;4;0;\ |
4 changes: 2 additions & 2 deletions
4
.../Snapshots/TerminalLogger_Tests.PrintImmediateWarningMessage_Succeeded.Linux.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
]9;4;3;\directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: [CredentialProvider]DeviceFlow: https://testfeed/index.json | ||
directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: [CredentialProvider]ATTENTION: User interaction required.**********************************************************************To sign in, use a web browser to open the page https://devicelogin and enter the code XXXXXX to authenticate.********************************************************************** | ||
project [33;1msucceeded with warnings[m (0.0s) | ||
project [33;1msucceeded with warnings[m (0.2s) | ||
directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: [CredentialProvider]DeviceFlow: https://testfeed/index.json | ||
directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: [CredentialProvider]ATTENTION: User interaction required.**********************************************************************To sign in, use a web browser to open the page https://devicelogin and enter the code XXXXXX to authenticate.********************************************************************** | ||
[?25l[1F | ||
[?25h | ||
Build [33;1msucceeded with warnings[m in 0.0s | ||
Build [33;1msucceeded with warnings[m in 5.0s | ||
]9;4;0;\ |
4 changes: 2 additions & 2 deletions
4
...ts/Snapshots/TerminalLogger_Tests.PrintImmediateWarningMessage_Succeeded.OSX.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: [CredentialProvider]DeviceFlow: https://testfeed/index.json | ||
directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: [CredentialProvider]ATTENTION: User interaction required.**********************************************************************To sign in, use a web browser to open the page https://devicelogin and enter the code XXXXXX to authenticate.********************************************************************** | ||
project [33;1msucceeded with warnings[m (0.0s) | ||
project [33;1msucceeded with warnings[m (0.2s) | ||
directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: [CredentialProvider]DeviceFlow: https://testfeed/index.json | ||
directory/[1mfile[m(1,2,3,4): [33;1mwarning[m [33;1mAA0000[m: [CredentialProvider]ATTENTION: User interaction required.**********************************************************************To sign in, use a web browser to open the page https://devicelogin and enter the code XXXXXX to authenticate.********************************************************************** | ||
[?25l[1F | ||
[?25h | ||
Build [33;1msucceeded with warnings[m in 0.0s | ||
Build [33;1msucceeded with warnings[m in 5.0s |
Oops, something went wrong.