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
4774 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
displayName: Run unit tests (Electron)
31
timeoutInMinutes: 15
32
- script: npm run test-node -- --build
33
displayName: Run unit tests (node.js)
34
timeoutInMinutes: 15
35
36
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
37
- script: npm run test-browser-no-install -- --build --browser chromium --tfs "Browser Unit Tests"
38
env:
39
DEBUG: "*browser*"
40
displayName: Run unit tests (Browser, Chromium)
41
timeoutInMinutes: 15
42
43
- script: |
44
set -e
45
npm run gulp \
46
compile-extension:configuration-editing \
47
compile-extension:css-language-features-server \
48
compile-extension:emmet \
49
compile-extension:git \
50
compile-extension:github-authentication \
51
compile-extension:html-language-features-server \
52
compile-extension:ipynb \
53
compile-extension:notebook-renderers \
54
compile-extension:json-language-features-server \
55
compile-extension:markdown-language-features \
56
compile-extension-media \
57
compile-extension:microsoft-authentication \
58
compile-extension:typescript-language-features \
59
compile-extension:vscode-api-tests \
60
compile-extension:vscode-colorize-tests \
61
compile-extension:vscode-colorize-perf-tests \
62
compile-extension:vscode-test-resolver
63
displayName: Build integration tests
64
65
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
66
- script: |
67
# Figure out the full absolute path of the product we just built
68
# including the remote server and configure the integration tests
69
# to run with these builds instead of running out of sources.
70
set -e
71
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
72
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
73
INTEGRATION_TEST_APP_NAME="$APP_NAME" \
74
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
75
./scripts/test-integration.sh --build --tfs "Integration Tests"
76
env:
77
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
78
displayName: 🧪 Run integration tests (Electron)
79
timeoutInMinutes: 20
80
81
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
82
- script: ./scripts/test-web-integration.sh --browser chromium
83
env:
84
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web
85
displayName: Run integration tests (Browser, Chromium)
86
timeoutInMinutes: 20
87
88
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
89
- script: |
90
set -e
91
APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
92
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
93
INTEGRATION_TEST_APP_NAME="$APP_NAME" \
94
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
95
./scripts/test-remote-integration.sh
96
env:
97
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
98
displayName: 🧪 Run integration tests (Remote)
99
timeoutInMinutes: 20
100
101
- script: |
102
set -e
103
ps -ef
104
cat /proc/sys/fs/inotify/max_user_watches
105
lsof | wc -l
106
displayName: Diagnostics before smoke test run (processes, max_user_watches, number of opened file handles)
107
continueOnError: true
108
condition: succeededOrFailed()
109
110
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
111
- script: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
112
timeoutInMinutes: 20
113
displayName: Run smoke tests (Electron)
114
115
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
116
- script: npm run smoketest-no-compile -- --web --tracing --headless
117
env:
118
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web
119
timeoutInMinutes: 20
120
displayName: Run smoke tests (Browser, Chromium)
121
122
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
123
- script: |
124
set -e
125
APP_PATH=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
126
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)" \
127
npm run smoketest-no-compile -- --tracing --remote --build "$APP_PATH"
128
timeoutInMinutes: 20
129
displayName: 🧪 Run smoke tests (Remote)
130
131
- script: |
132
set -e
133
ps -ef
134
cat /proc/sys/fs/inotify/max_user_watches
135
lsof | wc -l
136
displayName: Diagnostics after smoke test run (processes, max_user_watches, number of opened file handles)
137
continueOnError: true
138
condition: succeededOrFailed()
139
140
- task: PublishTestResults@2
141
displayName: Publish Tests Results
142
inputs:
143
testResultsFiles: "*-results.xml"
144
searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"
145
condition: succeededOrFailed()
146
147