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