Skip to content
Merged
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
6 changes: 3 additions & 3 deletions src/Pester.Runtime.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ function Invoke-ContainerDiscovery {

$root.DiscoveryDuration = $perContainerDiscoveryDuration.Elapsed
if ($PesterPreference.Debug.WriteDebugMessages.Value) {
Write-PesterDebugMessage -Scope Discovery -LazyMessage { "Found $(@(View-Flat -Block $root).Count) tests in $([int]$root.DiscoveryDuration.TotalMilliseconds) ms" }
Write-PesterDebugMessage -Scope Discovery -LazyMessage { "Found $(@(View-Flat -Block $root).Count) tests in $([int]$root.DiscoveryDuration.TotalMilliseconds)ms" }
Write-PesterDebugMessage -Scope DiscoveryCore "Discovery done in this container."
}

Expand Down Expand Up @@ -1320,14 +1320,14 @@ function Invoke-PluginStep {
} while ($false)

if ($PesterPreference.Debug.WriteDebugMessages.Value) {
Write-PesterDebugMessage -Scope Plugin "Success $($p.Name) step $Step in $($stepSw.ElapsedMilliseconds) ms"
Write-PesterDebugMessage -Scope Plugin "Success $($p.Name) step $Step in $($stepSw.ElapsedMilliseconds)ms"
}
}
catch {
$failed = $true
$err.Add($_)
if ($PesterPreference.Debug.WriteDebugMessages.Value) {
Write-PesterDebugMessage -Scope Plugin "Failed $($p.Name) step $Step in $($stepSw.ElapsedMilliseconds) ms" -ErrorRecord $_
Write-PesterDebugMessage -Scope Plugin "Failed $($p.Name) step $Step in $($stepSw.ElapsedMilliseconds)ms" -ErrorRecord $_
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/functions/Coverage.Plugin.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
})

if ($PesterPreference.Output.Verbosity.Value -in "Detailed", "Diagnostic") {
Write-PesterHostMessage -ForegroundColor Magenta "Code Coverage preparation finished after $($sw.ElapsedMilliseconds) ms."
Write-PesterHostMessage -ForegroundColor Magenta "Code Coverage preparation finished after $($sw.ElapsedMilliseconds)ms."
}
}

Expand Down Expand Up @@ -213,7 +213,7 @@
}
}
if ($PesterPreference.Output.Verbosity.Value -in 'Detailed', 'Diagnostic') {
Write-PesterHostMessage -ForegroundColor Magenta "Code Coverage result processed in $($sw.ElapsedMilliseconds) ms."
Write-PesterHostMessage -ForegroundColor Magenta "Code Coverage result processed in $($sw.ElapsedMilliseconds)ms."
}
$reportText = Write-CoverageReport $coverageReport

Expand Down
8 changes: 4 additions & 4 deletions src/functions/Coverage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# not actual breakpoints
$breakpoints = @(Get-CoverageBreakpoints -CoverageInfo $coverageInfo -Logger $Logger)
if ($null -ne $logger) {
& $logger "Figuring out $($breakpoints.Count) measurable code locations took $($sw.ElapsedMilliseconds) ms."
& $logger "Figuring out $($breakpoints.Count) measurable code locations took $($sw.ElapsedMilliseconds)ms."
}

if ($UseBreakpoints) {
Expand Down Expand Up @@ -76,7 +76,7 @@
$sw.Stop()

if ($null -ne $logger) {
& $logger "Setting $($breakpoints.Count) breakpoints took $($sw.ElapsedMilliseconds) ms."
& $logger "Setting $($breakpoints.Count) breakpoints took $($sw.ElapsedMilliseconds)ms."
}
}
else {
Expand Down Expand Up @@ -110,7 +110,7 @@ function Exit-CoverageAnalysis {
}

if ($null -ne $logger) {
& $logger "Removing $($breakpoints.Count) breakpoints took $($sw.ElapsedMilliseconds) ms."
& $logger "Removing $($breakpoints.Count) breakpoints took $($sw.ElapsedMilliseconds)ms."
}
}

