Disable telemetry when in extension testing enviornment

This commit is contained in:
Logan Ramos 2022-01-14 14:58:15 -05:00
parent 6b4ccf3141
commit dbe529d01e
No known key found for this signature in database
GPG key ID: D9CCFF14F0B18183

View file

@ -98,17 +98,17 @@ export function configurationTelemetry(telemetryService: ITelemetryService, conf
}
/**
* Determines how telemetry is handled based on the current running configuration.
* To log telemetry locally, the client must not disable telemetry via the CLI
* If client is a built product and telemetry is enabled via the product.json, telemetry is supported
* This function is only used to determine if telemetry contructs should occur, but is not impacted by user configuration
*
* Determines whether or not we support logging telemetry.
* This checks if the product is capable of collecting telemetry but not whether or not it can send it
* For checking the user setting and what telemetry you can send please check `getTelemetryLevel`.
* This returns true if `--disable-telemetry` wasn't used, the product.json allows for telemetry, and we're not testing an extension
* If false telemetry is disabled throughout the product
* @param productService
* @param environmentService
* @returns false - telemetry is completely disabled, true - telemetry is logged locally, but may not be sent
*/
export function supportsTelemetry(productService: IProductService, environmentService: IEnvironmentService): boolean {
return !(environmentService.disableTelemetry || !productService.enableTelemetry);
return !(environmentService.disableTelemetry || !productService.enableTelemetry || environmentService.extensionTestsLocationURI);
}
/**