From 1edc9a7fff21a4b2af23c04d18814be427573148 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Wed, 13 Sep 2023 20:17:56 +0200 Subject: [PATCH] Add even more logging for #192584 (#193036) --- .../api/common/extHostExtensionService.ts | 16 ++++++++++++++++ .../common/abstractExtensionService.ts | 6 ++++++ .../electron-sandbox/nativeExtensionService.ts | 3 +++ 3 files changed, 25 insertions(+) diff --git a/src/vs/workbench/api/common/extHostExtensionService.ts b/src/vs/workbench/api/common/extHostExtensionService.ts index f0f60cf6f7d16..99fccebaee08b 100644 --- a/src/vs/workbench/api/common/extHostExtensionService.ts +++ b/src/vs/workbench/api/common/extHostExtensionService.ts @@ -740,8 +740,18 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme return new Promise((resolve, reject) => { const oldTestRunnerCallback = (error: Error, failures: number | undefined) => { if (error) { + if (isCI) { + this._logService.error(`Test runner called back with error`, error); + } reject(error); } else { + if (isCI) { + if (failures) { + this._logService.info(`Test runner called back with ${failures} failures.`); + } else { + this._logService.info(`Test runner called back with successful outcome.`); + } + } resolve((typeof failures === 'number' && failures > 0) ? 1 /* ERROR */ : 0 /* OK */); } }; @@ -754,9 +764,15 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme if (runResult && runResult.then) { runResult .then(() => { + if (isCI) { + this._logService.info(`Test runner finished successfully.`); + } resolve(0); }) .catch((err: unknown) => { + if (isCI) { + this._logService.error(`Test runner finished with error`, err); + } reject(err instanceof Error && err.stack ? err.stack : String(err)); }); } diff --git a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts index 34184b0820619..ccb729ce206ce 100644 --- a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts +++ b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts @@ -510,7 +510,13 @@ export abstract class AbstractExtensionService extends Disposable implements IEx let exitCode: number; try { exitCode = await extensionHostManager.extensionTestsExecute(); + if (isCI) { + this._logService.info(`Extension host test runner exit code: ${exitCode}`); + } } catch (err) { + if (isCI) { + this._logService.error(`Extension host test runner error`, err); + } console.error(err); exitCode = 1 /* ERROR */; } diff --git a/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts b/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts index 13e18b9e611d7..d63228db9d2de 100644 --- a/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts +++ b/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts @@ -436,6 +436,9 @@ export class NativeExtensionService extends AbstractExtensionService implements if (parseExtensionDevOptions(this._environmentService).isExtensionDevTestFromCli) { // When CLI testing make sure to exit with proper exit code + if (isCI) { + this._logService.info(`Asking native host service to exit with code ${code}.`); + } this._nativeHostService.exit(code); } else { // Expected development extension termination: When the extension host goes down we also shutdown the window