Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/azure-pipelines/win32/product-build-win32-test.yml
3520 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-all -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
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
80
$AppNameShort = $AppProductJson.nameShort
81
$env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"
82
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)"
83
exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" }
84
displayName: 🧪 Run integration tests (Electron)
85
timeoutInMinutes: 20
86
87
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
88
- powershell: |
89
. build/azure-pipelines/win32/exec.ps1
90
$ErrorActionPreference = "Stop"
91
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)-web"
92
exec { .\scripts\test-web-integration.bat --browser firefox }
93
displayName: 🧪 Run integration tests (Browser, Firefox)
94
timeoutInMinutes: 20
95
96
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
97
- powershell: |
98
. build/azure-pipelines/win32/exec.ps1
99
$ErrorActionPreference = "Stop"
100
$AppRoot = "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
101
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
102
$AppNameShort = $AppProductJson.nameShort
103
$env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"
104
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)"
105
exec { .\scripts\test-remote-integration.bat }
106
displayName: 🧪 Run integration tests (Remote)
107
timeoutInMinutes: 20
108
109
- powershell: .\build\azure-pipelines\win32\listprocesses.bat
110
displayName: Diagnostics after integration test runs
111
continueOnError: true
112
condition: succeededOrFailed()
113
114
- powershell: .\build\azure-pipelines\win32\listprocesses.bat
115
displayName: Diagnostics before smoke test run
116
continueOnError: true
117
condition: succeededOrFailed()
118
119
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
120
- powershell: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
121
displayName: Run smoke tests (Electron)
122
timeoutInMinutes: 20
123
124
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
125
- powershell: npm run smoketest-no-compile -- --web --tracing --headless
126
env:
127
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)-web
128
displayName: Run smoke tests (Browser, Chromium)
129
timeoutInMinutes: 20
130
131
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
132
- powershell: npm run smoketest-no-compile -- --tracing --remote --build "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
133
env:
134
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)
135
displayName: Run smoke tests (Remote)
136
timeoutInMinutes: 20
137
138
- powershell: .\build\azure-pipelines\win32\listprocesses.bat
139
displayName: Diagnostics after smoke test run
140
continueOnError: true
141
condition: succeededOrFailed()
142
143
- task: PublishTestResults@2
144
displayName: Publish Tests Results
145
inputs:
146
testResultsFiles: "*-results.xml"
147
searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"
148
condition: succeededOrFailed()
149
150