File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -4,17 +4,22 @@ import path from "path";
44
55export default defineConfig ( {
66 files : "test/**/*.test.ts" ,
7- // The default user data directory had too many characters for the IPC connection on macOS in CI.
7+ // It may break CI but we'll know sooner rather than later
8+ version : "insiders" ,
89 launchArgs : [
10+ // The default chat extensions hang under OneBranch network constraints
11+ "--disable-extensions" ,
12+ // Undocumented but valid option to use a temporary profile for testing
913 "--profile-temp" ,
14+ // The default user data directory had too many characters for the IPC connection on macOS in CI.
1015 "--user-data-dir" ,
1116 path . join ( os . tmpdir ( ) , "vscode-user-data" ) ,
1217 ] ,
1318 workspaceFolder : "test/TestEnvironment.code-workspace" ,
1419 mocha : {
1520 ui : "bdd" , // describe, it, etc.
1621 require : [ "esbuild-register" ] , // transpile TypeScript on-the-fly
17- slow : 2000 , // 2 seconds for slow test
18- timeout : 60 * 1000 , // 10 minutes to allow for debugging
22+ slow : 2 * 1000 , // 2 seconds for slow test
23+ timeout : 10 * 60 * 1000 , // 10 minutes to allow for debugging
1924 } ,
2025} ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import * as path from "path";
66import * as vscode from "vscode" ;
77import type { IPowerShellExtensionClient } from "../src/features/ExternalApi" ;
88import type { ILogger } from "../src/logging" ;
9+ import { sleep } from "../src/utils" ;
910
1011// This lets us test the rest of our path assumptions against the baseline of
1112// this test file existing at `<root>/test/utils.js`.
@@ -64,11 +65,17 @@ export class TestLogger implements ILogger {
6465export const testLogger = new TestLogger ( ) ;
6566
6667export async function ensureExtensionIsActivated ( ) : Promise < IPowerShellExtensionClient > {
67- const extension = vscode . extensions . getExtension ( extensionId ) ;
68- if ( ! extension ! . isActive ) {
69- await extension ! . activate ( ) ;
68+ let extension = vscode . extensions . getExtension ( extensionId ) ;
69+ while ( ! extension ) {
70+ // Wait for VS Code to be ready
71+ testLogger . writeDebug ( `Extension ${ extensionId } not yet found...` ) ;
72+ await sleep ( 200 ) ;
73+ extension = vscode . extensions . getExtension ( extensionId ) ;
7074 }
71- return extension ! . exports as IPowerShellExtensionClient ;
75+ if ( ! extension . isActive ) {
76+ await extension . activate ( ) ;
77+ }
78+ return extension . exports as IPowerShellExtensionClient ;
7279}
7380
7481export async function ensureEditorServicesIsConnected ( ) : Promise < IPowerShellExtensionClient > {
You can’t perform that action at this time.
0 commit comments