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