diff --git a/news/3 Code Health/4801.md b/news/3 Code Health/4801.md new file mode 100644 index 000000000000..a5d91744a4b4 --- /dev/null +++ b/news/3 Code Health/4801.md @@ -0,0 +1 @@ +Capture telemetry when tests are disabled. diff --git a/src/client/telemetry/constants.ts b/src/client/telemetry/constants.ts index 8e1daa26434a..872cc51a07fa 100644 --- a/src/client/telemetry/constants.ts +++ b/src/client/telemetry/constants.ts @@ -37,6 +37,7 @@ export enum EventName { DEBUGGER_ATTACH_TO_CHILD_PROCESS = 'DEBUGGER.ATTACH_TO_CHILD_PROCESS', DEBUGGER_CONFIGURATION_PROMPTS = 'DEBUGGER.CONFIGURATION.PROMPTS', UNITTEST_STOP = 'UNITTEST.STOP', + UNITTEST_DISABLE = 'UNITTEST.DISABLE', UNITTEST_RUN = 'UNITTEST.RUN', UNITTEST_DISCOVER = 'UNITTEST.DISCOVER', UNITTEST_CONFIGURE = 'UNITTEST.CONFIGURE', diff --git a/src/client/telemetry/index.ts b/src/client/telemetry/index.ts index 16db68445694..98c78af9bc7f 100644 --- a/src/client/telemetry/index.ts +++ b/src/client/telemetry/index.ts @@ -308,6 +308,7 @@ export interface IEventNamePropertyMapping { [EventName.UNITTEST_DISCOVER]: TestDiscoverytTelemetry; [EventName.UNITTEST_RUN]: TestRunTelemetry; [EventName.UNITTEST_STOP]: never | undefined; + [EventName.UNITTEST_DISABLE]: never | undefined; [EventName.UNITTEST_VIEW_OUTPUT]: never | undefined; [EventName.UPDATE_PYSPARK_LIBRARY]: never | undefined; [EventName.WORKSPACE_SYMBOLS_BUILD]: never | undefined; diff --git a/src/client/unittests/display/main.ts b/src/client/unittests/display/main.ts index 9a446f43bb91..4fd236bc2f6c 100644 --- a/src/client/unittests/display/main.ts +++ b/src/client/unittests/display/main.ts @@ -8,6 +8,8 @@ import { IConfigurationService } from '../../common/types'; import { UnitTests } from '../../common/utils/localize'; import { noop } from '../../common/utils/misc'; import { IServiceContainer } from '../../ioc/types'; +import { captureTelemetry } from '../../telemetry'; +import { EventName } from '../../telemetry/constants'; import { CANCELLATION_REASON } from '../common/constants'; import { ITestsHelper, Tests } from '../common/types'; import { ITestResultDisplay } from '../types'; @@ -144,6 +146,7 @@ export class TestResultDisplay implements ITestResultDisplay { this.discoverCounter = 0; } + @captureTelemetry(EventName.UNITTEST_DISABLE) // tslint:disable-next-line:no-any private async disableTests(): Promise { const configurationService = this.serviceContainer.get(IConfigurationService);