Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/azure-pipelines/linux/product-build-linux-test.yml
3520 views
1
parameters:
2
- name: VSCODE_RUN_ELECTRON_TESTS
3
type: boolean
4
- name: VSCODE_RUN_BROWSER_TESTS
5
type: boolean
6
- name: VSCODE_RUN_REMOTE_TESTS
7
type: boolean
8
- name: VSCODE_TEST_ARTIFACT_NAME
9
type: string
10
11
steps:
12
- script: 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
- script: |
19
set -e
20
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
21
ELECTRON_ROOT=.build/electron
22
sudo chown root $APP_ROOT/chrome-sandbox
23
sudo chown root $ELECTRON_ROOT/chrome-sandbox
24
sudo chmod 4755 $APP_ROOT/chrome-sandbox
25
sudo chmod 4755 $ELECTRON_ROOT/chrome-sandbox
26
stat $APP_ROOT/chrome-sandbox
27
stat $ELECTRON_ROOT/chrome-sandbox
28
displayName: Change setuid helper binary permission
29
30
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
31
- script: ./scripts/test.sh --build --tfs "Unit Tests"
32
displayName: �� Run unit tests (Electron)
33
timeoutInMinutes: 15
34
- script: npm run test-node -- --build
35
displayName: �� Run unit tests (node.js)
36
timeoutInMinutes: 15
37
38
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
39
- script: npm run test-browser-no-install -- --build --browser chromium --tfs "Browser Unit Tests"
40
env:
41
DEBUG: "*browser*"
42
displayName: �� Run unit tests (Browser, Chromium)
43
timeoutInMinutes: 15
44
45
- script: |
46
set -e
47
npm run gulp \
48
compile-extension:configuration-editing \
49
compile-extension:css-language-features-server \
50
compile-extension:emmet \
51
compile-extension:git \
52
compile-extension:github-authentication \
53
compile-extension:html-language-features-server \
54
compile-extension:ipynb \
55
compile-extension:notebook-renderers \
56
compile-extension:json-language-features-server \
57
compile-extension:markdown-language-features \
58
compile-extension-media \
59
compile-extension:microsoft-authentication \
60
compile-extension:typescript-language-features \
61
compile-extension:vscode-api-tests \
62
compile-extension:vscode-colorize-tests \
63
compile-extension:vscode-colorize-perf-tests \
64
compile-extension:vscode-test-resolver
65
displayName: Build integration tests
66
67
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
68
- script: |
69
# Figure out the full absolute path of the product we just built
70
# including the remote server and configure the integration tests
71
# to run with these builds instead of running out of sources.
72
set -e
73
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
74
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
75
INTEGRATION_TEST_APP_NAME="$APP_NAME" \
76
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
77
./scripts/test-integration.sh --build --tfs "Integration Tests"
78
env:
79
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
80
displayName: 🧪 Run integration tests (Electron)
81
timeoutInMinutes: 20
82
83
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
84
- script: ./scripts/test-web-integration.sh --browser chromium
85
env:
86
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web
87
displayName: �� Run integration tests (Browser, Chromium)
88
timeoutInMinutes: 20
89
90
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
91
- script: |
92
set -e
93
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
94
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
95
INTEGRATION_TEST_APP_NAME="$APP_NAME" \
96
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
97
./scripts/test-remote-integration.sh
98
env:
99
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
100
displayName: 🧪 Run integration tests (Remote)
101
timeoutInMinutes: 20
102
103
- script: |
104
set -e
105
ps -ef
106
cat /proc/sys/fs/inotify/max_user_watches
107
lsof | wc -l
108
displayName: Diagnostics before smoke test run (processes, max_user_watches, number of opened file handles)
109
continueOnError: true
110
condition: succeededOrFailed()
111
112
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
113
- script: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
114
timeoutInMinutes: 20
115
displayName: �� Run smoke tests (Electron)
116
117
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
118
- script: npm run smoketest-no-compile -- --web --tracing --headless
119
env:
120
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web
121
timeoutInMinutes: 20
122
displayName: �� Run smoke tests (Browser, Chromium)
123
124
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
125
- script: |
126
set -e
127
APP_PATH=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
128
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)" \
129
npm run smoketest-no-compile -- --tracing --remote --build "$APP_PATH"
130
timeoutInMinutes: 20
131
displayName: 🧪 Run smoke tests (Remote)
132
133
- script: |
134
set -e
135
ps -ef
136
cat /proc/sys/fs/inotify/max_user_watches
137
lsof | wc -l
138
displayName: Diagnostics after smoke test run (processes, max_user_watches, number of opened file handles)
139
continueOnError: true
140
condition: succeededOrFailed()
141
142
- template: ../common/publish-artifact.yml@self
143
parameters:
144
targetPath: .build/crashes
145
${{ if eq(parameters.VSCODE_TEST_ARTIFACT_NAME, '') }}:
146
artifactName: crash-dump-linux-$(VSCODE_ARCH)-$(System.JobAttempt)
147
${{ else }}:
148
artifactName: crash-dump-linux-$(VSCODE_ARCH)-${{ parameters.VSCODE_TEST_ARTIFACT_NAME }}-$(System.JobAttempt)
149
displayName: "Publish Crash Reports"
150
sbomEnabled: false
151
continueOnError: true
152
condition: failed()
153
154
# In order to properly symbolify above crash reports
155
# (if any), we need the compiled native modules too
156
- template: ../common/publish-artifact.yml@self
157
parameters:
158
targetPath: node_modules
159
${{ if eq(parameters.VSCODE_TEST_ARTIFACT_NAME, '') }}:
160
artifactName: node-modules-linux-$(VSCODE_ARCH)-$(System.JobAttempt)
161
${{ else }}:
162
artifactName: node-modules-linux-$(VSCODE_ARCH)-${{ parameters.VSCODE_TEST_ARTIFACT_NAME }}-$(System.JobAttempt)
163
displayName: "Publish Node Modules"
164
sbomEnabled: false
165
continueOnError: true
166
condition: failed()
167
168
- template: ../common/publish-artifact.yml@self
169
parameters:
170
targetPath: .build/logs
171
${{ if eq(parameters.VSCODE_TEST_ARTIFACT_NAME, '') }}:
172
artifactName: logs-linux-$(VSCODE_ARCH)-$(System.JobAttempt)
173
${{ else }}:
174
artifactName: logs-linux-$(VSCODE_ARCH)-${{ parameters.VSCODE_TEST_ARTIFACT_NAME }}-$(System.JobAttempt)
175
displayName: "Publish Log Files"
176
sbomEnabled: false
177
continueOnError: true
178
condition: succeededOrFailed()
179
180
- task: PublishTestResults@2
181
displayName: Publish Tests Results
182
inputs:
183
testResultsFiles: "*-results.xml"
184
searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"
185
condition: succeededOrFailed()
186
187