Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/azure-pipelines/win32/steps/product-build-win32-test.yml
4774 views
1
parameters:
2
- name: VSCODE_ARCH
3
type: string
4
- name: VSCODE_RUN_ELECTRON_TESTS
5
type: boolean
6
- name: VSCODE_RUN_BROWSER_TESTS
7
type: boolean
8
- name: VSCODE_RUN_REMOTE_TESTS
9
type: boolean
10
11
steps:
12
- powershell: npm exec -- npm-run-all2 -lp "electron $(VSCODE_ARCH)" "playwright-install"
13
env:
14
GITHUB_TOKEN: "$(github-distro-mixin-password)"
15
displayName: Download Electron and Playwright
16
retryCountOnTaskFailure: 3
17
18
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
19
- powershell: .\scripts\test.bat --build --tfs "Unit Tests"
20
displayName: Run unit tests (Electron)
21
timeoutInMinutes: 15
22
- powershell: npm run test-node -- --build
23
displayName: Run unit tests (node.js)
24
timeoutInMinutes: 15
25
26
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
27
- powershell: npm run test-browser-no-install -- --build --browser chromium --tfs "Browser Unit Tests"
28
displayName: Run unit tests (Browser, Chromium)
29
timeoutInMinutes: 20
30
31
- powershell: |
32
. build/azure-pipelines/win32/exec.ps1
33
$ErrorActionPreference = "Stop"
34
exec { npm run gulp `
35
compile-extension:configuration-editing `
36
compile-extension:css-language-features-server `
37
compile-extension:emmet `
38
compile-extension:git `
39
compile-extension:github-authentication `
40
compile-extension:html-language-features-server `
41
compile-extension:ipynb `
42
compile-extension:notebook-renderers `
43
compile-extension:json-language-features-server `
44
compile-extension:markdown-language-features `
45
compile-extension-media `
46
compile-extension:microsoft-authentication `
47
compile-extension:typescript-language-features `
48
compile-extension:vscode-api-tests `
49
compile-extension:vscode-colorize-tests `
50
compile-extension:vscode-colorize-perf-tests `
51
compile-extension:vscode-test-resolver `
52
}
53
displayName: Build integration tests
54
55
- powershell: .\build\azure-pipelines\win32\listprocesses.bat
56
displayName: Diagnostics before integration test runs
57
continueOnError: true
58
condition: succeededOrFailed()
59
60
- powershell: |
61
# Copy client, server and web builds to a separate test directory, to avoid Access Denied errors in codesign
62
. build/azure-pipelines/win32/exec.ps1
63
$ErrorActionPreference = "Stop"
64
$TestDir = "$(agent.builddirectory)\test"
65
New-Item -ItemType Directory -Path $TestDir -Force
66
Copy-Item -Path "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" -Destination "$TestDir\VSCode-win32-$(VSCODE_ARCH)" -Recurse -Force
67
Copy-Item -Path "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)" -Destination "$TestDir\vscode-server-win32-$(VSCODE_ARCH)" -Recurse -Force
68
Copy-Item -Path "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)-web" -Destination "$TestDir\vscode-server-win32-$(VSCODE_ARCH)-web" -Recurse -Force
69
displayName: Copy builds to test directory
70
71
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
72
- powershell: |
73
# Figure out the full absolute path of the product we just built
74
# including the remote server and configure the integration tests
75
# to run with these builds instead of running out of sources.
76
. build/azure-pipelines/win32/exec.ps1
77
$ErrorActionPreference = "Stop"
78
$AppRoot = "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
79
$ProductJsonPath = (Get-ChildItem -Path "$AppRoot" -Name "product.json" -Recurse | Select-Object -First 1)
80
$AppProductJson = Get-Content -Raw -Path "$AppRoot\$ProductJsonPath" | ConvertFrom-Json
81
$AppNameShort = $AppProductJson.nameShort
82
$env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"
83
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)"
84
exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" }
85
displayName: 🧪 Run integration tests (Electron)
86
timeoutInMinutes: 20
87
88
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
89
- powershell: |
90
. build/azure-pipelines/win32/exec.ps1
91
$ErrorActionPreference = "Stop"
92
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)-web"
93
exec { .\scripts\test-web-integration.bat --browser firefox }
94
displayName: 🧪 Run integration tests (Browser, Firefox)
95
timeoutInMinutes: 20
96
97
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
98
- powershell: |
99
. build/azure-pipelines/win32/exec.ps1
100
$ErrorActionPreference = "Stop"
101
$AppRoot = "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
102
$ProductJsonPath = (Get-ChildItem -Path "$AppRoot" -Name "product.json" -Recurse | Select-Object -First 1)
103
$AppProductJson = Get-Content -Raw -Path "$AppRoot\$ProductJsonPath" | ConvertFrom-Json
104
$AppNameShort = $AppProductJson.nameShort
105
$env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"
106
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)"
107
exec { .\scripts\test-remote-integration.bat }
108
displayName: 🧪 Run integration tests (Remote)
109
timeoutInMinutes: 20
110
111
- powershell: .\build\azure-pipelines\win32\listprocesses.bat
112
displayName: Diagnostics after integration test runs
113
continueOnError: true
114
condition: succeededOrFailed()
115
116
- powershell: .\build\azure-pipelines\win32\listprocesses.bat
117
displayName: Diagnostics before smoke test run
118
continueOnError: true
119
condition: succeededOrFailed()
120
121
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
122
- powershell: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
123
displayName: Run smoke tests (Electron)
124
timeoutInMinutes: 20
125
126
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
127
- powershell: npm run smoketest-no-compile -- --web --tracing --headless
128
env:
129
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)-web
130
displayName: Run smoke tests (Browser, Chromium)
131
timeoutInMinutes: 20
132
133
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
134
- powershell: npm run smoketest-no-compile -- --tracing --remote --build "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
135
env:
136
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)
137
displayName: Run smoke tests (Remote)
138
timeoutInMinutes: 20
139
140
- powershell: .\build\azure-pipelines\win32\listprocesses.bat
141
displayName: Diagnostics after smoke test run
142
continueOnError: true
143
condition: succeededOrFailed()
144
145
- task: PublishTestResults@2
146
displayName: Publish Tests Results
147
inputs:
148
testResultsFiles: "*-results.xml"
149
searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"
150
condition: succeededOrFailed()
151
152