11import { join } from 'node:path' ;
2- import { homedir , tmpdir } from 'node:os' ;
32import { promisify } from 'node:util' ;
43import { runTests } from '@vscode/test-electron' ;
54
65import { PACKAGE_ROOT , PROJECT_PATH } from '../test_constants' ;
7- import { mkdtemp } from 'node:fs/promises' ;
86
97// @ts -expect-error no types.
108import Xvfb from 'xvfb' ;
@@ -13,20 +11,18 @@ async function main() {
1311 const EXT_DEVELOPMENT_PATH = join ( PACKAGE_ROOT , 'development_package' ) ;
1412 const EXT_TESTS_PATH = join ( PACKAGE_ROOT , 'integration' , 'e2e' , 'jasmine' ) ;
1513 const xvfb = new Xvfb ( ) ;
16-
17- // We cannot use `TEST_TMPDIR` as it's longer than 170 characters
18- const vsCodeDataDir = await mkdtemp ( join ( tmpdir ( ) , 'vscode-e2e-' ) ) ;
14+ const tmpDir = process . env [ 'TEST_TMPDIR' ] ! ;
1915
2016 try {
2117 await promisify ( xvfb . start ) . call ( xvfb ) ;
2218
2319 const exitCode = await runTests ( {
24- // Keep version in sync with vscode engine version in package.json
25- version : '1.74.3' ,
20+ // The current version should align with the VS Code engine version in package.json, but it's several years old.
21+ // TODO: We should update the package.json version eventually.
22+ version : '1.102.0' ,
2623 extensionDevelopmentPath : EXT_DEVELOPMENT_PATH ,
2724 extensionTestsPath : EXT_TESTS_PATH ,
28- // Avoid redownloading vscode if the test if flaky.
29- cachePath : join ( homedir ( ) , '.cache/vscode-test' ) ,
25+ cachePath : join ( tmpDir , '.cache' ) ,
3026 launchArgs : [
3127 PROJECT_PATH ,
3228 // This disables all extensions except the one being tested
@@ -35,8 +31,8 @@ async function main() {
3531 '--no-sandbox' ,
3632 '--disable-dev-shm-usage' ,
3733 '--disable-software-rasterizer' ,
38- `--extensions-dir=${ vsCodeDataDir } / extensions` ,
39- `--user-data-dir=${ vsCodeDataDir } / user-data` ,
34+ `--extensions-dir=${ join ( tmpDir , ' extensions' ) } ` ,
35+ `--user-data-dir=${ join ( tmpDir , ' user-data' ) } ` ,
4036 ] ,
4137 } ) ;
4238
0 commit comments