Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ private object ProcessValue(object obj, int depth)
else
{
TypeInfo t = obj.GetType().GetTypeInfo();
WriteVerbose(StringUtil.Format(UtilityCommonStrings.ConvertToJsonProcessValueVerboseMessage, t.Name, depth));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem like the right fix to me. The verbose message was removed for a reason. If a test depended on the verbose message, then it (the test) should be removed or re-written.

Copy link
Contributor Author

@xtqqczze xtqqczze Jan 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the test could be rewritten not to depend on the verbose output. This could be part of WIP #8593 . This PR fixes the test before further changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just temporarily disable the test until #8593 is complete. It seems wrong to revert a previously approved change without good cause.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be best to use an InternalTestHook to get the cmdlet to write the VerboseMessage if the message is not useful outside of the test


if (t.IsPrimitive)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,7 @@
<data name="InvalidSDDL" xml:space="preserve">
<value>Cannot construct a security descriptor from the given SDDL due to the following error: {0}</value>
</data>
<data name="ConvertToJsonProcessValueVerboseMessage" xml:space="preserve">
<value>Processing object of type [{0}] at depth {1}</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Describe 'ConvertTo-Json' -tags "CI" {
})
$null = $ps.BeginInvoke()
# wait for verbose message from ConvertTo-Json to ensure cmdlet is processing
Wait-UntilTrue { $ps.Streams.Verbose.Count -gt 0 }
Wait-UntilTrue { $ps.Streams.Verbose.Count -gt 0 } | Should -BeTrue
$null = $ps.BeginStop($null, $null)
# wait a bit to ensure state has changed, not using synchronous Stop() to avoid blocking Pester
Start-Sleep -Milliseconds 100
Expand Down