Skip to content

Commit

Permalink
esm - pass build variable around properly (microsoft#225724)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero authored Aug 16, 2024
1 parent d751e43 commit c3819e4
Show file tree
Hide file tree
Showing 10 changed files with 407 additions and 52 deletions.
52 changes: 36 additions & 16 deletions build/azure-pipelines/darwin/product-build-darwin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,44 @@ steps:
displayName: Build integration tests
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- script: ./scripts/test-integration.sh --tfs "Integration Tests"
displayName: Run integration tests (Electron)
timeoutInMinutes: 20
- ${{ 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)
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
- ${{ 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: |
# 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:
Expand Down
4 changes: 4 additions & 0 deletions build/azure-pipelines/darwin/product-build-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ parameters:
type: boolean
- name: VSCODE_RUN_SMOKE_TESTS
type: boolean
- name: VSCODE_BUILD_ESM
type: boolean
default: false

steps:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
Expand Down Expand Up @@ -174,6 +177,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_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')) }}:
- task: DownloadPipelineArtifact@2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ parameters:
type: boolean
- name: VSCODE_ARCH
type: string
- name: VSCODE_BUILD_ESM
type: boolean
default: false

steps:
- task: NodeTool@0
Expand Down Expand Up @@ -201,6 +204,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
VSCODE_RUN_SMOKE_TESTS: false
VSCODE_BUILD_ESM: ${{ parameters.VSCODE_BUILD_ESM }}
${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1

Expand Down
61 changes: 42 additions & 19 deletions build/azure-pipelines/linux/product-build-linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,18 @@ steps:
- ${{ if eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true) }}:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- script: ./scripts/test-integration.sh --tfs "Integration Tests"
env:
DISPLAY: ":10"
displayName: Run integration tests (Electron)
timeoutInMinutes: 20
- ${{ 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"
env:
DISPLAY: ":10"
displayName: Run integration tests (Electron)
timeoutInMinutes: 20

- script: ./scripts/test-web-integration.sh --browser chromium
displayName: Run integration tests (Browser, Chromium)
Expand All @@ -131,20 +138,36 @@ steps:
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-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.sh --build --tfs "Integration Tests"
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
displayName: Run integration tests (Electron)
timeoutInMinutes: 20
- ${{ 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: |
# 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.sh --build --tfs "Integration Tests"
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
displayName: Run integration tests (Electron)
timeoutInMinutes: 20
- script: ./scripts/test-web-integration.sh --browser chromium
env:
Expand Down
4 changes: 4 additions & 0 deletions build/azure-pipelines/linux/product-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ parameters:
type: boolean
- name: VSCODE_ARCH
type: string
- name: VSCODE_BUILD_ESM
type: boolean
default: false

steps:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
Expand Down Expand Up @@ -267,6 +270,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }}
VSCODE_BUILD_ESM: ${{ parameters.VSCODE_BUILD_ESM }}
${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1

Expand Down
20 changes: 20 additions & 0 deletions build/azure-pipelines/product-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true
Expand All @@ -376,6 +377,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
Expand All @@ -390,6 +392,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
Expand All @@ -405,6 +408,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
Expand All @@ -428,6 +432,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_ARCH: arm64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
Expand Down Expand Up @@ -456,6 +461,7 @@ extends:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true
VSCODE_RUN_INTEGRATION_TESTS: false
Expand All @@ -471,6 +477,7 @@ extends:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: true
Expand All @@ -486,6 +493,7 @@ extends:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
Expand All @@ -503,6 +511,7 @@ extends:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
Expand All @@ -528,6 +537,7 @@ extends:
parameters:
VSCODE_ARCH: armhf
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
Expand All @@ -543,6 +553,7 @@ extends:
parameters:
VSCODE_ARCH: arm64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
Expand All @@ -567,6 +578,7 @@ extends:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}

- ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARMHF_LEGACY_SERVER, true) }}:
Expand All @@ -579,6 +591,7 @@ extends:
parameters:
VSCODE_ARCH: armhf
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_RUN_INTEGRATION_TESTS: false

- ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64_LEGACY_SERVER, true) }}:
Expand All @@ -591,6 +604,7 @@ extends:
parameters:
VSCODE_ARCH: arm64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
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)) }}:
Expand Down Expand Up @@ -643,6 +657,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true
VSCODE_RUN_INTEGRATION_TESTS: false
Expand All @@ -656,6 +671,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: true
Expand All @@ -669,6 +685,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
Expand All @@ -683,6 +700,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
Expand All @@ -697,6 +715,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
Expand Down Expand Up @@ -728,6 +747,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
Expand Down
Loading

0 comments on commit c3819e4

Please sign in to comment.