Skip to content

Commit 86b4ce6

Browse files
Merge branch 'main' into create-pester-migration-skill
2 parents e7de191 + 16419d0 commit 86b4ce6

18 files changed

Lines changed: 68 additions & 48 deletions

.github/actions/Get-PesterCodeCoverage/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@ Summary:
7777

7878
## Requirements
7979

80-
1. **Pester Code Coverage Reports**
80+
1. **Pester 6.1 Code Coverage Reports**
81+
8182
Preceding steps must generate JSON coverage reports named `*-CodeCoverage*.json`
83+
from the Pester 6.1 `CodeCoverage` result object. The action consumes
84+
`CoveragePercent`, `CoveragePercentTarget`, `CommandsMissed`,
85+
`CommandsExecuted`, and `FilesAnalyzed` plus their count properties.
8286

8387
2. **GitHub CLI**
8488
The action uses `gh run download` to fetch artifacts from the current workflow run

.github/actions/Test-PSModule/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ inputs:
8585
required: false
8686
CodeCoverage_OutputFormat:
8787
description: |
88-
Format to use for code coverage report. Possible values: JaCoCo, CoverageGutters, Cobertura
88+
Format to use for code coverage report. Possible values in Pester 6.1: JaCoCo or Cobertura.
8989
required: false
9090
CodeCoverage_OutputPath:
9191
description: |
@@ -113,7 +113,7 @@ inputs:
113113
required: false
114114
CodeCoverage_UseBreakpoints:
115115
description: |
116-
EXPERIMENTAL: When false, use Profiler based tracer to do CodeCoverage instead of using breakpoints.
116+
When false, use the profiler-based tracer instead of breakpoints for code coverage.
117117
required: false
118118
CodeCoverage_SingleHitBreakpoints:
119119
description: |
@@ -288,6 +288,7 @@ runs:
288288
with:
289289
Debug: ${{ inputs.Debug }}
290290
Verbose: ${{ inputs.Verbose }}
291+
Version: '[6.1.0,7.0.0)'
291292
GitHubVersion: ${{ inputs.Version }}
292293
GitHubPrerelease: ${{ inputs.Prerelease }}
293294
WorkingDirectory: ${{ inputs.WorkingDirectory }}

.github/actions/Test-PSModule/src/tests/Module/PSModule/PSModule.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if ($hasClassExporter) {
4343

4444

4545
# Run-phase setup — recompute from $Path so that It/Context blocks can use these variables.
46-
# Pester v5 Discovery and Run are separate executions. The script-scope variables above drive
46+
# Pester 6 Discovery and Run are separate executions. The script-scope variables above drive
4747
# -Skip and -ForEach during Discovery. This BeforeAll recomputes the same values for the Run
4848
# phase, where It blocks actually execute. The duplication is intentional and required.
4949
BeforeAll {

.github/workflows/Build-Docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010

1111
permissions:
1212
contents: read # to checkout the repo
13-
statuses: write # to create commit status
1413

1514
jobs:
1615
Build-Docs:

.github/workflows/Lint-Repository.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ on:
99
required: true
1010

1111
permissions:
12-
contents: read # to checkout the repository
13-
statuses: write # to update the status of the workflow from linter
14-
pull-requests: write # to post super-linter summary comments on PRs
12+
contents: read # to checkout the repository
1513

1614
jobs:
1715
Lint-Repository:

.github/workflows/Plan.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ on:
6464

6565
permissions:
6666
contents: read # to checkout the repo
67-
pull-requests: write # to add labels / comments to PRs
6867

6968
jobs:
7069
Plan:

.github/workflows/Publish-Module.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ jobs:
2525
name: Publish-Module
2626
runs-on: ubuntu-24.04
2727
permissions:
28-
contents: write # Create releases and upload release artifacts.
29-
pull-requests: write # Comment on pull requests.
28+
contents: read # Checkout uses github.token.
3029
env:
3130
SETTINGS: ${{ inputs.Settings }}
3231
steps:

.github/workflows/Test-Actions.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,33 @@ jobs:
3434
- name: Install test dependencies
3535
shell: pwsh
3636
run: |
37-
Install-PSResource -Name Pester -Version '[5.7.1,6.0.0)' -Repository PSGallery -TrustRepository
37+
Install-PSResource -Name Pester -Version '[6.1.0,7.0.0)' -Repository PSGallery -TrustRepository
3838
Install-PSResource -Name PSSemVer -Repository PSGallery -TrustRepository
3939
Install-PSResource -Name GitHub -Version '[0.43.1,0.44.0)' -Repository PSGallery -TrustRepository
4040
4141
- name: Run action unit tests
4242
shell: pwsh
4343
run: |
44+
$configuration = New-PesterConfiguration
45+
$configuration.Run.Shuffle = $true
46+
$configuration.Run.ShuffleSeed = 42
47+
$configuration.Run.Parallel = $true
48+
$configuration.Run.ParallelThrottleLimit = 2
49+
$configuration.Debug.ShowStartMarkers = $true
50+
51+
$expectedOptions = @{
52+
'Run.Shuffle' = $configuration.Run.Shuffle.Value
53+
'Run.ShuffleSeed' = $configuration.Run.ShuffleSeed.Value -eq 42
54+
'Run.Parallel' = $configuration.Run.Parallel.Value
55+
'Run.ParallelThrottleLimit' = $configuration.Run.ParallelThrottleLimit.Value -eq 2
56+
'Debug.ShowStartMarkers' = $configuration.Debug.ShowStartMarkers.Value
57+
}
58+
foreach ($option in $expectedOptions.GetEnumerator()) {
59+
if (-not $option.Value) {
60+
throw "Pester 6.1 configuration option [$($option.Key)] was not applied."
61+
}
62+
}
63+
4464
$testPaths = Get-ChildItem -Path '.github/actions' -Directory |
4565
ForEach-Object { Join-Path -Path $_.FullName -ChildPath 'tests' } |
4666
Where-Object { Test-Path -Path $_ }

.github/workflows/Test-ModuleLocal.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ jobs:
7272
uses: PSModule/Invoke-Pester@4ff33199141fdf22568990b6107fe3148ae93a1c # v5.1.0
7373
with:
7474
Debug: ${{ fromJson(inputs.Settings).Debug }}
75-
Prerelease: ${{ fromJson(inputs.Settings).Prerelease }}
7675
Verbose: ${{ fromJson(inputs.Settings).Verbose }}
77-
Version: ${{ fromJson(inputs.Settings).Version }}
76+
Version: '[6.1.0,7.0.0)'
77+
GitHubVersion: ${{ fromJson(inputs.Settings).Version }}
78+
GitHubPrerelease: ${{ fromJson(inputs.Settings).Prerelease }}
7879
TestResult_TestSuiteName: ${{ matrix.TestName }}-${{ matrix.OSName }}
7980
TestResult_Enabled: true
8081
CodeCoverage_Enabled: true

.github/workflows/Workflow-Test-Default.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ concurrency:
3535
cancel-in-progress: false
3636

3737
permissions:
38-
contents: write
39-
pull-requests: write
40-
statuses: write
38+
contents: read
4139
pages: write
4240
id-token: write
4341

@@ -66,6 +64,7 @@ jobs:
6664
^\.github/workflows/(?!Release\.yml$|Linter\.yml$)
6765
6866
VerifyRootFunctionsIndexDefault:
67+
if: github.event.action != 'closed'
6968
name: Verify root Functions index [Default]
7069
runs-on: ubuntu-latest
7170
needs:

0 commit comments

Comments
 (0)