Skip to content

Add faithful cumulative (multi-file session) repro for #2829 #4

Add faithful cumulative (multi-file session) repro for #2829

Add faithful cumulative (multi-file session) repro for #2829 #4

Workflow file for this run

name: repro-2829
on:
push:
branches:
- nohwnd-fix-mock-ps51-regression-2829
workflow_dispatch:
jobs:
synthetic:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
pester: ['5.7.1', '6.0.0-rc1', '6.0.0-rc2', '6.0.0-rc3', '6.0.0-rc4']
name: synthetic ${{ matrix.pester }}
steps:
- uses: actions/checkout@v4
- name: Save Pester ${{ matrix.pester }}
shell: pwsh
run: |
$ver = '${{ matrix.pester }}'
$folder = ($ver -split '-')[0]
$dest = Join-Path $env:RUNNER_TEMP "pmods_$ver"
New-Item -ItemType Directory -Path $dest -Force | Out-Null
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null
$pre = $ver -like '*-*'
Save-Module -Name Pester -RequiredVersion $ver -AllowPrerelease:$pre -Path $dest -Repository PSGallery -Force
$psd1 = Join-Path $dest "Pester\$folder\Pester.psd1"
if (-not (Test-Path $psd1)) { throw "psd1 not found at $psd1" }
"PESTER_PSD1=$psd1" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Variants on Windows PowerShell 5.1 (Desktop)
shell: powershell
continue-on-error: true
run: |
powershell -NoProfile -ExecutionPolicy Bypass -File .repro2829\variants.ps1 -PesterPsd1 "$env:PESTER_PSD1"
- name: Variants on PowerShell 7 (Core)
shell: pwsh
continue-on-error: true
run: |
pwsh -NoProfile -File .repro2829/variants.ps1 -PesterPsd1 "$env:PESTER_PSD1"
real:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
pester: ['5.7.1', '6.0.0-rc4']
name: real dbatools ${{ matrix.pester }}
steps:
- uses: actions/checkout@v4
- name: Save Pester ${{ matrix.pester }} and dbatools.library
shell: pwsh
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null
$ver = '${{ matrix.pester }}'
$folder = ($ver -split '-')[0]
$dest = Join-Path $env:RUNNER_TEMP "pmods_$ver"
New-Item -ItemType Directory -Path $dest -Force | Out-Null
$pre = $ver -like '*-*'
Save-Module -Name Pester -RequiredVersion $ver -AllowPrerelease:$pre -Path $dest -Repository PSGallery -Force
$psd1 = Join-Path $dest "Pester\$folder\Pester.psd1"
if (-not (Test-Path $psd1)) { throw "psd1 not found at $psd1" }
"PESTER_PSD1=$psd1" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
$libdest = Join-Path $env:RUNNER_TEMP "libmods"
New-Item -ItemType Directory -Path $libdest -Force | Out-Null
Save-Module -Name dbatools.library -RequiredVersion 2025.12.28 -Path $libdest -Repository PSGallery -Force
"LIBMODS=$libdest" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Clone dbatools (PR 10405 head, commit 15c3981)
shell: pwsh
run: |
git clone --branch pester-6-rc --depth 1 https://github.com/nohwnd/dbatools.git "$env:RUNNER_TEMP\dbatools_src"
"DBATOOLS_SRC=$env:RUNNER_TEMP\dbatools_src" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Real negative test on Windows PowerShell 5.1 (Desktop)
shell: powershell
continue-on-error: true
run: |
powershell -NoProfile -ExecutionPolicy Bypass -File .repro2829\real-run.ps1 -PesterPsd1 "$env:PESTER_PSD1" -DbatoolsPath "$env:DBATOOLS_SRC" -LibraryModulePath "$env:LIBMODS"
- name: Real negative test on PowerShell 7 (Core)
shell: pwsh
continue-on-error: true
run: |
pwsh -NoProfile -File .repro2829/real-run.ps1 -PesterPsd1 "$env:PESTER_PSD1" -DbatoolsPath "$env:DBATOOLS_SRC" -LibraryModulePath "$env:LIBMODS"
cumulative:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
pester: ['5.7.1', '6.0.0-rc4']
name: cumulative ${{ matrix.pester }}
steps:
- uses: actions/checkout@v4
- name: Save Pester ${{ matrix.pester }} and dbatools.library
shell: pwsh
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null
$ver = '${{ matrix.pester }}'
$folder = ($ver -split '-')[0]
$dest = Join-Path $env:RUNNER_TEMP "pmods_$ver"
New-Item -ItemType Directory -Path $dest -Force | Out-Null
$pre = $ver -like '*-*'
Save-Module -Name Pester -RequiredVersion $ver -AllowPrerelease:$pre -Path $dest -Repository PSGallery -Force
$psd1 = Join-Path $dest "Pester\$folder\Pester.psd1"
if (-not (Test-Path $psd1)) { throw "psd1 not found at $psd1" }
"PESTER_PSD1=$psd1" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
$libdest = Join-Path $env:RUNNER_TEMP "libmods"
New-Item -ItemType Directory -Path $libdest -Force | Out-Null
Save-Module -Name dbatools.library -RequiredVersion 2025.12.28 -Path $libdest -Repository PSGallery -Force
"LIBMODS=$libdest" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Clone dbatools (PR 10405 head, commit 15c3981)
shell: pwsh
run: |
git clone --branch pester-6-rc --depth 1 https://github.com/nohwnd/dbatools.git "$env:RUNNER_TEMP\dbatools_src"
"DBATOOLS_SRC=$env:RUNNER_TEMP\dbatools_src" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Cumulative replay on Windows PowerShell 5.1 (Desktop)
shell: powershell
continue-on-error: true
run: |
powershell -NoProfile -ExecutionPolicy Bypass -File .repro2829\appveyor-repro.ps1 -PesterPsd1 "$env:PESTER_PSD1" -DbatoolsPath "$env:DBATOOLS_SRC" -LibraryModulePath "$env:LIBMODS"
- name: Cumulative replay on PowerShell 7 (Core)
shell: pwsh
continue-on-error: true
run: |
pwsh -NoProfile -File .repro2829/appveyor-repro.ps1 -PesterPsd1 "$env:PESTER_PSD1" -DbatoolsPath "$env:DBATOOLS_SRC" -LibraryModulePath "$env:LIBMODS"