esm - pass build variable around properly (#225724)

This commit is contained in:
Benjamin Pasero
2024-08-16 09:24:34 +02:00
committed by GitHub
parent d751e4324d
commit c3819e438c
10 changed files with 407 additions and 52 deletions

View File

@@ -94,11 +94,31 @@ steps:
displayName: Build integration tests displayName: Build integration tests
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- script: ./scripts/test-integration.sh --tfs "Integration Tests" - ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- script: ./scripts/test-integration-esm.sh --tfs "Integration Tests"
displayName: Run integration tests (Electron) [ESM]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- script: ./scripts/test-integration --tfs "Integration Tests"
displayName: Run integration tests (Electron) displayName: Run integration tests (Electron)
timeoutInMinutes: 20 timeoutInMinutes: 20
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- 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-esm.sh --build --tfs "Integration Tests"
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
displayName: Run integration tests (Electron) [ESM]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- script: | - script: |
# Figure out the full absolute path of the product we just built # Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests # including the remote server and configure the integration tests

View File

@@ -9,6 +9,9 @@ parameters:
type: boolean type: boolean
- name: VSCODE_RUN_SMOKE_TESTS - name: VSCODE_RUN_SMOKE_TESTS
type: boolean type: boolean
- name: VSCODE_BUILD_ESM
type: boolean
default: false
steps: steps:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
@@ -174,6 +177,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }} VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }} VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }} VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }}
VSCODE_BUILD_ESM: ${{ parameters.VSCODE_BUILD_ESM }}
- ${{ elseif and(ne(parameters.VSCODE_CIBUILD, true), ne(parameters.VSCODE_QUALITY, 'oss')) }}: - ${{ elseif and(ne(parameters.VSCODE_CIBUILD, true), ne(parameters.VSCODE_QUALITY, 'oss')) }}:
- task: DownloadPipelineArtifact@2 - task: DownloadPipelineArtifact@2

View File

@@ -5,6 +5,9 @@ parameters:
type: boolean type: boolean
- name: VSCODE_ARCH - name: VSCODE_ARCH
type: string type: string
- name: VSCODE_BUILD_ESM
type: boolean
default: false
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
@@ -201,6 +204,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }} VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
VSCODE_RUN_SMOKE_TESTS: false VSCODE_RUN_SMOKE_TESTS: false
VSCODE_BUILD_ESM: ${{ parameters.VSCODE_BUILD_ESM }}
${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1 PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1

View File

@@ -116,6 +116,13 @@ steps:
- ${{ if eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true) }}: - ${{ if eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true) }}:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- script: ./scripts/test-integration-esm.sh --tfs "Integration Tests"
env:
DISPLAY: ":10"
displayName: Run integration tests (Electron) [ESM]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- script: ./scripts/test-integration.sh --tfs "Integration Tests" - script: ./scripts/test-integration.sh --tfs "Integration Tests"
env: env:
DISPLAY: ":10" DISPLAY: ":10"
@@ -131,6 +138,22 @@ steps:
timeoutInMinutes: 20 timeoutInMinutes: 20
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- 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-linux-$(VSCODE_ARCH)
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
INTEGRATION_TEST_APP_NAME="$APP_NAME" \
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
./scripts/test-integration-esm.sh --build --tfs "Integration Tests"
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
displayName: Run integration tests (Electron) [ESM]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- script: | - script: |
# Figure out the full absolute path of the product we just built # Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests # including the remote server and configure the integration tests

View File

