Skip to content

Commit

Permalink
Bump 5.0.0-alpha3
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd committed Mar 23, 2019
1 parent 165019d commit 566b321
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Pester.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@
LicenseUri = "https://www.apache.org/licenses/LICENSE-2.0.html"

# Release notes for this particular version of the module
ReleaseNotes = 'https://github.com/pester/Pester/releases/tag/5.0.0'
ReleaseNotes = 'https://github.com/pester/Pester/blob/v5.0/README.md'

# Prerelease string of this module
Prerelease = 'alpha2'
Prerelease = 'alpha3'
}
}

Expand Down
1 change: 1 addition & 0 deletions buildPSGalleryPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ try {
Copy-Item $baseDir\Snippets $buildDir\ -Recurse
Copy-Item $baseDir\en-US $buildDir\ -Recurse
Copy-Item $baseDir\lib $buildDir\ -Recurse
Copy-Item $baseDir\new-runtimepoc $buildDir\ -Recurse

Write-Verbose 'Copy complete. Contents:'
Get-ChildItem $buildDir -Recurse | Out-Host
Expand Down
21 changes: 14 additions & 7 deletions new-runtimepoc/Pester.Runtime.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function Find-Test {
[Parameter(Mandatory = $true)]
[Management.Automation.SessionState] $SessionState
)
Write-PesterDebugMessage -Scope Discovery "Running just discovery."
Write-PesterDebugMessage -Scope DiscoveryCore "Running just discovery."
$found = Discover-Test -BlockContainer $BlockContainer -Filter $Filter -SessionState $SessionState

foreach ($f in $found) {
Expand Down Expand Up @@ -183,7 +183,7 @@ function New-Block {
}

if (Is-Discovery) {
Write-PesterDebugMessage -Scope Discovery "Adding block $Name to discovered blocks"
Write-PesterDebugMessage -Scope DiscoveryCore "Adding block $Name to discovered blocks"

# the tests are identified based on the start position of their script block
# so in case user generates tests (typically from foreach loop)
Expand Down Expand Up @@ -211,9 +211,9 @@ function New-Block {
Set-CurrentBlock -Block $block
try {
if (Is-Discovery) {
Write-PesterDebugMessage -Scope Discovery "Discovering in body of block $Name"
Write-PesterDebugMessage -Scope DiscoveryCore "Discovering in body of block $Name"
& $ScriptBlock
Write-PesterDebugMessage -Scope Discovery "Finished discovering in body of block $Name"
Write-PesterDebugMessage -Scope DiscoveryCore "Finished discovering in body of block $Name"
}
else {
if (-not $block.ShouldRun) {
Expand Down Expand Up @@ -374,7 +374,7 @@ function New-Test {
$test.FrameworkData.Runtime.Phase = 'Discovery'

Add-Test -Test $test
Write-PesterDebugMessage -Scope Discovery "Added test '$Name'"
Write-PesterDebugMessage -Scope DiscoveryCore "Added test '$Name'"
}
else {
$test = Find-CurrentTest -Name $Name -ScriptBlock $ScriptBlock -Id $Id
Expand Down Expand Up @@ -800,10 +800,12 @@ function Discover-Test {
[Management.Automation.SessionState] $SessionState,
$Filter
)
& $SafeCommands["Write-Host"] -ForegroundColor Magenta "Starting test discovery in $(@($BlockContainer).Length) files."
Write-PesterDebugMessage -Scope Discovery -Message "Starting test discovery in $(@($BlockContainer).Length) test containers."

$state.Discovery = $true
$found = foreach ($container in $BlockContainer) {
& $SafeCommands["Write-Host"] -ForegroundColor Magenta "Discovering tests in $($container.Content)"
Write-PesterDebugMessage -Scope Discovery "Discovering tests in $($container.Content)"
# this is a block object that we add so we can capture
# OneTime* and Each* setups, and capture multiple blocks in a
Expand All @@ -817,10 +819,13 @@ function Discover-Test {
Container = $container
Block = $root
}

& $SafeCommands["Write-Host"] -ForegroundColor Magenta "Found $(@(View-Flat -Block $root).Count) tests"
Write-PesterDebugMessage -Scope Discovery -LazyMessage { "Found $(@(View-Flat -Block $root).Count) tests" }
Write-PesterDebugMessage -Scope Discovery "Discovery done in this container."
Write-PesterDebugMessage -Scope DiscoveryCore "Discovery done in this container."
}

& $SafeCommands["Write-Host"] -ForegroundColor Magenta "Processing discovery result objects, to set root, parents, filters etc."
Write-PesterDebugMessage -Scope Discovery "Processing discovery result objects, to set root, parents, filters etc."

# if any tests / block in the suite have -Focus parameter then all filters are disregarded
Expand All @@ -838,7 +843,8 @@ function Discover-Test {
}

if (any $focusedTests) {
Write-PesterDebugMessage -Scope Discovery "There are some ($($focusedTests.Count)) focused tests '$($(foreach ($p in $focusedTests) { $p -join "." }) -join ",")' running just them."
& $SafeCommands["Write-Host"] -ForegroundColor Magenta "There are some ($($focusedTests.Count)) focused tests '$($(foreach ($p in $focusedTests) { $p -join "." }) -join ",")' running just them."
Write-PesterDebugMessage -Scope Discovery -LazyMessage { "There are some ($($focusedTests.Count)) focused tests '$($(foreach ($p in $focusedTests) { $p -join "." }) -join ",")' running just them." }
$Filter = New-FilterObject -Path $focusedTests
}

Expand All @@ -847,6 +853,7 @@ function Discover-Test {
$f.Block
}

& $SafeCommands["Write-Host"] -ForegroundColor Magenta "Test discovery finished."
Write-PesterDebugMessage -Scope Discovery "Test discovery finished."
}

Expand Down
3 changes: 2 additions & 1 deletion new-runtimepoc/Pester.Utility.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function Write-PesterDebugMessage {
[CmdletBinding(DefaultParameterSetName = "Default")]
param (
[Parameter(Mandatory = $true, Position = 0)]
[ValidateSet("CoreRuntime", "Runtime", "Mock", "Discovery", "SessionState")]
[ValidateSet("CoreRuntime", "Runtime", "Mock", "Discovery", "DiscoveryCore", "SessionState")]
[String] $Scope,
[Parameter(Mandatory = $true, Position = 1, ParameterSetName = "Default")]
[String] $Message,
Expand All @@ -212,6 +212,7 @@ function Write-PesterDebugMessage {
"Runtime" { "DarkGray" }
"Mock" { "DarkYellow" }
"Discovery" { "DarkMagenta" }
"DiscoveryCore" { "DarkMagenta" }
"SessionState" { "Gray" }
}

Expand Down

0 comments on commit 566b321

Please sign in to comment.