已合并
[bugfix][ide-plugins] #77 支持持久化 VS Code 测试缓存 #73
guomengwei创建于 8月24日
[bugfix][ide-plugins] #77 支持持久化 VS Code 测试缓存 #73
已合并
共 1 个文件变更+9-0
| @@ -29,6 +29,12 @@ const workspaceFolder = path.join(repoRoot, 'test', 'fixtures', 'workspaces', 'a | |||
| 29 | const extensionTestGlob = path.join(repoRoot, 'out', 'test', 'integration', '**', '*.test.js'); | 29 | const extensionTestGlob = path.join(repoRoot, 'out', 'test', 'integration', '**', '*.test.js'); |
| 30 | const testUserDataDir = path.join(repoRoot, '.vscode-test', 'user-data-extension-host'); | 30 | const testUserDataDir = path.join(repoRoot, '.vscode-test', 'user-data-extension-host'); |
| 31 | const testExtensionsDir = path.join(repoRoot, '.vscode-test', 'extensions-extension-host'); | 31 | const testExtensionsDir = path.join(repoRoot, '.vscode-test', 'extensions-extension-host'); |
| 32 | +const configuredVSCodeTestCachePath = process.env.VSCODE_TEST_CACHE_PATH?.trim(); | ||
| 33 | +// CI can keep the large VS Code runtime outside the workspace; local runs retain the existing workspace behavior. | ||
| 34 | +const vscodeTestCachePath = configuredVSCodeTestCachePath | ||
| 35 | + ? path.resolve(configuredVSCodeTestCachePath) | ||
| 36 | + : path.join(repoRoot, '.vscode-test'); | ||
| 37 | +const vscodeDownloadIdleTimeoutMilliseconds = 60_000; | ||
| 32 | 38 | ||
| 33 | /** | 39 | /** |
| 34 | * Main flow: | 40 | * Main flow: |
| @@ -45,9 +51,12 @@ async function main() { | |||
| 45 | await mkdir(rawCoverageDir, { recursive: true }); | 51 | await mkdir(rawCoverageDir, { recursive: true }); |
| 46 | await mkdir(testUserDataDir, { recursive: true }); | 52 | await mkdir(testUserDataDir, { recursive: true }); |
| 47 | await mkdir(testExtensionsDir, { recursive: true }); | 53 | await mkdir(testExtensionsDir, { recursive: true }); |
| 54 | + await mkdir(vscodeTestCachePath, { recursive: true }); | ||
| 48 | 55 | ||
| 49 | await runTests({ | 56 | await runTests({ |
| 50 | version: '1.130.0', | 57 | version: '1.130.0', |
| 58 | + cachePath: vscodeTestCachePath, | ||
| 59 | + timeout: vscodeDownloadIdleTimeoutMilliseconds, | ||
| 51 | extensionDevelopmentPath: repoRoot, | 60 | extensionDevelopmentPath: repoRoot, |
| 52 | extensionTestsPath: extensionRunner, | 61 | extensionTestsPath: extensionRunner, |
| 53 | launchArgs: [ | 62 | launchArgs: [ |