2022-06-14 14:37:10 +08:00
|
|
|
parameters:
|
|
|
|
- name: VSCODE_QUALITY
|
|
|
|
type: string
|
|
|
|
- name: VSCODE_RUN_UNIT_TESTS
|
|
|
|
type: boolean
|
|
|
|
- name: VSCODE_RUN_INTEGRATION_TESTS
|
|
|
|
type: boolean
|
|
|
|
- name: VSCODE_RUN_SMOKE_TESTS
|
|
|
|
type: boolean
|
|
|
|
|
|
|
|
steps:
|
2024-04-30 20:57:13 +08:00
|
|
|
- script: yarn npm-run-all -lp "electron $(VSCODE_ARCH)" "playwright-install"
|
2022-06-14 14:37:10 +08:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "$(github-distro-mixin-password)"
|
|
|
|
displayName: Download Electron and Playwright
|
2024-04-30 20:57:13 +08:00
|
|
|
retryCountOnTaskFailure: 3
|
2022-06-14 14:37:10 +08:00
|
|
|
|
|
|
|
- ${{ if eq(parameters.VSCODE_RUN_UNIT_TESTS, true) }}:
|
2024-04-30 20:57:13 +08:00
|
|
|
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
|
|
|
|
- script: ./scripts/test.sh --tfs "Unit Tests"
|
|
|
|
displayName: Run unit tests (Electron)
|
|
|
|
timeoutInMinutes: 15
|
|
|
|
|
|
|
|
- script: yarn test-node
|
|
|
|
displayName: Run unit tests (node.js)
|
|
|
|
timeoutInMinutes: 15
|
|
|
|
|
|
|
|
- script: yarn test-browser-no-install --sequential --browser chromium --browser webkit --tfs "Browser Unit Tests"
|
|
|
|
env:
|
|
|
|
DEBUG: "*browser*"
|
|
|
|
displayName: Run unit tests (Browser, Chromium & Webkit)
|
|
|
|
timeoutInMinutes: 30
|
|
|
|
|
|
|
|
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
|
|
|
|
- script: ./scripts/test.sh --build --tfs "Unit Tests"
|
|
|
|
displayName: Run unit tests (Electron)
|
|
|
|
timeoutInMinutes: 15
|
|
|
|
|
|
|
|
- script: yarn test-node --build
|
|
|
|
displayName: Run unit tests (node.js)
|
|
|
|
timeoutInMinutes: 15
|
|
|
|
|
|
|
|
- script: yarn test-browser-no-install --sequential --build --browser chromium --browser webkit --tfs "Browser Unit Tests"
|
|
|
|
env:
|
|
|
|
DEBUG: "*browser*"
|
|
|
|
displayName: Run unit tests (Browser, Chromium & Webkit)
|
|
|
|
timeoutInMinutes: 30
|
2022-06-14 14:37:10 +08:00
|
|
|
|
|
|
|
- ${{ if eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true) }}:
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
yarn gulp \
|
2024-04-30 20:57:13 +08:00
|
|
|
compile-extension:configuration-editing \
|
2022-06-14 14:37:10 +08:00
|
|
|
compile-extension:css-language-features-server \
|
|
|
|
compile-extension:emmet \
|
|
|
|
compile-extension:git \
|
|
|
|
compile-extension:github-authentication \
|
|
|
|
compile-extension:html-language-features-server \
|
|
|
|
compile-extension:ipynb \
|
2024-04-30 20:57:13 +08:00
|
|
|
compile-extension:notebook-renderers \
|
2022-06-14 14:37:10 +08:00
|
|
|
compile-extension:json-language-features-server \
|
2024-04-30 20:57:13 +08:00
|
|
|
compile-extension:markdown-language-features-server \
|
2022-06-14 14:37:10 +08:00
|
|
|
compile-extension:markdown-language-features \
|
|
|
|
compile-extension-media \
|
|
|
|
compile-extension:microsoft-authentication \
|
|
|
|
compile-extension:typescript-language-features \
|
|
|
|
compile-extension:vscode-api-tests \
|
|
|
|
compile-extension:vscode-colorize-tests \
|
|
|
|
compile-extension:vscode-test-resolver
|
|
|
|
displayName: Build integration tests
|
|
|
|
|
2024-04-30 20:57:13 +08:00
|
|
|
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
|
|
|
|
- script: ./scripts/test-integration.sh --tfs "Integration Tests"
|
|
|
|
displayName: Run integration tests (Electron)
|
|
|
|
timeoutInMinutes: 20
|
|
|
|
|
|
|
|
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
|
|
|
|
- script: |
|
|
|
|
# Figure out the full absolute path of the product we just built
|
|
|
|
# including the remote server and configure the integration tests
|
|
|
|
# to run with these builds instead of running out of sources.
|
|
|
|
set -e
|
|
|
|
APP_ROOT="$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)"
|
|
|
|
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
|
|
|
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
|
|
|
|
./scripts/test-integration.sh --build --tfs "Integration Tests"
|
|
|
|
env:
|
|
|
|
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
|
|
|
|
displayName: Run integration tests (Electron)
|
|
|
|
timeoutInMinutes: 20
|
|
|
|
|
|
|
|
- script: ./scripts/test-web-integration.sh --browser webkit
|
|
|
|
env:
|
|
|
|
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)-web
|
|
|
|
displayName: Run integration tests (Browser, Webkit)
|
|
|
|
timeoutInMinutes: 20
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
|
|
|
|
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
|
|
|
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
|
|
|
|
./scripts/test-remote-integration.sh
|
|
|
|
env:
|
|
|
|
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
|
|
|
|
displayName: Run integration tests (Remote)
|
|
|
|
timeoutInMinutes: 20
|
2022-06-14 14:37:10 +08:00
|
|
|
|
|
|
|
- ${{ if eq(parameters.VSCODE_RUN_SMOKE_TESTS, true) }}:
|
2024-04-30 20:57:13 +08:00
|
|
|
- script: ps -ef
|
2022-06-14 14:37:10 +08:00
|
|
|
displayName: Diagnostics before smoke test run
|
|
|
|
continueOnError: true
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
|
2024-04-30 20:57:13 +08:00
|
|
|
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
|
|
|
|
- script: yarn --cwd test/smoke compile
|
|
|
|
displayName: Compile smoke tests
|
|
|
|
|
|
|
|
- script: yarn gulp compile-extension-media
|
|
|
|
displayName: Compile extensions for smoke tests
|
|
|
|
|
|
|
|
- script: yarn smoketest-no-compile --tracing
|
|
|
|
timeoutInMinutes: 20
|
|
|
|
displayName: Run smoke tests (Electron)
|
|
|
|
|
|
|
|
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
|
|
|
|
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
|
|
|
yarn smoketest-no-compile --tracing --build "$APP_ROOT/$APP_NAME"
|
|
|
|
timeoutInMinutes: 20
|
|
|
|
displayName: Run smoke tests (Electron)
|
|
|
|
|
|
|
|
- script: yarn smoketest-no-compile --web --tracing --headless
|
|
|
|
env:
|
|
|
|
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)-web
|
|
|
|
timeoutInMinutes: 20
|
|
|
|
displayName: Run smoke tests (Browser, Chromium)
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
yarn gulp compile-extension:vscode-test-resolver
|
|
|
|
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
|
|
|
|
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
|
|
|
yarn smoketest-no-compile --tracing --remote --build "$APP_ROOT/$APP_NAME"
|
|
|
|
env:
|
|
|
|
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
|
|
|
|
timeoutInMinutes: 20
|
|
|
|
displayName: Run smoke tests (Remote)
|
|
|
|
|
|
|
|
- script: ps -ef
|
2022-06-14 14:37:10 +08:00
|
|
|
displayName: Diagnostics after smoke test run
|
|
|
|
continueOnError: true
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
|
2024-04-30 20:57:13 +08:00
|
|
|
- ${{ if or(eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true), eq(parameters.VSCODE_RUN_SMOKE_TESTS, true)) }}:
|
|
|
|
- task: PublishPipelineArtifact@0
|
|
|
|
inputs:
|
|
|
|
targetPath: .build/crashes
|
|
|
|
${{ if and(eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true), eq(parameters.VSCODE_RUN_SMOKE_TESTS, false)) }}:
|
|
|
|
artifactName: crash-dump-macos-$(VSCODE_ARCH)-integration-$(System.JobAttempt)
|
|
|
|
${{ elseif and(eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, false), eq(parameters.VSCODE_RUN_SMOKE_TESTS, true)) }}:
|
|
|
|
artifactName: crash-dump-macos-$(VSCODE_ARCH)-smoke-$(System.JobAttempt)
|
|
|
|
${{ else }}:
|
|
|
|
artifactName: crash-dump-macos-$(VSCODE_ARCH)-$(System.JobAttempt)
|
|
|
|
displayName: "Publish Crash Reports"
|
|
|
|
continueOnError: true
|
|
|
|
condition: failed()
|
2022-06-14 14:37:10 +08:00
|
|
|
|
2024-04-30 20:57:13 +08:00
|
|
|
# In order to properly symbolify above crash reports
|
|
|
|
# (if any), we need the compiled native modules too
|
|
|
|
- task: PublishPipelineArtifact@0
|
|
|
|
inputs:
|
|
|
|
targetPath: node_modules
|
|
|
|
${{ if and(eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true), eq(parameters.VSCODE_RUN_SMOKE_TESTS, false)) }}:
|
|
|
|
artifactName: node-modules-macos-$(VSCODE_ARCH)-integration-$(System.JobAttempt)
|
|
|
|
${{ elseif and(eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, false), eq(parameters.VSCODE_RUN_SMOKE_TESTS, true)) }}:
|
|
|
|
artifactName: node-modules-macos-$(VSCODE_ARCH)-smoke-$(System.JobAttempt)
|
|
|
|
${{ else }}:
|
|
|
|
artifactName: node-modules-macos-$(VSCODE_ARCH)-$(System.JobAttempt)
|
|
|
|
displayName: "Publish Node Modules"
|
|
|
|
continueOnError: true
|
|
|
|
condition: failed()
|
2022-06-14 14:37:10 +08:00
|
|
|
|
2024-04-30 20:57:13 +08:00
|
|
|
- task: PublishPipelineArtifact@0
|
|
|
|
inputs:
|
|
|
|
targetPath: .build/logs
|
|
|
|
${{ if and(eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true), eq(parameters.VSCODE_RUN_SMOKE_TESTS, false)) }}:
|
|
|
|
artifactName: logs-macos-$(VSCODE_ARCH)-integration-$(System.JobAttempt)
|
|
|
|
${{ elseif and(eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, false), eq(parameters.VSCODE_RUN_SMOKE_TESTS, true)) }}:
|
|
|
|
artifactName: logs-macos-$(VSCODE_ARCH)-smoke-$(System.JobAttempt)
|
|
|
|
${{ else }}:
|
|
|
|
artifactName: logs-macos-$(VSCODE_ARCH)-$(System.JobAttempt)
|
|
|
|
displayName: "Publish Log Files"
|
|
|
|
continueOnError: true
|
|
|
|
condition: succeededOrFailed()
|
2022-06-14 14:37:10 +08:00
|
|
|
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: Publish Tests Results
|
|
|
|
inputs:
|
|
|
|
testResultsFiles: "*-results.xml"
|
|
|
|
searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"
|
|
|
|
condition: succeededOrFailed()
|