mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-28 16:24:39 +02:00
add publish test results step to CI with pester test fix (#772)
* upload results from setup tests * Update test results file path in CI * Update ci.yml * Update Setup.Tests.ps1 * Add systemDrive variable and update paths * Update variable names in CI configuration * Enable task failure on failed tests * Comment out sshd service stop command to test CI * uncomment part of pester test
This commit is contained in:
parent
8514f78233
commit
a96b3fbae4
13
.azdo/ci.yml
13
.azdo/ci.yml
@ -89,6 +89,8 @@ stages:
|
||||
pool:
|
||||
vmImage: windows-latest
|
||||
displayName: Win32-OpenSSH On Windows
|
||||
variables:
|
||||
testFilesDrivePath: '**'
|
||||
steps:
|
||||
- powershell: |
|
||||
$powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell'
|
||||
@ -164,6 +166,17 @@ stages:
|
||||
Invoke-OpenSSHTests -OpenSSHBinPath "$env:SystemDrive/OpenSSH"
|
||||
displayName: Run tests
|
||||
|
||||
- pwsh: |
|
||||
Write-Host "##vso[task.setvariable variable=testFilesDrivePath;]$env:SystemDrive"
|
||||
displayName: Set variable
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFormat: 'NUnit'
|
||||
testResultsFiles: '$(testFilesDrivePath)/OpenSSHTests/*.xml'
|
||||
failTaskOnFailedTests: true
|
||||
condition: always()
|
||||
|
||||
- pwsh: |
|
||||
Import-Module -Name "$(Build.SourcesDirectory)/contrib/win32/openssh/AzDOBuildTools" -Force
|
||||
#
|
||||
|
@ -1,4 +1,4 @@
|
||||
If ($PSVersiontable.PSVersion.Major -le 2) {$PSScriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path}
|
||||
If ($PSVersiontable.PSVersion.Major -le 2) {$PSScriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path}
|
||||
Import-Module $PSScriptRoot\CommonUtils.psm1 -Force
|
||||
$suite = "Setup"
|
||||
$tC = 1
|
||||
@ -535,6 +535,9 @@ Describe "Setup Tests" -Tags "Setup" {
|
||||
if (Test-Path -Path $logFolderPath) {
|
||||
$logACL = Get-Acl $logFolderPath
|
||||
}
|
||||
if ((Get-Service sshd).Status -eq 'Running') {
|
||||
net stop sshd
|
||||
}
|
||||
}
|
||||
AfterAll {
|
||||
$tC++
|
||||
|
Loading…
x
Reference in New Issue
Block a user