Add ability to disable analytics for performance testing

Change-type: patch
Connects-to: #1708
Signed-off-by: Scott Lowe <scott@balena.io>
This commit is contained in:
Scott Lowe 2020-11-26 13:47:48 +01:00
parent ac49246141
commit 950d173d27

View File

@ -104,8 +104,11 @@ export async function trackCommand(commandSignature: string) {
});
});
}
// Don't actually call mixpanel.track() while running test cases
if (!process.env.BALENA_CLI_TEST_TYPE) {
// Don't actually call mixpanel.track() while running test cases, or if suppressed
if (
!process.env.BALENA_CLI_TEST_TYPE &&
!process.env.BALENARC_NO_ANALYTICS
) {
await mixpanel.track(`[CLI] ${commandSignature}`, {
distinct_id: username,
version: packageJSON.version,