Skip to content

Commit 5f9c70a

Browse files
authored
Separate what we test from what we sign, because esrp needs to replace the files as they come back signed (microsoft#255748)
* separate what we test from what we sign, because esrp needs to replace the files as they come back signed fixes microsoft#248116 Co-authored-by: @lszomoru * 💄
1 parent c23b94c commit 5f9c70a

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

build/azure-pipelines/win32/product-build-win32-test.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,29 @@ steps:
9999
timeoutInMinutes: 20
100100

101101
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
102+
- powershell: |
103+
# Copy client, server and web builds to a separate test directory, to avoid Access Denied errors in codesign
104+
. build/azure-pipelines/win32/exec.ps1
105+
$ErrorActionPreference = "Stop"
106+
$TestDir = "$(agent.builddirectory)\test"
107+
New-Item -ItemType Directory -Path $TestDir -Force
108+
Copy-Item -Path "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" -Destination "$TestDir\VSCode-win32-$(VSCODE_ARCH)" -Recurse -Force
109+
Copy-Item -Path "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)" -Destination "$TestDir\vscode-server-win32-$(VSCODE_ARCH)" -Recurse -Force
110+
Copy-Item -Path "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)-web" -Destination "$TestDir\vscode-server-win32-$(VSCODE_ARCH)-web" -Recurse -Force
111+
displayName: Copy builds to test directory
112+
102113
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
103114
- powershell: |
104115
# Figure out the full absolute path of the product we just built
105116
# including the remote server and configure the integration tests
106117
# to run with these builds instead of running out of sources.
107118
. build/azure-pipelines/win32/exec.ps1
108119
$ErrorActionPreference = "Stop"
109-
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
120+
$AppRoot = "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
110121
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
111122
$AppNameShort = $AppProductJson.nameShort
112123
$env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"
113-
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)"
124+
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)"
114125
exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" }
115126
displayName: 🧪 Run integration tests (Electron)
116127
timeoutInMinutes: 20
@@ -119,7 +130,7 @@ steps:
119130
- powershell: |
120131
. build/azure-pipelines/win32/exec.ps1
121132
$ErrorActionPreference = "Stop"
122-
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)-web"
133+
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)-web"
123134
exec { .\scripts\test-web-integration.bat --browser firefox }
124135
displayName: 🧪 Run integration tests (Browser, Firefox)
125136
timeoutInMinutes: 20
@@ -128,11 +139,11 @@ steps:
128139
- powershell: |
129140
. build/azure-pipelines/win32/exec.ps1
130141
$ErrorActionPreference = "Stop"
131-
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
142+
$AppRoot = "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
132143
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
133144
$AppNameShort = $AppProductJson.nameShort
134145
$env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"
135-
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)"
146+
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)"
136147
exec { .\scripts\test-remote-integration.bat }
137148
displayName: 🧪 Run integration tests (Remote)
138149
timeoutInMinutes: 20
@@ -164,23 +175,23 @@ steps:
164175
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
165176
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
166177
# Additional "--" needed to workaround https://github.com/npm/cli/issues/7375
167-
- powershell: npm run smoketest-no-compile -- -- --verbose --tracing --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
178+
- powershell: npm run smoketest-no-compile -- -- --verbose --tracing --build "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
168179
displayName: 🧪 Run smoke tests (Electron)
169180
timeoutInMinutes: 20
170181

171182
- ${{ if eq(parameters.VSCODE_RUN_BROWSER_TESTS, true) }}:
172183
# Additional "--" needed to workaround https://github.com/npm/cli/issues/7375
173184
- powershell: npm run smoketest-no-compile -- -- --web --tracing --headless
174185
env:
175-
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)-web
186+
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)-web
176187
displayName: 🧪 Run smoke tests (Browser, Chromium)
177188
timeoutInMinutes: 20
178189

179190
- ${{ if eq(parameters.VSCODE_RUN_REMOTE_TESTS, true) }}:
180191
# Additional "--" needed to workaround https://github.com/npm/cli/issues/7375
181-
- powershell: npm run smoketest-no-compile -- -- --tracing --remote --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
192+
- powershell: npm run smoketest-no-compile -- -- --tracing --remote --build "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
182193
env:
183-
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)
194+
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\test\vscode-server-win32-$(VSCODE_ARCH)
184195
displayName: 🧪 Run smoke tests (Remote)
185196
timeoutInMinutes: 20
186197

0 commit comments

Comments
 (0)