mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-29 00:34:33 +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:
|
pool:
|
||||||
vmImage: windows-latest
|
vmImage: windows-latest
|
||||||
displayName: Win32-OpenSSH On Windows
|
displayName: Win32-OpenSSH On Windows
|
||||||
|
variables:
|
||||||
|
testFilesDrivePath: '**'
|
||||||
steps:
|
steps:
|
||||||
- powershell: |
|
- powershell: |
|
||||||
$powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell'
|
$powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell'
|
||||||
@ -164,6 +166,17 @@ stages:
|
|||||||
Invoke-OpenSSHTests -OpenSSHBinPath "$env:SystemDrive/OpenSSH"
|
Invoke-OpenSSHTests -OpenSSHBinPath "$env:SystemDrive/OpenSSH"
|
||||||
displayName: Run tests
|
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: |
|
- pwsh: |
|
||||||
Import-Module -Name "$(Build.SourcesDirectory)/contrib/win32/openssh/AzDOBuildTools" -Force
|
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
|
Import-Module $PSScriptRoot\CommonUtils.psm1 -Force
|
||||||
$suite = "Setup"
|
$suite = "Setup"
|
||||||
$tC = 1
|
$tC = 1
|
||||||
@ -535,6 +535,9 @@ Describe "Setup Tests" -Tags "Setup" {
|
|||||||
if (Test-Path -Path $logFolderPath) {
|
if (Test-Path -Path $logFolderPath) {
|
||||||
$logACL = Get-Acl $logFolderPath
|
$logACL = Get-Acl $logFolderPath
|
||||||
}
|
}
|
||||||
|
if ((Get-Service sshd).Status -eq 'Running') {
|
||||||
|
net stop sshd
|
||||||
|
}
|
||||||
}
|
}
|
||||||
AfterAll {
|
AfterAll {
|
||||||
$tC++
|
$tC++
|
||||||
|
Loading…
x
Reference in New Issue
Block a user