Add Duration property to HistoryInfo#5208
Conversation
|
Not really sure what to test. Testing public TimeSpan Duration => EndExecutionTime - StartExecutionTime; will hardly give a lot. |
|
|
@powercode Please resolve merge conflicts. |
a4e8808 to
f0674cc
Compare
|
@vors You were so right. Added tests and fixed bugs |
There was a problem hiding this comment.
@SteveL-MSFT @PaulHigin Does this not break remoting?
There was a problem hiding this comment.
There's a specific list of types and HistoryInfo isn't in that list
There was a problem hiding this comment.
These tests are very similar. Please use -TestCases.
There was a problem hiding this comment.
Minor comment - should we follow ToString() and use ToDurationString() for public?
There was a problem hiding this comment.
Yes, or Tostring(string). Thought about that a bit also, but never reach any real conclusion.
There was a problem hiding this comment.
Should we remove the test?
There was a problem hiding this comment.
TimeSeparator can be culture sensitive. Could you please use TimeSpan constructor for duration?
Also in C# $@"{duration:d\.hh\:mm\:ss}"; should we be culture sensitive too?
There was a problem hiding this comment.
We keep the implementation as it is.
Closed.
|
We're not holding the RC for this PR, if it makes it in soon, great! If not, it'll catch the next release. |
|
@SteveL-MSFT will it merge this time? |
|
We have only one open comment about |
|
I have looked a bit on how PowerShell treats timespans in other cases, and it seems to use the default formatting, which is not culture sensitive. |
|
@powercode please resolve conflicts. |
601c66c to
89ca944
Compare
|
@SteveL-MSFT @daxian-dbw Have you any thoughts about the PR? |
SteveL-MSFT
left a comment
There was a problem hiding this comment.
Regarding GetDurationString() vs ToDurationString(), looking in PS code, it seems Get*String() is used (although internal methods). I'm fine keeping GetDurationString() unless someone can point to some guidance otherwise.
|
@TravisEz13 @daxian-dbw Have you any thoughts about |
This adds the property ExecutionTime to the table view
Renaming GetExecutionTimeString() -> GetDurationString()
|
These build errors are not related to my changes. Can anyone restart the build here? |
|
Reopen the PR to restart CIs. |
Changes were recommended after approval
|
@powercode Is the PR ready for review? |
|
Yes |
|
@daxian-dbw @SteveL-MSFT @BrucePay Please review the PR. |
TravisEz13
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r4, 1 of 2 files at r5.
Reviewable status:complete! all files reviewed
There was a problem hiding this comment.
Seems like this test should just get the first item from item from Get-History and validate that Duration = End - Start?
There was a problem hiding this comment.
@SteveL-MSFT Am I guaranteed to have something in the history at that moment?
There was a problem hiding this comment.
@powercode Sorry I lost the PR. Please fix Be -> -Be and we ready to merge.
|
@powercode Thank you for the contribution! Sorry for delay. |
Fixes #4181
Adding a property Duration to HistoryInfo to end the
{$_.EndExecutionTime - $_.StartExecutionTime}madness :)This change is