Skip to content

Enable VS Code unit tests in Linux CI #4503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .vsts-ci/templates/ci-general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ steps:
workingDirectory: $(Build.SourcesDirectory)/vscode-powershell
pwsh: true

# Necessary on Linux to run VS Code unit tests
- bash: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
displayName: Start X virtual framebuffer
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))

# Tests in particular are run with either PowerShell Core or Windows PowerShell
- task: PowerShell@2
displayName: Run unit tests
Expand All @@ -82,6 +88,8 @@ steps:
Invoke-Build -Configuration Release Test
workingDirectory: $(Build.SourcesDirectory)/vscode-powershell
pwsh: ${{ parameters.pwsh }}
env:
DISPLAY: ':99.0'

- task: PowerShell@2
displayName: Assert PowerShellEditorServices release configuration
Expand Down
2 changes: 1 addition & 1 deletion vscode-powershell.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ task Build Restore, {
#endregion
#region Test tasks

task Test -If (!($env:TF_BUILD -and $global:IsLinux)) Build, {
task Test Build, {
Write-Host "`n### Running extension tests" -ForegroundColor Green
Invoke-BuildExec { & npm run test }
# Reset the state of files modified by tests
Expand Down