diff --git a/.azdo/ci.yml b/.azdo/ci.yml index 796b4868c..be8d2b761 100644 --- a/.azdo/ci.yml +++ b/.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 # diff --git a/regress/pesterTests/Setup.Tests.ps1 b/regress/pesterTests/Setup.Tests.ps1 index 2c663e394..fcd2e0b1f 100644 --- a/regress/pesterTests/Setup.Tests.ps1 +++ b/regress/pesterTests/Setup.Tests.ps1 @@ -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++