@@ -12,6 +12,7 @@ import { StopWatch } from '../common/utils/stopWatch';
1212import { EnvironmentType , PythonEnvironment } from '../pythonEnvironments/info' ;
1313import { TensorBoardPromptSelection } from '../tensorBoard/constants' ;
1414import { EventName } from './constants' ;
15+ import type { UnitTestRunFailureCategory } from './constants' ;
1516import type { TestTool } from './types' ;
1617
1718/**
@@ -2165,7 +2166,12 @@ export interface IEventNamePropertyMapping {
21652166 /* __GDPR__
21662167 "unittest.discovery.done" : {
21672168 "tool" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
2168- "failed" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" }
2169+ "failed" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
2170+ "mode" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
2171+ "trigger" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
2172+ "failureCategory" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "eleanorjboyd" },
2173+ "totalDurationMs" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "eleanorjboyd", "isMeasurement": true },
2174+ "testCount" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "eleanorjboyd", "isMeasurement": true }
21692175 }
21702176 */
21712177 [ EventName . UNITTEST_DISCOVERY_DONE ] : {
@@ -2181,6 +2187,36 @@ export interface IEventNamePropertyMapping {
21812187 * @type {boolean }
21822188 */
21832189 failed : boolean ;
2190+ /**
2191+ * Testing architecture used for discovery:
2192+ * 'project' = per-project discovery through the Python Environments API;
2193+ * 'legacy' = workspace-level discovery through the existing WorkspaceTestAdapter.
2194+ */
2195+ mode ?: 'project' | 'legacy' ;
2196+ /**
2197+ * Source that triggered the discovery.
2198+ */
2199+ trigger ?: 'auto' | 'ui' | 'commandpalette' | 'watching' | 'interpreter' ;
2200+ /**
2201+ * Coarse failure category. Only populated when `failed` is true.
2202+ */
2203+ failureCategory ?:
2204+ | 'subprocess-exit-non-zero'
2205+ | 'pipe-error'
2206+ | 'pytest-collect-error'
2207+ | 'plugin-exception'
2208+ | 'timeout'
2209+ | 'env-resolution'
2210+ | 'cancelled'
2211+ | 'unknown' ;
2212+ /**
2213+ * Wall-clock duration of the discovery cycle in milliseconds.
2214+ */
2215+ totalDurationMs ?: number ;
2216+ /**
2217+ * Number of test items discovered (leaf nodes).
2218+ */
2219+ testCount ?: number ;
21842220 } ;
21852221 /**
21862222 * Telemetry event sent when cancelling discovering tests
@@ -2222,6 +2258,43 @@ export interface IEventNamePropertyMapping {
22222258 "unittest.run.all_failed" : { "owner": "eleanorjboyd" }
22232259 */
22242260 [ EventName . UNITTEST_RUN_ALL_FAILED ] : never | undefined ;
2261+ /**
2262+ * Telemetry event sent at the end of a test run, capturing duration and pipe health.
2263+ * Companion to UNITTEST_RUN (which is emitted at run start).
2264+ */
2265+ /* __GDPR__
2266+ "unittest.run.done" : {
2267+ "tool" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
2268+ "debugging" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
2269+ "mode" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
2270+ "failed" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
2271+ "failureCategory" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "eleanorjboyd" },
2272+ "durationMs" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "eleanorjboyd", "isMeasurement": true },
2273+ "requestedCount" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "eleanorjboyd", "isMeasurement": true }
2274+ }
2275+ */
2276+ [ EventName . UNITTEST_RUN_DONE ] : {
2277+ tool : TestTool ;
2278+ debugging : boolean ;
2279+ mode : 'project' | 'legacy' ;
2280+ /**
2281+ * `true` if the run ended without reporting all requested results,
2282+ * or if the subprocess crashed / threw.
2283+ */
2284+ failed : boolean ;
2285+ /**
2286+ * Coarse failure category when `failed` is true.
2287+ */
2288+ failureCategory ?: UnitTestRunFailureCategory ;
2289+ /**
2290+ * Wall-clock duration of the run in milliseconds.
2291+ */
2292+ durationMs ?: number ;
2293+ /**
2294+ * Number of test items the user asked to run.
2295+ */
2296+ requestedCount ?: number ;
2297+ } ;
22252298 /**
22262299 * Telemetry event sent when testing is disabled for a workspace.
22272300 */
0 commit comments