@@ -11,6 +11,9 @@ parameters:
type: boolean type: boolean
- name: VSCODE_ARCH - name: VSCODE_ARCH
type: string type: string
- name: VSCODE_BUILD_ESM
type: boolean
default: false
steps: steps:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
@@ -267,6 +270,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }} VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }} VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }} VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }}
VSCODE_BUILD_ESM: ${{ parameters.VSCODE_BUILD_ESM }}
${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1 PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1

View File

@@ -362,6 +362,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self - template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_ARCH: x64 VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true VSCODE_RUN_UNIT_TESTS: true
@@ -376,6 +377,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self - template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_ARCH: x64 VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
@@ -390,6 +392,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self - template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_ARCH: x64 VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
@@ -405,6 +408,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self - template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_ARCH: x64 VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
@@ -428,6 +432,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self - template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_ARCH: arm64 VSCODE_ARCH: arm64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
@@ -456,6 +461,7 @@ extends:
parameters: parameters:
VSCODE_ARCH: x64 VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true VSCODE_RUN_UNIT_TESTS: true
VSCODE_RUN_INTEGRATION_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false
@@ -471,6 +477,7 @@ extends:
parameters: parameters:
VSCODE_ARCH: x64 VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: true VSCODE_RUN_INTEGRATION_TESTS: true
@@ -486,6 +493,7 @@ extends:
parameters: parameters:
VSCODE_ARCH: x64 VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false
@@ -503,6 +511,7 @@ extends:
parameters: parameters:
VSCODE_ARCH: x64 VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
@@ -528,6 +537,7 @@ extends:
parameters: parameters:
VSCODE_ARCH: armhf VSCODE_ARCH: armhf
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false
@@ -543,6 +553,7 @@ extends:
parameters: parameters:
VSCODE_ARCH: arm64 VSCODE_ARCH: arm64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false
@@ -567,6 +578,7 @@ extends:
parameters: parameters:
VSCODE_ARCH: x64 VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
- ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARMHF_LEGACY_SERVER, true) }}: - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARMHF_LEGACY_SERVER, true) }}:
@@ -579,6 +591,7 @@ extends:
parameters: parameters:
VSCODE_ARCH: armhf VSCODE_ARCH: armhf
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_RUN_INTEGRATION_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false
- ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64_LEGACY_SERVER, true) }}: - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64_LEGACY_SERVER, true) }}:
@@ -591,6 +604,7 @@ extends:
parameters: parameters:
VSCODE_ARCH: arm64 VSCODE_ARCH: arm64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_RUN_INTEGRATION_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false
- ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_COMPILE_ONLY, false), eq(variables['VSCODE_BUILD_STAGE_ALPINE'], true)) }}: - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_COMPILE_ONLY, false), eq(variables['VSCODE_BUILD_STAGE_ALPINE'], true)) }}:
@@ -643,6 +657,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self - template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true VSCODE_RUN_UNIT_TESTS: true
VSCODE_RUN_INTEGRATION_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false
@@ -656,6 +671,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self - template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: true VSCODE_RUN_INTEGRATION_TESTS: true
@@ -669,6 +685,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self - template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false
@@ -683,6 +700,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self - template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false
@@ -697,6 +715,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self - template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
@@ -728,6 +747,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self - template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters: parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false

View File

@@ -98,6 +98,11 @@ steps:
condition: succeededOrFailed() condition: succeededOrFailed()
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- powershell: .\scripts\test-integration-esm.bat --tfs "Integration Tests"
displayName: Run integration tests (Electron) [ESM]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- powershell: .\scripts\test-integration.bat --tfs "Integration Tests" - powershell: .\scripts\test-integration.bat --tfs "Integration Tests"
displayName: Run integration tests (Electron) displayName: Run integration tests (Electron)
timeoutInMinutes: 20 timeoutInMinutes: 20
@@ -111,6 +116,22 @@ steps:
timeoutInMinutes: 20 timeoutInMinutes: 20
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- powershell: |
# 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.
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
$AppNameShort = $AppProductJson.nameShort
$env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)"
exec { .\scripts\test-integration-esm.bat --build --tfs "Integration Tests" }
displayName: Run integration tests (Electron) [ESM]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- powershell: | - powershell: |
# Figure out the full absolute path of the product we just built # Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests # including the remote server and configure the integration tests

View File

