Path: blob/main/build/azure-pipelines/win32/steps/product-build-win32-test.yml
5418 views
parameters:1- name: VSCODE_ARCH2type: string3- name: VSCODE_RUN_ELECTRON_TESTS4type: boolean5- name: VSCODE_RUN_BROWSER_TESTS6type: boolean7- name: VSCODE_RUN_REMOTE_TESTS8type: boolean910steps:11- powershell: npm exec -- npm-run-all2 -lp "electron $(VSCODE_ARCH)" "playwright-install"12env:13GITHUB_TOKEN: "$(github-distro-mixin-password)"14displayName: Download Electron and Playwright15retryCountOnTaskFailure: 31617- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:18- powershell: .\scripts\test.bat --build --tfs "Unit Tests"19env:20VSCODE_SKIP_PRELAUNCH: '1'21displayName: �� Run unit tests (Electron)22timeoutInMinutes: 1523- powershell: npm run test-node -- --build24displayName: �� Run unit tests (node.js)25timeoutInMinutes: 152627- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:28- powershell: npm run test-browser-no-install -- --build --browser chromium --tfs "Browser Unit Tests"29displayName: �� Run unit tests (Browser, Chromium)30timeoutInMinutes: 203132- powershell: |33. build/azure-pipelines/win32/exec.ps134$ErrorActionPreference = "Stop"35exec { npm run gulp `36compile-extension:configuration-editing `37compile-extension:css-language-features-server `38compile-extension:emmet `39compile-extension:git `40compile-extension:github-authentication `41compile-extension:html-language-features-server `42compile-extension:ipynb `43compile-extension:notebook-renderers `44compile-extension:json-language-features-server `45compile-extension:markdown-language-features `46compile-extension-media `47compile-extension:microsoft-authentication `48compile-extension:typescript-language-features `49compile-extension:vscode-api-tests `50compile-extension:vscode-colorize-tests `51compile-extension:vscode-colorize-perf-tests `52compile-extension:vscode-test-resolver `53}54displayName: Build integration tests5556- powershell: .\build\azure-pipelines\win32\listprocesses.bat57displayName: Diagnostics before integration test runs58continueOnError: true59condition: succeededOrFailed()6061- powershell: |62# Copy client, server and web builds to a separate test directory, to avoid Access Denied errors in codesign63. build/azure-pipelines/win32/exec.ps164$ErrorActionPreference = "Stop"65$TestDir = "$(agent.builddirectory)\test"66New-Item -ItemType Directory -Path $TestDir -Force67Copy-Item -Path "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" -Destination "$TestDir\VSCode-win32-$(VSCODE_ARCH)" -Recurse -Force68Copy-Item -Path "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)" -Destination "$TestDir\vscode-server-win32-$(VSCODE_ARCH)" -Recurse -Force69Copy-Item -Path "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)-web" -Destination "$TestDir\vscode-server-win32-$(VSCODE_ARCH)-web" -Recurse -Force70displayName: Copy builds to test directory7172- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:73- powershell: |74# Figure out the full absolute path of the product we just built75# including the remote server and configure the integration tests76# to run with these builds instead of running out of sources.77. build/azure-pipelines/win32/exec.ps178$ErrorActionPreference = "Stop"79$AppRoot = "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"80$ProductJsonPath = (Get-ChildItem -Path "$AppRoot" -Name "product.json" -Recurse | Select-Object -First 1)81$AppProductJson = Get-Content -Raw -Path "$AppRoot\$ProductJsonPath" | ConvertFrom-Json82$AppNameShort = $AppProductJson.nameShort83$env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"84$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)"85exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" }86env:87VSCODE_SKIP_PRELAUNCH: '1'88displayName: 🧪 Run integration tests (Electron)89timeoutInMinutes: 209091- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:92- powershell: |93. build/azure-pipelines/win32/exec.ps194$ErrorActionPreference = "Stop"95$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)-web"96exec { .\scripts\test-web-integration.bat --browser firefox }97displayName: 🧪 Run integration tests (Browser, Firefox)98timeoutInMinutes: 2099100- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:101- powershell: |102. build/azure-pipelines/win32/exec.ps1103$ErrorActionPreference = "Stop"104$AppRoot = "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"105$ProductJsonPath = (Get-ChildItem -Path "$AppRoot" -Name "product.json" -Recurse | Select-Object -First 1)106$AppProductJson = Get-Content -Raw -Path "$AppRoot\$ProductJsonPath" | ConvertFrom-Json107$AppNameShort = $AppProductJson.nameShort108$env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"109$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)"110exec { .\scripts\test-remote-integration.bat }111env:112VSCODE_SKIP_PRELAUNCH: '1'113displayName: 🧪 Run integration tests (Remote)114timeoutInMinutes: 20115116- powershell: .\build\azure-pipelines\win32\listprocesses.bat117displayName: Diagnostics after integration test runs118continueOnError: true119condition: succeededOrFailed()120121- powershell: .\build\azure-pipelines\win32\listprocesses.bat122displayName: Diagnostics before smoke test run123continueOnError: true124condition: succeededOrFailed()125126- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:127- powershell: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"128displayName: �� Run smoke tests (Electron)129timeoutInMinutes: 20130131- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:132- powershell: npm run smoketest-no-compile -- --web --tracing --headless133env:134VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)-web135displayName: �� Run smoke tests (Browser, Chromium)136timeoutInMinutes: 20137138- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:139- powershell: npm run smoketest-no-compile -- --tracing --remote --build "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"140env:141VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)142displayName: �� Run smoke tests (Remote)143timeoutInMinutes: 20144145- powershell: .\build\azure-pipelines\win32\listprocesses.bat146displayName: Diagnostics after smoke test run147continueOnError: true148condition: succeededOrFailed()149150- task: PublishTestResults@2151displayName: Publish Tests Results152inputs:153testResultsFiles: "*-results.xml"154searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"155condition: succeededOrFailed()156157158