From 48bf72bfc470a95cad2b7143cd0deb8fec27c271 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Thu, 17 Oct 2019 13:39:11 -0700 Subject: [PATCH] Fix TelemetryOptOut error and add debug targets for running extension integration tests (#7765) --- .vscode/launch.json | 24 +++++++++++++++++++ .../electron-browser/telemetryOptOut.ts | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index bee6d1b5e8..223d40bb8d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -16,6 +16,7 @@ "request": "attach", "name": "Attach to Extension Host", "port": 5870, + "timeout": 30000, "restart": true, "outFiles": [ "${workspaceFolder}/out/**/*.js" @@ -186,6 +187,22 @@ "webRoot": "${workspaceFolder}", "timeout": 45000 }, + { + "type": "chrome", + "request": "launch", + "name": "Run Extension Integration Tests", + "windows": { + "runtimeExecutable": "${workspaceFolder}/scripts/sql-test-integration.bat" + }, + "osx": { + "runtimeExecutable": "${workspaceFolder}/scripts/sql-test-integration.sh" + }, + "linux": { + "runtimeExecutable": "${workspaceFolder}/scripts/sql-test-integration.sh" + }, + "webRoot": "${workspaceFolder}", + "timeout": 45000 + }, ], "compounds": [ { @@ -202,6 +219,13 @@ "Run Extension Unit Tests" ] }, + { + "name": "Debug Extension Integration Tests", + "configurations": [ + "Attach to Extension Host", + "Run Extension Integration Tests" + ] + }, { "name": "Debug azuredatastudio Main and Renderer", "configurations": [ diff --git a/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts index 1d7c6d6be8..c9a32866ce 100644 --- a/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts +++ b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts @@ -33,6 +33,6 @@ export class NativeTelemetryOptOut extends AbstractTelemetryOptOut { } protected getWindowCount(): Promise { - return this.electronService.getWindowCount(); + return this.electronService ? this.electronService.getWindowCount() : Promise.resolve(0); // {{SQL CARBON EDIT}} Tests run without UI context so electronService is undefined in that case } }