|
6 | 6 | - nohwnd-fix-mock-ps51-regression-2829 |
7 | 7 | workflow_dispatch: |
8 | 8 |
|
9 | | -jobs: |
10 | | - probe2019: |
11 | | - runs-on: windows-2022 |
12 | | - name: probe ltsc2019 container |
13 | | - steps: |
14 | | - - name: Host + docker info |
15 | | - shell: pwsh |
16 | | - run: | |
17 | | - Write-Host "HOST_PS=$($PSVersionTable.PSVersion.ToString())" |
18 | | - Write-Host "HOST_OS=$([Environment]::OSVersion.Version.ToString())" |
19 | | - docker version |
20 | | - docker info --format '{{json .Isolation}}' |
21 | | -
|
22 | | - - name: Pull servercore ltsc2019 |
23 | | - shell: pwsh |
24 | | - run: | |
25 | | - $sw = [Diagnostics.Stopwatch]::StartNew() |
26 | | - docker pull mcr.microsoft.com/windows/servercore:ltsc2019 |
27 | | - Write-Host "PULL_ELAPSED=$($sw.Elapsed)" |
28 | | -
|
29 | | - - name: Run container (hyperv isolation) |
30 | | - shell: pwsh |
31 | | - continue-on-error: true |
32 | | - run: | |
33 | | - docker run --rm --isolation=hyperv mcr.microsoft.com/windows/servercore:ltsc2019 powershell -NoProfile -Command "Write-Host ('PROBE_HYPERV_PS=' + `$PSVersionTable.PSVersion.ToString())" |
| 9 | +# Reproduce #2829 on the AppVeyor build family: Windows Server 2019 / PowerShell |
| 10 | +# 5.1.17763. GitHub retired the windows-2019 hosted runner, so we run a Server 2019 |
| 11 | +# servercore container (PS 5.1.17763) under Hyper-V isolation on a windows-2022 runner. |
34 | 12 |
|
35 | | - - name: Run container (process isolation) |
36 | | - shell: pwsh |
37 | | - continue-on-error: true |
38 | | - run: | |
39 | | - docker run --rm --isolation=process mcr.microsoft.com/windows/servercore:ltsc2019 powershell -NoProfile -Command "Write-Host ('PROBE_PROCESS_PS=' + `$PSVersionTable.PSVersion.ToString())" |
| 13 | +env: |
| 14 | + IMG: mcr.microsoft.com/windows/servercore:ltsc2019 |
| 15 | + DBLIB: '2025.12.28' |
40 | 16 |
|
41 | | - synthetic: |
42 | | - if: ${{ false }} |
| 17 | +jobs: |
| 18 | + syn2019: |
43 | 19 | runs-on: windows-2022 |
44 | 20 | strategy: |
45 | 21 | fail-fast: false |
46 | 22 | matrix: |
47 | 23 | pester: ['5.7.1', '6.0.0-rc1', '6.0.0-rc2', '6.0.0-rc3', '6.0.0-rc4'] |
48 | | - name: synthetic ${{ matrix.pester }} |
| 24 | + name: syn2019 ${{ matrix.pester }} |
49 | 25 | steps: |
50 | 26 | - uses: actions/checkout@v4 |
51 | 27 |
|
52 | | - - name: Save Pester ${{ matrix.pester }} |
| 28 | + - name: Save Pester ${{ matrix.pester }} (host) |
53 | 29 | shell: pwsh |
54 | 30 | run: | |
| 31 | + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
| 32 | + Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null |
55 | 33 | $ver = '${{ matrix.pester }}' |
56 | 34 | $folder = ($ver -split '-')[0] |
57 | | - $dest = Join-Path $env:RUNNER_TEMP "pmods_$ver" |
| 35 | + $dest = Join-Path $env:RUNNER_TEMP 'pmods' |
58 | 36 | New-Item -ItemType Directory -Path $dest -Force | Out-Null |
59 | | - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
60 | | - Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null |
61 | 37 | $pre = $ver -like '*-*' |
62 | 38 | Save-Module -Name Pester -RequiredVersion $ver -AllowPrerelease:$pre -Path $dest -Repository PSGallery -Force |
63 | | - $psd1 = Join-Path $dest "Pester\$folder\Pester.psd1" |
64 | | - if (-not (Test-Path $psd1)) { throw "psd1 not found at $psd1" } |
65 | | - "PESTER_PSD1=$psd1" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 |
| 39 | + "PFOLDER=$folder" | Out-File $env:GITHUB_ENV -Append -Encoding utf8 |
66 | 40 |
|
67 | | - - name: Variants on Windows PowerShell 5.1 (Desktop) |
68 | | - shell: powershell |
69 | | - continue-on-error: true |
70 | | - run: | |
71 | | - powershell -NoProfile -ExecutionPolicy Bypass -File .repro2829\variants.ps1 -PesterPsd1 "$env:PESTER_PSD1" |
| 41 | + - name: Pull ltsc2019 |
| 42 | + shell: pwsh |
| 43 | + run: docker pull $env:IMG |
72 | 44 |
|
73 | | - - name: Variants on PowerShell 7 (Core) |
| 45 | + - name: Variants in ltsc2019 (PS 5.1.17763) |
74 | 46 | shell: pwsh |
75 | 47 | continue-on-error: true |
76 | 48 | run: | |
77 | | - pwsh -NoProfile -File .repro2829/variants.ps1 -PesterPsd1 "$env:PESTER_PSD1" |
| 49 | + $ws = $env:GITHUB_WORKSPACE |
| 50 | + $tmp = $env:RUNNER_TEMP |
| 51 | + $psd1 = "C:\pmods\Pester\$env:PFOLDER\Pester.psd1" |
| 52 | + docker run --rm --isolation=hyperv -v "${ws}:C:\repo" -v "${tmp}\pmods:C:\pmods" $env:IMG powershell -NoProfile -ExecutionPolicy Bypass -File C:\repo\.repro2829\variants.ps1 -PesterPsd1 "$psd1" |
78 | 53 |
|
79 | | - real: |
80 | | - if: ${{ false }} |
| 54 | + cum2019: |
81 | 55 | runs-on: windows-2022 |
82 | 56 | strategy: |
83 | 57 | fail-fast: false |
84 | 58 | matrix: |
85 | 59 | pester: ['5.7.1', '6.0.0-rc4'] |
86 | | - name: real dbatools ${{ matrix.pester }} |
| 60 | + name: cum2019 ${{ matrix.pester }} |
87 | 61 | steps: |
88 | 62 | - uses: actions/checkout@v4 |
89 | 63 |
|
90 | | - - name: Save Pester ${{ matrix.pester }} and dbatools.library |
| 64 | + - name: Save Pester ${{ matrix.pester }} + dbatools.library (host) |
91 | 65 | shell: pwsh |
92 | 66 | run: | |
93 | 67 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
94 | 68 | Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null |
95 | | -
|
96 | 69 | $ver = '${{ matrix.pester }}' |
97 | 70 | $folder = ($ver -split '-')[0] |
98 | | - $dest = Join-Path $env:RUNNER_TEMP "pmods_$ver" |
| 71 | + $dest = Join-Path $env:RUNNER_TEMP 'pmods' |
99 | 72 | New-Item -ItemType Directory -Path $dest -Force | Out-Null |
100 | 73 | $pre = $ver -like '*-*' |
101 | 74 | Save-Module -Name Pester -RequiredVersion $ver -AllowPrerelease:$pre -Path $dest -Repository PSGallery -Force |
102 | | - $psd1 = Join-Path $dest "Pester\$folder\Pester.psd1" |
103 | | - if (-not (Test-Path $psd1)) { throw "psd1 not found at $psd1" } |
104 | | - "PESTER_PSD1=$psd1" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 |
105 | | -
|
106 | | - $libdest = Join-Path $env:RUNNER_TEMP "libmods" |
| 75 | + "PFOLDER=$folder" | Out-File $env:GITHUB_ENV -Append -Encoding utf8 |
| 76 | + $libdest = Join-Path $env:RUNNER_TEMP 'libmods' |
107 | 77 | New-Item -ItemType Directory -Path $libdest -Force | Out-Null |
108 | | - Save-Module -Name dbatools.library -RequiredVersion 2025.12.28 -Path $libdest -Repository PSGallery -Force |
109 | | - "LIBMODS=$libdest" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 |
| 78 | + Save-Module -Name dbatools.library -RequiredVersion $env:DBLIB -Path $libdest -Repository PSGallery -Force |
110 | 79 |
|
111 | | - - name: Clone dbatools (PR 10405 head, commit 15c3981) |
| 80 | + - name: Clone dbatools (PR 10405 head) |
112 | 81 | shell: pwsh |
113 | | - run: | |
114 | | - git clone --branch pester-6-rc --depth 1 https://github.com/nohwnd/dbatools.git "$env:RUNNER_TEMP\dbatools_src" |
115 | | - "DBATOOLS_SRC=$env:RUNNER_TEMP\dbatools_src" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 |
| 82 | + run: git clone --branch pester-6-rc --depth 1 https://github.com/nohwnd/dbatools.git "$env:RUNNER_TEMP\dbatools_src" |
116 | 83 |
|
117 | | - - name: Real negative test on Windows PowerShell 5.1 (Desktop) |
118 | | - shell: powershell |
119 | | - continue-on-error: true |
120 | | - run: | |
121 | | - powershell -NoProfile -ExecutionPolicy Bypass -File .repro2829\real-run.ps1 -PesterPsd1 "$env:PESTER_PSD1" -DbatoolsPath "$env:DBATOOLS_SRC" -LibraryModulePath "$env:LIBMODS" |
| 84 | + - name: Pull ltsc2019 |
| 85 | + shell: pwsh |
| 86 | + run: docker pull $env:IMG |
122 | 87 |
|
123 | | - - name: Real negative test on PowerShell 7 (Core) |
| 88 | + - name: Cumulative replay in ltsc2019 (PS 5.1.17763) |
124 | 89 | shell: pwsh |
125 | 90 | continue-on-error: true |
126 | 91 | run: | |
127 | | - pwsh -NoProfile -File .repro2829/real-run.ps1 -PesterPsd1 "$env:PESTER_PSD1" -DbatoolsPath "$env:DBATOOLS_SRC" -LibraryModulePath "$env:LIBMODS" |
| 92 | + $ws = $env:GITHUB_WORKSPACE |
| 93 | + $tmp = $env:RUNNER_TEMP |
| 94 | + $psd1 = "C:\pmods\Pester\$env:PFOLDER\Pester.psd1" |
| 95 | + docker run --rm --isolation=hyperv -v "${ws}:C:\repo" -v "${tmp}\pmods:C:\pmods" -v "${tmp}\libmods:C:\libmods" -v "${tmp}\dbatools_src:C:\dbatools" $env:IMG powershell -NoProfile -ExecutionPolicy Bypass -File C:\repo\.repro2829\appveyor-repro.ps1 -PesterPsd1 "$psd1" -DbatoolsPath C:\dbatools -LibraryModulePath C:\libmods |
128 | 96 |
|
129 | | - cumulative: |
130 | | - if: ${{ false }} |
| 97 | + real2019: |
131 | 98 | runs-on: windows-2022 |
132 | 99 | strategy: |
133 | 100 | fail-fast: false |
134 | 101 | matrix: |
135 | 102 | pester: ['5.7.1', '6.0.0-rc4'] |
136 | | - name: cumulative ${{ matrix.pester }} |
| 103 | + name: real2019 ${{ matrix.pester }} |
137 | 104 | steps: |
138 | 105 | - uses: actions/checkout@v4 |
139 | 106 |
|
140 | | - - name: Save Pester ${{ matrix.pester }} and dbatools.library |
| 107 | + - name: Save Pester ${{ matrix.pester }} + dbatools.library (host) |
141 | 108 | shell: pwsh |
142 | 109 | run: | |
143 | 110 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
144 | 111 | Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null |
145 | | -
|
146 | 112 | $ver = '${{ matrix.pester }}' |
147 | 113 | $folder = ($ver -split '-')[0] |
148 | | - $dest = Join-Path $env:RUNNER_TEMP "pmods_$ver" |
| 114 | + $dest = Join-Path $env:RUNNER_TEMP 'pmods' |
149 | 115 | New-Item -ItemType Directory -Path $dest -Force | Out-Null |
150 | 116 | $pre = $ver -like '*-*' |
151 | 117 | Save-Module -Name Pester -RequiredVersion $ver -AllowPrerelease:$pre -Path $dest -Repository PSGallery -Force |
152 | | - $psd1 = Join-Path $dest "Pester\$folder\Pester.psd1" |
153 | | - if (-not (Test-Path $psd1)) { throw "psd1 not found at $psd1" } |
154 | | - "PESTER_PSD1=$psd1" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 |
155 | | -
|
156 | | - $libdest = Join-Path $env:RUNNER_TEMP "libmods" |
| 118 | + "PFOLDER=$folder" | Out-File $env:GITHUB_ENV -Append -Encoding utf8 |
| 119 | + $libdest = Join-Path $env:RUNNER_TEMP 'libmods' |
157 | 120 | New-Item -ItemType Directory -Path $libdest -Force | Out-Null |
158 | | - Save-Module -Name dbatools.library -RequiredVersion 2025.12.28 -Path $libdest -Repository PSGallery -Force |
159 | | - "LIBMODS=$libdest" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 |
| 121 | + Save-Module -Name dbatools.library -RequiredVersion $env:DBLIB -Path $libdest -Repository PSGallery -Force |
160 | 122 |
|
161 | | - - name: Clone dbatools (PR 10405 head, commit 15c3981) |
| 123 | + - name: Clone dbatools (PR 10405 head) |
162 | 124 | shell: pwsh |
163 | | - run: | |
164 | | - git clone --branch pester-6-rc --depth 1 https://github.com/nohwnd/dbatools.git "$env:RUNNER_TEMP\dbatools_src" |
165 | | - "DBATOOLS_SRC=$env:RUNNER_TEMP\dbatools_src" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 |
| 125 | + run: git clone --branch pester-6-rc --depth 1 https://github.com/nohwnd/dbatools.git "$env:RUNNER_TEMP\dbatools_src" |
166 | 126 |
|
167 | | - - name: Cumulative replay on Windows PowerShell 5.1 (Desktop) |
168 | | - shell: powershell |
169 | | - continue-on-error: true |
170 | | - run: | |
171 | | - powershell -NoProfile -ExecutionPolicy Bypass -File .repro2829\appveyor-repro.ps1 -PesterPsd1 "$env:PESTER_PSD1" -DbatoolsPath "$env:DBATOOLS_SRC" -LibraryModulePath "$env:LIBMODS" |
| 127 | + - name: Pull ltsc2019 |
| 128 | + shell: pwsh |
| 129 | + run: docker pull $env:IMG |
172 | 130 |
|
173 | | - - name: Cumulative replay on PowerShell 7 (Core) |
| 131 | + - name: Real negative test in ltsc2019 (PS 5.1.17763) |
174 | 132 | shell: pwsh |
175 | 133 | continue-on-error: true |
176 | 134 | run: | |
177 | | - pwsh -NoProfile -File .repro2829/appveyor-repro.ps1 -PesterPsd1 "$env:PESTER_PSD1" -DbatoolsPath "$env:DBATOOLS_SRC" -LibraryModulePath "$env:LIBMODS" |
| 135 | + $ws = $env:GITHUB_WORKSPACE |
| 136 | + $tmp = $env:RUNNER_TEMP |
| 137 | + $psd1 = "C:\pmods\Pester\$env:PFOLDER\Pester.psd1" |
| 138 | + docker run --rm --isolation=hyperv -v "${ws}:C:\repo" -v "${tmp}\pmods:C:\pmods" -v "${tmp}\libmods:C:\libmods" -v "${tmp}\dbatools_src:C:\dbatools" $env:IMG powershell -NoProfile -ExecutionPolicy Bypass -File C:\repo\.repro2829\real-run.ps1 -PesterPsd1 "$psd1" -DbatoolsPath C:\dbatools -LibraryModulePath C:\libmods |
0 commit comments