Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/azure-pipelines/linux/steps/product-build-linux-test.yml
5313 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
9
steps:
10
- script: npm exec -- npm-run-all2 -lp "electron $(VSCODE_ARCH)" "playwright-install"
11
env:
12
GITHUB_TOKEN: "$(github-distro-mixin-password)"
13
displayName: Download Electron and Playwright
14
retryCountOnTaskFailure: 3
15
16
- script: |
17
set -e
18
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
19
ELECTRON_ROOT=.build/electron
20
sudo chown root $APP_ROOT/chrome-sandbox
21
sudo chown root $ELECTRON_ROOT/chrome-sandbox
22
sudo chmod 4755 $APP_ROOT/chrome-sandbox
23
sudo chmod 4755 $ELECTRON_ROOT/chrome-sandbox
24
stat $APP_ROOT/chrome-sandbox
25
stat $ELECTRON_ROOT/chrome-sandbox
26
displayName: Change setuid helper binary permission
27
28
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
29
- script: ./scripts/test.sh --build --tfs "Unit Tests"
30
env:
31
VSCODE_SKIP_PRELAUNCH: '1'
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
VSCODE_SKIP_PRELAUNCH: '1'
81
displayName: 🧪 Run integration tests (Electron)
82
timeoutInMinutes: 20
83
84
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
85
- script: ./scripts/test-web-integration.sh --browser chromium
86
env:
87
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web
88
displayName: Run integration tests (Browser, Chromium)
89
timeoutInMinutes: 20
90
91
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
92
- script: |
93
set -e
94
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
95
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
96
INTEGRATION_TEST_APP_NAME="$APP_NAME" \
97
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
98
./scripts/test-remote-integration.sh
99
env:
100
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
101
VSCODE_SKIP_PRELAUNCH: '1'
102
displayName: 🧪 Run integration tests (Remote)
103
timeoutInMinutes: 20
104
105
- script: |
106
set -e
107
ps -ef
108
cat /proc/sys/fs/inotify/max_user_watches
109
lsof | wc -l
110
displayName: Diagnostics before smoke test run (processes, max_user_watches, number of opened file handles)
111
continueOnError: true
112
condition: succeededOrFailed()
113
114
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
115
- script: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
116
timeoutInMinutes: 20
117
displayName: Run smoke tests (Electron)
118
119
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
120
- script: npm run smoketest-no-compile -- --web --tracing --headless
121
env:
122
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web
123
timeoutInMinutes: 20
124
displayName: Run smoke tests (Browser, Chromium)
125
126
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
127
- script: |
128
set -e
129
APP_PATH=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
130
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)" \
131
npm run smoketest-no-compile -- --tracing --remote --build "$APP_PATH"
132
timeoutInMinutes: 20
133
displayName: 🧪 Run smoke tests (Remote)
134
135
- script: |
136
set -e
137
ps -ef
138
cat /proc/sys/fs/inotify/max_user_watches
139
lsof | wc -l
140
displayName: Diagnostics after smoke test run (processes, max_user_watches, number of opened file handles)
141
continueOnError: true
142
condition: succeededOrFailed()
143
144
- task: PublishTestResults@2
145
displayName: Publish Tests Results
146
inputs:
147
testResultsFiles: "*-results.xml"
148
searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"
149
condition: succeededOrFailed()
150
151