Skip to content

Commit bc5c94c

Browse files
authored
fix: VSCode is downloaded for every test package (#5364)
* fix: VSCode is downloaded for every test package Problem: - In github ci vscode is downloaded for every test package (core/q) Solution: - Use AWS_TOOLKIT_TEST_CACHE_DIR and AWS_TOOLKIT_TEST_USER_DIR to cache the test and user directories
1 parent 7a759ee commit bc5c94c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/node.js.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
env:
2222
VSCODE_TEST_VERSION: ${{ matrix.vscode-version }}
2323
NODE_OPTIONS: '--max-old-space-size=8192'
24+
AWS_TOOLKIT_TEST_CACHE_DIR: '/tmp/.vscode-test/'
25+
AWS_TOOLKIT_TEST_USER_DIR: '/tmp/.vscode-test/user-data/'
2426
steps:
2527
- uses: actions/checkout@v4
2628
- name: Use Node.js ${{ matrix.node-version }}
@@ -88,6 +90,8 @@ jobs:
8890
env:
8991
VSCODE_TEST_VERSION: ${{ matrix.vscode-version }}
9092
NODE_OPTIONS: '--max-old-space-size=8192'
93+
AWS_TOOLKIT_TEST_CACHE_DIR: '/tmp/.vscode-test/'
94+
AWS_TOOLKIT_TEST_USER_DIR: '/tmp/.vscode-test/user-data/'
9195
steps:
9296
- uses: actions/checkout@v4
9397
- name: Use Node.js ${{ matrix.node-version }}

packages/core/scripts/test/launchTestUtilities.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { join, resolve } from 'path'
1010
import { runTests } from '@vscode/test-electron'
1111
import { VSCODE_EXTENSION_ID } from '../../src/shared/extensions'
1212
import { TestOptions } from '@vscode/test-electron/out/runTest'
13-
import { defaultCachePath } from '@vscode/test-electron/out/download'
1413

1514
const envvarVscodeTestVersion = 'VSCODE_TEST_VERSION'
1615

@@ -146,7 +145,7 @@ async function setupVSCodeTestInstance(suite: SuiteName): Promise<string> {
146145
const downloadOptions = {
147146
platform,
148147
version: vsCodeVersion,
149-
cachePath: process.env.AWS_TOOLKIT_TEST_CACHE_DIR ?? defaultCachePath,
148+
cachePath: process.env.AWS_TOOLKIT_TEST_CACHE_DIR ?? '../../.vscode-test',
150149
}
151150

152151
const vsCodeExecutablePath = await downloadAndUnzipVSCode(downloadOptions)

0 commit comments

Comments
 (0)