Skip to content

Commit 099fc66

Browse files
Add migration tool tests to CI pipeline
Adds a 'TestMigrationTool' job in the Test stage that runs the migration tool Pester tests on both PowerShell Core (pwsh) and Windows PowerShell. The job is independent of the module build since the migration tool is a standalone script. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 235e11b commit 099fc66

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.ci/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,36 @@ stages:
149149
displayName: AzAuth PowerShell Core on Windows
150150
imageName: windows-latest
151151
useAzAuth: true
152+
153+
- job: TestMigrationTool
154+
displayName: Migration Tool Tests
155+
pool:
156+
vmImage: windows-latest
157+
steps:
158+
- checkout: self
159+
160+
- pwsh: |
161+
$modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
162+
if (-not (Test-Path -Path $modulePath)) {
163+
$null = New-Item -Path $modulePath -ItemType Directory
164+
}
165+
Save-Module -Name "Pester" -MaximumVersion 4.99 -Path $modulePath -Force
166+
displayName: Install Pester
167+
168+
- pwsh: |
169+
$modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
170+
$env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath
171+
$results = Invoke-Pester -Path '$(Build.SourcesDirectory)/tool/migration/Tests' -PassThru
172+
if ($results.FailedCount -gt 0) {
173+
throw "$($results.FailedCount) migration tool test(s) failed."
174+
}
175+
displayName: Run migration tool Pester tests
176+
177+
- powershell: |
178+
$modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
179+
$env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath
180+
$results = Invoke-Pester -Path '$(Build.SourcesDirectory)/tool/migration/Tests' -PassThru
181+
if ($results.FailedCount -gt 0) {
182+
throw "$($results.FailedCount) migration tool test(s) failed."
183+
}
184+
displayName: Run migration tool Pester tests (Windows PowerShell)

0 commit comments

Comments
 (0)