@@ -11,6 +11,9 @@ parameters:
type: boolean type: boolean
- name: VSCODE_RUN_SMOKE_TESTS - name: VSCODE_RUN_SMOKE_TESTS
type: boolean type: boolean
- name: VSCODE_BUILD_ESM
type: boolean
default: false
steps: steps:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
@@ -179,6 +182,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }} VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }} VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }} VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }}
VSCODE_BUILD_ESM: ${{ parameters.VSCODE_BUILD_ESM }}
${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1 PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1

View File

@@ -0,0 +1,119 @@
@echo off
setlocal
pushd %~dp0\..
set VSCODEUSERDATADIR=%TEMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,2%
set VSCODECRASHDIR=%~dp0\..\.build\crashes
set VSCODELOGSDIR=%~dp0\..\.build\logs\integration-tests
:: Figure out which Electron to use for running tests
if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" (
chcp 65001
set INTEGRATION_TEST_ELECTRON_PATH=.\scripts\code.bat
set VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE=1
echo Running integration tests out of sources.
) else (
set VSCODE_CLI=1
set ELECTRON_ENABLE_LOGGING=1
echo Running integration tests with '%INTEGRATION_TEST_ELECTRON_PATH%' as build.
)
echo Storing crash reports into '%VSCODECRASHDIR%'.
echo Storing log files into '%VSCODELOGSDIR%'.
:: Tests standalone (AMD)
echo.
echo ### node.js integration tests
call .\scripts\test-esm.bat --runGlob **\*.integrationTest.js %*
if %errorlevel% neq 0 exit /b %errorlevel%
:: Tests in the extension host
set API_TESTS_EXTRA_ARGS=--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=%VSCODECRASHDIR% --logsPath=%VSCODELOGSDIR% --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-extensions --disable-workspace-trust --user-data-dir=%VSCODEUSERDATADIR%
echo.
echo ### API tests (folder)
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\singlefolder-tests %API_TESTS_EXTRA_ARGS%
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### API tests (workspace)
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\workspace-tests %API_TESTS_EXTRA_ARGS%
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### Colorize tests
call yarn test-extension -l vscode-colorize-tests
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### TypeScript tests
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\typescript-language-features\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\typescript-language-features --extensionTestsPath=%~dp0\..\extensions\typescript-language-features\out\test\unit %API_TESTS_EXTRA_ARGS%
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### Markdown tests
call yarn test-extension -l markdown-language-features
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### Emmet tests
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\emmet\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test %API_TESTS_EXTRA_ARGS%
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### Git tests
for /f "delims=" %%i in ('node -p "require('fs').realpathSync.native(require('os').tmpdir())"') do set TEMPDIR=%%i
set GITWORKSPACE=%TEMPDIR%\git-%RANDOM%
mkdir %GITWORKSPACE%
call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test %API_TESTS_EXTRA_ARGS%
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### Ipynb tests
call yarn test-extension -l ipynb
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### Notebook Output tests
call yarn test-extension -l notebook-renderers
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### Configuration editing tests
set CFWORKSPACE=%TEMPDIR%\cf-%RANDOM%
mkdir %CFWORKSPACE%
call yarn test-extension -l configuration-editing
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### GitHub Authentication tests
call yarn test-extension -l github-authentication
if %errorlevel% neq 0 exit /b %errorlevel%
:: Tests standalone (CommonJS)
echo.
echo ### CSS tests
call %~dp0\node-electron.bat %~dp0\..\extensions\css-language-features/server/test/index.js
if %errorlevel% neq 0 exit /b %errorlevel%
echo.
echo ### HTML tests
call %~dp0\node-electron.bat %~dp0\..\extensions\html-language-features/server/test/index.js
if %errorlevel% neq 0 exit /b %errorlevel%
:: Cleanup
rmdir /s /q %VSCODEUSERDATADIR%
popd
endlocal

136
scripts/test-integration-esm.sh Executable file
View File

