Path: blob/main/build/azure-pipelines/darwin/product-build-darwin-test.yml
3520 views
parameters:1- name: VSCODE_RUN_ELECTRON_TESTS2type: boolean3- name: VSCODE_RUN_BROWSER_TESTS4type: boolean5- name: VSCODE_RUN_REMOTE_TESTS6type: boolean7- name: VSCODE_TEST_ARTIFACT_NAME8type: string910steps:11- script: npm exec -- npm-run-all -lp "electron $(VSCODE_ARCH)" "playwright-install"12env:13GITHUB_TOKEN: "$(github-distro-mixin-password)"14displayName: Download Electron and Playwright15retryCountOnTaskFailure: 31617- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:18- script: ./scripts/test.sh --build --tfs "Unit Tests"19displayName: �� Run unit tests (Electron)20timeoutInMinutes: 1521- script: npm run test-node -- --build22displayName: �� Run unit tests (node.js)23timeoutInMinutes: 152425- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:26- script: npm run test-browser-no-install -- --build --browser webkit --tfs "Browser Unit Tests"27env:28DEBUG: "*browser*"29displayName: �� Run unit tests (Browser, Webkit)30timeoutInMinutes: 303132- script: |33set -e34npm run gulp \35compile-extension:configuration-editing \36compile-extension:css-language-features-server \37compile-extension:emmet \38compile-extension:git \39compile-extension:github-authentication \40compile-extension:html-language-features-server \41compile-extension:ipynb \42compile-extension:notebook-renderers \43compile-extension:json-language-features-server \44compile-extension:markdown-language-features \45compile-extension-media \46compile-extension:microsoft-authentication \47compile-extension:typescript-language-features \48compile-extension:vscode-api-tests \49compile-extension:vscode-colorize-tests \50compile-extension:vscode-colorize-perf-tests \51compile-extension:vscode-test-resolver52displayName: Build integration tests5354- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:55- script: |56# Figure out the full absolute path of the product we just built57# including the remote server and configure the integration tests58# to run with these builds instead of running out of sources.59set -e60APP_ROOT="$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)"61APP_NAME="`ls $APP_ROOT | head -n 1`"62INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \63./scripts/test-integration.sh --build --tfs "Integration Tests"64env:65VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)66displayName: 🧪 Run integration tests (Electron)67timeoutInMinutes: 206869- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:70- script: ./scripts/test-web-integration.sh --browser webkit71env:72VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)-web73displayName: �� Run integration tests (Browser, Webkit)74timeoutInMinutes: 207576- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:77- script: |78set -e79APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)80APP_NAME="`ls $APP_ROOT | head -n 1`"81INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \82./scripts/test-remote-integration.sh83env:84VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)85displayName: 🧪 Run integration tests (Remote)86timeoutInMinutes: 208788- script: ps -ef89displayName: Diagnostics before smoke test run90continueOnError: true91condition: succeededOrFailed()9293- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:94- script: |95set -e96APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)97APP_NAME="`ls $APP_ROOT | head -n 1`"98npm run smoketest-no-compile -- --tracing --build "$APP_ROOT/$APP_NAME"99timeoutInMinutes: 20100displayName: 🧪 Run smoke tests (Electron)101102- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:103- script: npm run smoketest-no-compile -- --web --tracing --headless104env:105VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)-web106timeoutInMinutes: 20107displayName: �� Run smoke tests (Browser, Chromium)108109- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:110- script: |111set -e112npm run gulp compile-extension:vscode-test-resolver113APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)114APP_NAME="`ls $APP_ROOT | head -n 1`"115npm run smoketest-no-compile -- --tracing --remote --build "$APP_ROOT/$APP_NAME"116env:117VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)118timeoutInMinutes: 20119displayName: 🧪 Run smoke tests (Remote)120121- script: ps -ef122displayName: Diagnostics after smoke test run123continueOnError: true124condition: succeededOrFailed()125126- template: ../common/publish-artifact.yml@self127parameters:128targetPath: .build/crashes129${{ if eq(parameters.VSCODE_TEST_ARTIFACT_NAME, '') }}:130artifactName: crash-dump-macos-$(VSCODE_ARCH)-$(System.JobAttempt)131${{ else }}:132artifactName: crash-dump-macos-$(VSCODE_ARCH)-${{ parameters.VSCODE_TEST_ARTIFACT_NAME }}-$(System.JobAttempt)133displayName: "Publish Crash Reports"134sbomEnabled: false135continueOnError: true136condition: failed()137138# In order to properly symbolify above crash reports139# (if any), we need the compiled native modules too140- template: ../common/publish-artifact.yml@self141parameters:142targetPath: node_modules143${{ if eq(parameters.VSCODE_TEST_ARTIFACT_NAME, '') }}:144artifactName: node-modules-macos-$(VSCODE_ARCH)-$(System.JobAttempt)145${{ else }}:146artifactName: node-modules-macos-$(VSCODE_ARCH)-${{ parameters.VSCODE_TEST_ARTIFACT_NAME }}-$(System.JobAttempt)147displayName: "Publish Node Modules"148sbomEnabled: false149continueOnError: true150condition: failed()151152- template: ../common/publish-artifact.yml@self153parameters:154targetPath: .build/logs155${{ if eq(parameters.VSCODE_TEST_ARTIFACT_NAME, '') }}:156artifactName: logs-macos-$(VSCODE_ARCH)-$(System.JobAttempt)157${{ else }}:158artifactName: logs-macos-$(VSCODE_ARCH)-${{ parameters.VSCODE_TEST_ARTIFACT_NAME }}-$(System.JobAttempt)159displayName: "Publish Log Files"160sbomEnabled: false161continueOnError: true162condition: succeededOrFailed()163164- task: PublishTestResults@2165displayName: Publish Tests Results166inputs:167testResultsFiles: "*-results.xml"168searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"169condition: succeededOrFailed()170171172