PowerShell/.vsts-ci/sshremoting-tests.yml
Paul Higinbotham 5f46605a21
Add Ubuntu SSH remoting tests CI (#12033)
* Add SSH remoting CI

* Fix typo

* Add install git to Ubuntu CI

* Update .vsts-ci/sshremoting-tests.yml

Co-Authored-By: Aditya Patwardhan <adityap@microsoft.com>

* Fix install git 1

* Add missing tools module import

* Change ubuntu service restart

* Update ssh install

* fix module path

* fix module path

* change module import

* Add tracing

* Add service start retry

* Fix service restart

* Fix options restore

* Fix Restore-PSOptions path

* Fix Pester test output

* fix typo

* Fix test output path

* Debug 1

* Debug 2

* Debug 3

* Change results path

* Fix result publish to use build artifacts directory

* Add more New-PSSession tests

* Remove User test

* Remove env:USER

* Add API tests

* Fix type for Subsytem API test

* Update .vsts-ci/sshremoting-tests.yml

Co-Authored-By: Travis Plunk <travis.plunk@microsoft.com>

* Update .vsts-ci/sshremoting-tests.yml

Co-Authored-By: Travis Plunk <travis.plunk@microsoft.com>

* Update .vsts-ci/sshremoting-tests.yml

Co-Authored-By: Travis Plunk <travis.plunk@microsoft.com>

* Apply suggestions from code review

Co-authored-by: Aditya Patwardhan <adityap@microsoft.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
2020-03-11 14:45:14 -07:00

87 lines
2.3 KiB
YAML

name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)
trigger:
# Batch merge builds together while a merge build is running
batch: true
branches:
include:
- master
- release*
- feature*
paths:
include:
- '/src/System.Management.Automation/engine/*'
- '/test/SSHRemoting/*'
pr:
branches:
include:
- master
- release*
- feature*
paths:
include:
- '/src/System.Management.Automation/engine/*'
- '/test/SSHRemoting/*'
variables:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
# Avoid expensive initialization of dotnet cli, see: https://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
__SuppressAnsiEscapeSequences: 1
resources:
- repo: self
clean: true
jobs:
- job: SSHRemotingTests
container: mcr.microsoft.com/powershell/test-deps:ubuntu-18.04
displayName: SSH Remoting Tests
steps:
- pwsh: |
Get-ChildItem -Path env:
displayName: Capture Environment
condition: succeededOrFailed()
- pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
displayName: Set Build Name for Non-PR
condition: ne(variables['Build.Reason'], 'PullRequest')
- template: /tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml
- pwsh: |
sudo apt-get update
sudo apt-get install -y git
displayName: Install Github
condition: succeeded()
- pwsh: |
Import-Module .\tools\ci.psm1
Invoke-CIInstall -SkipUser
displayName: Bootstrap
condition: succeededOrFailed()
- pwsh: |
Import-Module .\tools\ci.psm1
Invoke-CIBuild
displayName: Build
condition: succeeded()
- pwsh: |
Import-Module .\tools\ci.psm1
Restore-PSOptions
$options = (Get-PSOptions)
Import-Module .\test\tools\Modules\HelpersRemoting
Install-SSHRemoting -PowerShellFilePath $options.Output
displayName: Install SSH Remoting
condition: succeeded()
- pwsh: |
Import-Module .\tools\ci.psm1
Restore-PSOptions
$options = (Get-PSOptions)
Import-Module .\build.psm1
Start-PSPester -Path test/SSHRemoting -powershell $options.Output -OutputFile "$PWD/sshTestResults.xml"
displayName: Test
condition: succeeded()