@@ -0,0 +1,136 @@
#!/usr/bin/env bash
set -e
if [[ "$OSTYPE" == "darwin"* ]]; then
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
ROOT=$(dirname $(dirname $(realpath "$0")))
else
ROOT=$(dirname $(dirname $(readlink -f $0)))
# --disable-dev-shm-usage: when run on docker containers where size of /dev/shm
# partition < 64MB which causes OOM failure for chromium compositor that uses the partition for shared memory
LINUX_EXTRA_ARGS="--disable-dev-shm-usage"
fi
VSCODEUSERDATADIR=`mktemp -d 2>/dev/null`
VSCODECRASHDIR=$ROOT/.build/crashes
VSCODELOGSDIR=$ROOT/.build/logs/integration-tests
cd $ROOT
# Figure out which Electron to use for running tests
if [ -z "$INTEGRATION_TEST_ELECTRON_PATH" ]
then
INTEGRATION_TEST_ELECTRON_PATH="./scripts/code.sh"
echo "Running integration tests out of sources."
else
export VSCODE_CLI=1
export ELECTRON_ENABLE_LOGGING=1
echo "Running integration tests with '$INTEGRATION_TEST_ELECTRON_PATH' as build."
fi
echo "Storing crash reports into '$VSCODECRASHDIR'."
echo "Storing log files into '$VSCODELOGSDIR'."
# Tests standalone (AMD)
echo
echo "### node.js integration tests"
echo
./scripts/test-esm.sh --runGlob **/*.integrationTest.js "$@"
# Tests in the extension host
API_TESTS_EXTRA_ARGS="--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=$VSCODECRASHDIR --logsPath=$VSCODELOGSDIR --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-extensions --disable-workspace-trust --user-data-dir=$VSCODEUSERDATADIR"
if [ -z "$INTEGRATION_TEST_APP_NAME" ]; then
kill_app() { true; }
else
kill_app() { killall $INTEGRATION_TEST_APP_NAME || true; }
fi
echo
echo "### API tests (folder)"
echo
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $ROOT/extensions/vscode-api-tests/testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/singlefolder-tests $API_TESTS_EXTRA_ARGS
kill_app
echo
echo "### API tests (workspace)"
echo
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $ROOT/extensions/vscode-api-tests/testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/workspace-tests $API_TESTS_EXTRA_ARGS
kill_app
echo
echo "### Colorize tests"
echo
yarn test-extension -l vscode-colorize-tests
kill_app
echo
echo "### TypeScript tests"
echo
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $ROOT/extensions/typescript-language-features/test-workspace --extensionDevelopmentPath=$ROOT/extensions/typescript-language-features --extensionTestsPath=$ROOT/extensions/typescript-language-features/out/test/unit $API_TESTS_EXTRA_ARGS
kill_app
echo
echo "### Markdown tests"
echo
yarn test-extension -l markdown-language-features
kill_app
echo
echo "### Emmet tests"
echo
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $ROOT/extensions/emmet/test-workspace --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test $API_TESTS_EXTRA_ARGS
kill_app
echo
echo "### Git tests"
echo
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $(mktemp -d 2>/dev/null) --extensionDevelopmentPath=$ROOT/extensions/git --extensionTestsPath=$ROOT/extensions/git/out/test $API_TESTS_EXTRA_ARGS
kill_app
echo
echo "### Ipynb tests"
echo
yarn test-extension -l ipynb
kill_app
echo
echo "### Notebook Output tests"
echo
yarn test-extension -l notebook-renderers
kill_app
echo
echo "### Configuration editing tests"
echo
yarn test-extension -l configuration-editing
kill_app
echo
echo "### GitHub Authentication tests"
echo
yarn test-extension -l github-authentication
kill_app
# Tests standalone (CommonJS)
echo
echo "### CSS tests"
echo
cd $ROOT/extensions/css-language-features/server && $ROOT/scripts/node-electron.sh test/index.js
echo
echo "### HTML tests"
echo
cd $ROOT/extensions/html-language-features/server && $ROOT/scripts/node-electron.sh test/index.js
# Cleanup
rm -rf $VSCODEUSERDATADIR