Skip to content

Conversation

@daxian-dbw
Copy link
Member

Suppress expected errors from Select-Xml tests to reduce noises:

Describing XML cmdlets
   Context Select-XML
++++++
Select-XML : The file 'xmltestfile' cannot be read: Could not find file 'C:\projects\powershell-f975h\xmltestfile'.
At C:\projects\powershell-f975h\test\powershell\Modules\Microsoft.PowerShell.Utility\xml.tests.ps1:68 char:17
+                 Select-XML @params "Root" -ErrorVariable err
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (xmltestfile:String) [Select-Xml], ArgumentException
+ FullyQualifiedErrorId : ProcessingFile,Microsoft.PowerShell.Commands.SelectXmlCommand
 
+
Select-XML : Cannot open the file because the current provider (Microsoft.PowerShell.Core\Environment) cannot open files.
At C:\projects\powershell-f975h\test\powershell\Modules\Microsoft.PowerShell.Utility\xml.tests.ps1:68 char:17
+                 Select-XML @params "Root" -ErrorVariable err
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (env:xmltestfile:String) [Select-Xml], InvalidOperationException
+ FullyQualifiedErrorId : ProcessingFile,Microsoft.PowerShell.Commands.SelectXmlCommand
 
...

After the fix:

Describing XML cmdlets
   Context Select-XML
    [+] literalpath with relative paths 591ms
    [+] literalpath with absolute paths 82ms
    [+] literalpath with path with dots 11ms
    [+] path with relative paths 11ms
    [+] path with absolute paths 11ms
    [+] path with path with dots 13ms
    [+] Verifies a non filesystem path using literalPath should fail 46ms
    [+] Verifies a non filesystem path using path should fail 9ms
    [+] Invalid xml file 72ms
    [+] -xml works with inputstream 46ms
    [+] Returns error for invalid xmlnamespace 16ms
    [+] Returns error for invalid content 18ms
    [+] ToString() works correctly on nested node 15ms
    [+] ToString() works correctly with file 64ms
Tests completed in 1.01s
Passed: 14 Failed: 0 Skipped: 0 Pending: 0

@adityapatwardhan
Copy link
Member

@daxian-dbw Can you have a look at the failures?

@daxian-dbw
Copy link
Member Author

All failures are know issues:
Linux CI failure --> #5567
macOS CI failure --> #5590

Push-Location "$fileName\.."
"<Root>" | out-file -LiteralPath $fileName
" <Node Attribute='blah' />" | out-file -LiteralPath $fileName -Append
"</Root>" | out-file -LiteralPath $fileName -Append
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tabs?

Copy link
Member Author

Choose a reason for hiding this comment

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

It used to be tabs, and now is changed to spaces as in rest of the file.

@adityapatwardhan
Copy link
Member

@daxian-dbw Restarted Travis-CI.

@daxian-dbw
Copy link
Member Author

@adityapatwardhan CI builds have passed, can you please merge this PR?

@adityapatwardhan adityapatwardhan merged commit 3469d4b into PowerShell:master Dec 4, 2017
@daxian-dbw daxian-dbw deleted the supressXmlTestErrors branch December 4, 2017 22:44
@TravisEz13 TravisEz13 added this to the 6.0.0-RC.2 milestone Dec 5, 2017
TravisEz13 pushed a commit to TravisEz13/PowerShell that referenced this pull request Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants