File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,11 +60,14 @@ jobs:
6060 - name : Install dependencies
6161 run : npm ci
6262
63- - name : Patch test VS Code to run as background app
64- run : bash scripts/hide-test-vscode.sh
65-
6663 - name : Run VS Code extension tests
6764 run : npm run test:all
6865
66+ - name : Setup UI test VS Code
67+ run : npx extest setup-tests --code_version max --extensions_dir .vscode-test/extensions
68+
69+ - name : Patch test VS Code to run as background app
70+ run : bash scripts/hide-test-vscode.sh
71+
6972 - name : Run UI tests
70- run : npm run test:ui
73+ run : npx extest run-tests './out-uitest/ test/ui/*.test.js' --extensions_dir .vscode-test/extensions
Original file line number Diff line number Diff line change 110110 "compile-uitests" : " tsc -p ./tsconfig.uitest.json" ,
111111 "watch" : " tsc -watch -p ./" ,
112112 "test:unit" : " node --test ./out-test/test/unit/*.test.js" ,
113- "test:extension" : " bash scripts/hide-test-vscode.sh && node ./out-test/test/suite/runExtensionTests.js" ,
113+ "test:extension" : " node ./out-test/test/suite/runExtensionTests.js" ,
114114 "test:ui" : " npm run compile && npm run compile-uitests && extest setup-and-run './out-uitest/test/ui/*.test.js' --code_version max --extensions_dir .vscode-test/extensions" ,
115115 "test" : " npm run compile && npm run compile-tests && npm run test:unit" ,
116- "test:all" : " npm run compile && npm run compile-tests && bash scripts/hide-test-vscode.sh && npm run test:unit && npm run test:extension" ,
116+ "test:all" : " npm run compile && npm run compile-tests && npm run test:unit && npm run test:extension" ,
117117 "vscode:prepublish" : " npm run compile" ,
118118 "package" : " vsce package" ,
119119 "check" : " npm run test && npm run package"
Original file line number Diff line number Diff line change 33# background apps (no Dock icon, no Cmd+Tab, no focus stealing).
44# Safe to run multiple times; skips already-patched bundles.
55# No-op on Linux/Windows.
6+ #
7+ # Covers:
8+ # .vscode-test/ — @vscode/test-electron downloads
9+ # $TMPDIR/test-resources/ — vscode-extension-tester (ExTester) downloads
610
711set -euo pipefail
812
1317patched=0
1418shopt -s nullglob
1519
20+ # ExTester uses $TEST_RESOURCES or $TMPDIR/test-resources
21+ extest_dir=" ${TEST_RESOURCES:- ${TMPDIR:-/ tmp} / test-resources} "
22+
1623for plist in \
17- .vscode-test/* /Visual\ Studio\ Code* .app/Contents/Info.plist; do
24+ .vscode-test/* /Visual\ Studio\ Code* .app/Contents/Info.plist \
25+ " $extest_dir " /* /Visual\ Studio\ Code* .app/Contents/Info.plist; do
1826 [ -f " $plist " ] || continue
1927
2028 if plutil -extract LSUIElement raw " $plist " > /dev/null 2>&1 ; then
Original file line number Diff line number Diff line change 11import * as path from "node:path" ;
2- import { runTests } from "@vscode/test-electron" ;
2+ import { execSync } from "node:child_process" ;
3+ import { downloadAndUnzipVSCode , runTests } from "@vscode/test-electron" ;
34
45async function main ( ) : Promise < void > {
56 const extensionDevelopmentPath = path . resolve ( __dirname , "../../.." ) ;
67 const extensionTestsPath = path . resolve ( __dirname , "./index.js" ) ;
78
9+ // Download VS Code FIRST so the .app bundle exists on disk
10+ const vscodeExecutablePath = await downloadAndUnzipVSCode ( ) ;
11+
12+ // Patch the downloaded bundle to suppress Dock icon / window focus on macOS
13+ execSync ( "bash scripts/hide-test-vscode.sh" , {
14+ cwd : extensionDevelopmentPath ,
15+ stdio : "inherit" ,
16+ } ) ;
17+
818 await runTests ( {
19+ vscodeExecutablePath,
920 extensionDevelopmentPath,
1021 extensionTestsPath,
1122 launchArgs : [
You can’t perform that action at this time.
0 commit comments