Expand Down Expand Up @@ -272,7 +272,7 @@ function Get-CoverageBreakpoints {
}
}
if ($null -ne $Logger) {
& $Logger "Analyzing $analyzedCommands of $totalCommands commands in file '$($fileGroup.Name)' for code coverage, in $($sw.ElapsedMilliseconds) ms"
& $Logger "Analyzing $analyzedCommands of $totalCommands commands in file '$($fileGroup.Name)' for code coverage, in $($sw.ElapsedMilliseconds)ms"
}
}
}
Expand Down
13 changes: 6 additions & 7 deletions tst/Pester.RSpec.Parallel.ts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,7 @@ Describe 'B' { It 'b1 passes' { 1 | Should -Be 1 } }
$normalized = $sb.ToString() `
-replace 'Pester v\S+', 'Pester v<version>' `
-replace ([regex]::Escape($folder + [IO.Path]::DirectorySeparatorChar)), '' `
-replace '\d+ ms', '<time> ms' `
-replace '\d+ms', '<time>ms'
-replace '\d+(.\d+)?m?s', '<time>'
$actual = (($normalized -split "`r`n|`r|`n").ForEach({ $_.TrimEnd() }) -join "`n").Trim()

# Each file's discovery is immediately followed by that same file's run - A fully, then
Expand All @@ -705,18 +704,18 @@ Pester v<version>

Running tests from 2 files in parallel.
Discovery: Discovering tests in A.Tests.ps1
Discovery: Found 1 tests in <time> ms
Discovery: Found 1 tests in <time>

Running tests from 'A.Tests.ps1'
Describing A
[+] a1 passes <time>ms
[+] a1 passes <time>
Discovery: Discovering tests in B.Tests.ps1
Discovery: Found 1 tests in <time> ms
Discovery: Found 1 tests in <time>

Running tests from 'B.Tests.ps1'
Describing B
[+] b1 passes <time>ms
Tests completed in <time>ms
[+] b1 passes <time>
Tests completed in <time>
Tests Passed: 2, Failed: 0, Skipped: 0, Inconclusive: 0, NotRun: 0
'@ -replace "`r`n", "`n"

Expand Down
18 changes: 9 additions & 9 deletions tst/Pester.Runtime.ts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2134,15 +2134,15 @@ i -PassThru:$PassThru {
$totalReported = $actualDuration + $actualFrameworkDuration + $actualDiscoveryDuration
$totalDifference = $container.Total - $totalReported
$testCount = $cs.Count * $bs.Count * $ts.Count
Write-Host Test count $testCount
Write-Host Per test $([int]($container.Total.TotalMilliseconds / $testCount)) ms
Write-Host Per test without discovery $([int](($actualDuration + $actualFrameworkDuration).TotalMilliseconds / $testCount)) ms
Write-Host Reported discovery duration $actualDiscoveryDuration.TotalMilliseconds ms
Write-Host Reported total duration $actualDuration.TotalMilliseconds ms
Write-Host Reported total overhead $actualFrameworkDuration.TotalMilliseconds ms
Write-Host Reported total $totalReported.TotalMilliseconds ms
Write-Host Measured total $container.Total.TotalMilliseconds ms
Write-Host Total difference $totalDifference.TotalMilliseconds ms
Write-Host "Test count $testCount"
Write-Host "Per test $([int]($container.Total.TotalMilliseconds / $testCount))ms"
Write-Host "Per test without discovery $([int](($actualDuration + $actualFrameworkDuration).TotalMilliseconds / $testCount))ms"
Write-Host "Reported discovery duration $($actualDiscoveryDuration.TotalMilliseconds)ms"
Write-Host "Reported total duration $($actualDuration.TotalMilliseconds)ms"
Write-Host "Reported total overhead $($actualFrameworkDuration.TotalMilliseconds)ms"
Write-Host "Reported total $($totalReported.TotalMilliseconds)ms"
Write-Host "Measured total $($container.Total.TotalMilliseconds)ms"
Write-Host "Total difference $($totalDifference.TotalMilliseconds)ms"


# the difference here is because of the code that is running after all tests have been discovered
Expand Down
Loading