eng: enable chromium browser debug in selfhost runner (#227814)

This commit is contained in:
Connor Peet
2024-09-06 09:34:49 -07:00
committed by GitHub
parent eed219db5f
commit 63729c8cbe

View File

@@ -63,7 +63,7 @@ export abstract class VSCodeTestRunner {
const cp = spawn(await this.binaryPath(), args, {
cwd: this.repoLocation.uri.fsPath,
stdio: 'pipe',
env: this.getEnvironment(),
env: this.getEnvironment(port),
});
// Register a descriptor factory that signals the server when any
@@ -139,7 +139,7 @@ export abstract class VSCodeTestRunner {
});
}
protected getEnvironment(): NodeJS.ProcessEnv {
protected getEnvironment(_remoteDebugPort?: number): NodeJS.ProcessEnv {
return {
...process.env,
ELECTRON_RUN_AS_NODE: undefined,
@@ -261,9 +261,10 @@ export class BrowserTestRunner extends VSCodeTestRunner {
}
/** @override */
protected override getEnvironment() {
protected override getEnvironment(remoteDebugPort?: number) {
return {
...super.getEnvironment(),
...super.getEnvironment(remoteDebugPort),
PLAYWRIGHT_CHROMIUM_DEBUG_PORT: remoteDebugPort ? String(remoteDebugPort) : undefined,
ELECTRON_RUN_AS_NODE: '1',
};
}