Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/azure-pipelines/darwin/steps/product-build-darwin-test.yml
5390 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
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
17
- script: ./scripts/test.sh --build --tfs "Unit Tests"
18
env:
19
VSCODE_SKIP_PRELAUNCH: '1'
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
ProductJsonPath=$(find "$APP_ROOT" -name "product.json" -type f | head -n 1)
64
BINARY_NAME=$(jq -r '.nameShort' "$ProductJsonPath")
65
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/$BINARY_NAME" \
66
./scripts/test-integration.sh --build --tfs "Integration Tests"
67
env:
68
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
69
VSCODE_SKIP_PRELAUNCH: '1'
70
displayName: 🧪 Run integration tests (Electron)
71
timeoutInMinutes: 20
72
73
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
74
- script: ./scripts/test-web-integration.sh --browser webkit
75
env:
76
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)-web
77
displayName: Run integration tests (Browser, Webkit)
78
timeoutInMinutes: 20
79
80
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
81
- script: |
82
set -e
83
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
84
APP_NAME="`ls $APP_ROOT | head -n 1`"
85
ProductJsonPath=$(find "$APP_ROOT" -name "product.json" -type f | head -n 1)
86
BINARY_NAME=$(jq -r '.nameShort' "$ProductJsonPath")
87
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/$BINARY_NAME" \
88
./scripts/test-remote-integration.sh
89
env:
90
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
91
VSCODE_SKIP_PRELAUNCH: '1'
92
displayName: 🧪 Run integration tests (Remote)
93
timeoutInMinutes: 20
94
95
- script: ps -ef
96
displayName: Diagnostics before smoke test run
97
continueOnError: true
98
condition: succeededOrFailed()
99
100
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
101
- script: |
102
set -e
103
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
104
APP_NAME="`ls $APP_ROOT | head -n 1`"
105
npm run smoketest-no-compile -- --tracing --build "$APP_ROOT/$APP_NAME"
106
timeoutInMinutes: 20
107
displayName: 🧪 Run smoke tests (Electron)
108
109
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
110
- script: npm run smoketest-no-compile -- --web --tracing --headless
111
env:
112
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)-web
113
timeoutInMinutes: 20
114
displayName: Run smoke tests (Browser, Chromium)
115
116
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
117
- script: |
118
set -e
119
npm run gulp compile-extension:vscode-test-resolver
120
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
121
APP_NAME="`ls $APP_ROOT | head -n 1`"
122
npm run smoketest-no-compile -- --tracing --remote --build "$APP_ROOT/$APP_NAME"
123
env:
124
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
125
timeoutInMinutes: 20
126
displayName: 🧪 Run smoke tests (Remote)
127
128
- script: ps -ef
129
displayName: Diagnostics after smoke test run
130
continueOnError: true
131
condition: succeededOrFailed()
132
133
- task: PublishTestResults@2
134
displayName: Publish Tests Results
135
inputs:
136
testResultsFiles: "*-results.xml"
137
searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"
138
condition: succeededOrFailed()
139
140