equelin / Format-Pester

Powershell module for documenting Pester's results
MIT License
84 stars 8 forks source link

Try do Format-Pester usable on PowerShell Core too #35

Open it-praktyk opened 7 years ago

it-praktyk commented 7 years ago

The first try to run Format-Pester on Ubuntu Linux 16.04

Name                           Value                                                                   
----                           -----                                                                   
PSVersion                      6.0.0-beta                                                              
PSEdition                      Core                                                                    
GitCommitId                    v6.0.0-beta.3                                                           
OS                             Linux 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017      
Platform                       Unix                                                                    
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                 
PSRemotingProtocolVersion      2.3                                                                     
SerializationVersion           1.1.0.1                                                                 
WSManStackVersion              3.0     

The module is not correctly imported due to ... case sensitivity nature of Linux.

The names of modules in the module manifest need to be case sensitive. RequiredModules = @('pester','pscribo').

alagoutte commented 4 years ago

It is fixed with commit dad932f10df128cdf47d2d22bb63aea7739ec961 ?

it-praktyk commented 4 years ago

Unfortunately, PScribo (which is heavily used by Format-Pester) is not PowerShell Core compatible. So I can't state that Format-Pester works on PSCore as well.

Results of PScribo tests. ` PS /home///PScribo> Invoke-Pester -Show Fails Pester v4.10.1 Executing all tests in '.'

Executing script /home///PScribo/Tests/Plugins/OutHtml.Tests.ps1

< OUTPUT_PARTIALLY_OMITTED>

Describing OutHtml.Internal\OutHtmlParagraph

Context By Named Parameter
  [-] creates paragraph with embedded new line 12ms
    Expected strings to be the same, but they were different.
    Expected length: 33
    Actual length:   34
    Strings differ at index 13.
    Expected: '<div>Embedded<br />New Line</div>'
    But was:  '<div>Embedded\r<br />New Line</div>'
    357:                 $result | Should BeExactly $expected;
    at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutHtml.Tests.ps1: line 357

< OUTPUT_PARTIALLY_OMITTED>

Describing OutHtml.Internal\OutHtmlTable

Context New Lines
  [-] creates a tabular table cell with an embedded new line 78ms
    Expected regular expression '<td>Standard<br />Professional<br />Enterprise</td>' to match '<div><table class="tabledefault" style="width:100%;"><thead><tr><th>Licenses</th></tr></thead><tbody><tr><td>Standard
    <br />Professional
    <br />Enterprise</td></tr></tbody></table></div>', but it did not match.
    560:                 $html.OuterXml | Should Match $expected;
    at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutHtml.Tests.ps1: line 560
  [-] creates a list table cell with an embedded new line 79ms
    Expected regular expression '<td>Standard<br />Professional<br />Enterprise</td>' to match '<div><table class="tabledefault" style="width:100%;"><thead><tr><th>Licenses</th></tr></thead><tbody><tr><td>Standard
    <br />Professional
    <br />Enterprise</td></tr></tbody></table></div>', but it did not match.
    572:                 $html.OuterXml | Should Match $expected;
    at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutHtml.Tests.ps1: line 572

< OUTPUT_PARTIALLY_OMITTED>

Executing script /home///PScribo/Tests/Plugins/OutText.Tests.ps1

< OUTPUT_PARTIALLY_OMITTED>

Describing OutText.Internal\OutTextBlankLine [-] Defaults to a single blank line. 12ms Expected strings to be the same, but they were different. Expected length: 2 Actual length: 1 Strings differ at index 0. Expected: '\r ' But was: ' ' 82: $l | Should Be "rn"; at , /home///PScribo/Tests/Plugins/OutText.Tests.ps1: line 82 [-] Creates 3 blank lines. 11ms Expected strings to be the same, but they were different. Expected length: 6 Actual length: 3 Strings differ at index 0. Expected: '\r \r \r ' But was: ' ' 88: $l | Should Be "rnrnrn"; at , /home///PScribo/Tests/Plugins/OutText.Tests.ps1: line 88

< OUTPUT_PARTIALLY_OMITTED>

Describing OutText.Internal\OutTextLineBreak [-] Wraps lines and includes new line 11ms Expected 84, but got 83. 117: $l.Length | Should Be 84; at , /home///PScribo/Tests/Plugins/OutText.Tests.ps1: line 117

Describing OutText.Internal\OutTextPageBreak [-] Wraps lines and includes new line. 12ms Expected 86, but got 85. 141: $l.Length | Should Be 86; at , /home///PScribo/Tests/Plugins/OutText.Tests.ps1: line 141

Describing OutText.Internal\OutTextParagraph

Context By pipeline.
  [-] Paragraph wraps at 10 characters with new line. 18ms
    Expected strings to be the same, but they were different.
    Expected length: 19
    Actual length:   18
    Strings differ at index 10.
    Expected: 'Test parag\r
    raph.\r
    '
    But was:  'Test parag
    raph.\r
    '
    175:                 $p | Should BeExactly "Test parag`r`nraph.`r`n";
    at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutText.Tests.ps1: line 175
  [-] Paragraph wraps at 10 characters with no new line. 18ms
    Expected strings to be the same, but they were different.
    Expected length: 17
    Actual length:   16
    Strings differ at index 10.
    Expected: 'Test parag\r
    raph.'
    But was:  'Test parag
    raph.'
    184:                 $p | Should BeExactly "Test parag`r`nraph.";
    at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutText.Tests.ps1: line 184

< OUTPUT_PARTIALLY_OMITTED>

Describing OutText.Internal\OutTextTable

Context As Table.
  [-] Default width of 120. 22ms
    Expected 208, but got 202.
    302:                 $table.Length | Should Be 208;  # Trailing spaces are removed (#67)
    at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutText.Tests.ps1: line 302
  [-] Set width with of 35. 19ms
    Expected 313, but got 303.
    310:                 $table.Length | Should Be 313; ## Text tables are now set to wrap.. Trailing spaces are removed (#67)
    at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutText.Tests.ps1: line 310

Context As List.
  [-] Default width of 120. 19ms
    Expected 255, but got 243.
    326:                 $table.Length | Should Be 255;
    at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutText.Tests.ps1: line 326
  [-] Default width of 25. 20ms
    Expected 354, but got 336.
    334:                 $table.Length | Should Be 354; # Trailing spaces are removed (#67)
    at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutText.Tests.ps1: line 334

Describing OutText.Internal\OutTextTOC [-] outputs TOC name and section break 102ms Expected regular expression '^Table of contents\r -+' to case sensitively match 'Table of contents

  Heading 1
   Heading 2
  ', but it did not match.
  359:             $result | Should MatchExactly $expected;
  at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutText.Tests.ps1: line 359
[-] adds section numbers when "EnableSectionNumbering" is enabled (#20) 112ms
  Expected regular expression '^Table of contents\r
  -+\r
  1\s+Heading 1\r
  1.1\s+Heading 2\r
  $' to match 'Table of contents
  ------------------------------------------------------------------------------------------------------------------------
  1    Heading 1
  1.1   Heading 2
  ', but it did not match.
  379:             $result | Should Match $expected;
  at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutText.Tests.ps1: line 379
[-] does not add section numbers when "EnableSectionNumbering" is disabled (#20) 80ms
  Expected regular expression '^Table of contents\r
  -+\r
  Heading 1\r
   Heading 2\r
  $' to match 'Table of contents
  ------------------------------------------------------------------------------------------------------------------------
  Heading 1
   Heading 2
  ', but it did not match.
  397:             $result | Should Match $expected;
  at <ScriptBlock>, /home/<user_name>/<folder_name>/PScribo/Tests/Plugins/OutText.Tests.ps1: line 397

< OUTPUT_PARTIALLY_OMITTED>

Tests completed in 26.91s Tests Passed: 594, Failed: 18, Skipped: 0, Pending: 0, Inconclusive: 0

`

alagoutte commented 4 years ago

Ok but it is PScribo issue... (and look only about return line), there is a no issue or PR for fix PScribo ?

alagoutte commented 4 years ago

Pscribo can be run now with PowerShell Core :)

it-praktyk commented 4 years ago

Yes, it's true. I've checked that yesterday. When the version > 0.7.26 of PScribo will be released I'll update Format-Pester.