Path: blob/main/build/azure-pipelines/linux/product-build-linux-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- script: |18set -e19APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)20ELECTRON_ROOT=.build/electron21sudo chown root $APP_ROOT/chrome-sandbox22sudo chown root $ELECTRON_ROOT/chrome-sandbox23sudo chmod 4755 $APP_ROOT/chrome-sandbox24sudo chmod 4755 $ELECTRON_ROOT/chrome-sandbox25stat $APP_ROOT/chrome-sandbox26stat $ELECTRON_ROOT/chrome-sandbox27displayName: Change setuid helper binary permission2829- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:30- script: ./scripts/test.sh --build --tfs "Unit Tests"31displayName: �� Run unit tests (Electron)32timeoutInMinutes: 1533- script: npm run test-node -- --build34displayName: �� Run unit tests (node.js)35timeoutInMinutes: 153637- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:38- script: npm run test-browser-no-install -- --build --browser chromium --tfs "Browser Unit Tests"39env:40DEBUG: "*browser*"41displayName: �� Run unit tests (Browser, Chromium)42timeoutInMinutes: 154344- script: |45set -e46npm run gulp \47compile-extension:configuration-editing \48compile-extension:css-language-features-server \49compile-extension:emmet \50compile-extension:git \51compile-extension:github-authentication \52compile-extension:html-language-features-server \53compile-extension:ipynb \54compile-extension:notebook-renderers \55compile-extension:json-language-features-server \56compile-extension:markdown-language-features \57compile-extension-media \58compile-extension:microsoft-authentication \59compile-extension:typescript-language-features \60compile-extension:vscode-api-tests \61compile-extension:vscode-colorize-tests \62compile-extension:vscode-colorize-perf-tests \63compile-extension:vscode-test-resolver64displayName: Build integration tests6566- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:67- script: |68# Figure out the full absolute path of the product we just built69# including the remote server and configure the integration tests70# to run with these builds instead of running out of sources.71set -e72APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)73APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")74INTEGRATION_TEST_APP_NAME="$APP_NAME" \75INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \76./scripts/test-integration.sh --build --tfs "Integration Tests"77env:78VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)79displayName: 🧪 Run integration tests (Electron)80timeoutInMinutes: 208182- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:83- script: ./scripts/test-web-integration.sh --browser chromium84env:85VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web86displayName: �� Run integration tests (Browser, Chromium)87timeoutInMinutes: 208889- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:90- script: |91set -e92APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)93APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")94INTEGRATION_TEST_APP_NAME="$APP_NAME" \95INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \96./scripts/test-remote-integration.sh97env:98VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)99displayName: 🧪 Run integration tests (Remote)100timeoutInMinutes: 20101102- script: |103set -e104ps -ef105cat /proc/sys/fs/inotify/max_user_watches106lsof | wc -l107displayName: Diagnostics before smoke test run (processes, max_user_watches, number of opened file handles)108continueOnError: true109condition: succeededOrFailed()110111- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:112- script: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"113timeoutInMinutes: 20114displayName: �� Run smoke tests (Electron)115116- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:117- script: npm run smoketest-no-compile -- --web --tracing --headless118env:119VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web120timeoutInMinutes: 20121displayName: �� Run smoke tests (Browser, Chromium)122123- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:124- script: |125set -e126APP_PATH=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)127VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)" \128npm run smoketest-no-compile -- --tracing --remote --build "$APP_PATH"129timeoutInMinutes: 20130displayName: 🧪 Run smoke tests (Remote)131132- script: |133set -e134ps -ef135cat /proc/sys/fs/inotify/max_user_watches136lsof | wc -l137displayName: Diagnostics after smoke test run (processes, max_user_watches, number of opened file handles)138continueOnError: true139condition: succeededOrFailed()140141- template: ../common/publish-artifact.yml@self142parameters:143targetPath: .build/crashes144${{ if eq(parameters.VSCODE_TEST_ARTIFACT_NAME, '') }}:145artifactName: crash-dump-linux-$(VSCODE_ARCH)-$(System.JobAttempt)146${{ else }}:147artifactName: crash-dump-linux-$(VSCODE_ARCH)-${{ parameters.VSCODE_TEST_ARTIFACT_NAME }}-$(System.JobAttempt)148displayName: "Publish Crash Reports"149sbomEnabled: false150continueOnError: true151condition: failed()152153# In order to properly symbolify above crash reports154# (if any), we need the compiled native modules too155- template: ../common/publish-artifact.yml@self156parameters:157targetPath: node_modules158${{ if eq(parameters.VSCODE_TEST_ARTIFACT_NAME, '') }}:159artifactName: node-modules-linux-$(VSCODE_ARCH)-$(System.JobAttempt)160${{ else }}:161artifactName: node-modules-linux-$(VSCODE_ARCH)-${{ parameters.VSCODE_TEST_ARTIFACT_NAME }}-$(System.JobAttempt)162displayName: "Publish Node Modules"163sbomEnabled: false164continueOnError: true165condition: failed()166167- template: ../common/publish-artifact.yml@self168parameters:169targetPath: .build/logs170${{ if eq(parameters.VSCODE_TEST_ARTIFACT_NAME, '') }}:171artifactName: logs-linux-$(VSCODE_ARCH)-$(System.JobAttempt)172${{ else }}:173artifactName: logs-linux-$(VSCODE_ARCH)-${{ parameters.VSCODE_TEST_ARTIFACT_NAME }}-$(System.JobAttempt)174displayName: "Publish Log Files"175sbomEnabled: false176continueOnError: true177condition: succeededOrFailed()178179- task: PublishTestResults@2180displayName: Publish Tests Results181inputs:182testResultsFiles: "*-results.xml"183searchFolder: "$(Build.ArtifactStagingDirectory)/test-results"184condition: succeededOrFailed()185186187