Skip to content

Commit

Permalink
Capture telemetry when tests are disabled (#4997)
Browse files Browse the repository at this point in the history
For #4801
  • Loading branch information
DonJayamanne committed Mar 28, 2019
1 parent 095b74c commit 7c041fd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/3 Code Health/4801.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Capture telemetry when tests are disabled.
1 change: 1 addition & 0 deletions src/client/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions src/client/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/client/unittests/display/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<any> {
const configurationService = this.serviceContainer.get<IConfigurationService>(IConfigurationService);
Expand Down

0 comments on commit 7c041fd

Please sign in to comment.