Skip to content

Commit

Permalink
disable telemetry in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrivachev committed Oct 28, 2021
1 parent 7a359d3 commit 8db1671
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions client/src/TelemetryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export class TelemetryClient {
}

static activate(context: ExtensionContext): TelemetryReporter {
if (process.env['DBT_LS_DISABLE_TELEMETRY']) {
return null;
}

var extensionPath = path.join(context.extensionPath, 'package.json');
var packageJson = JSON.parse(fs.readFileSync(extensionPath, 'utf8'));

Expand Down
2 changes: 1 addition & 1 deletion client/src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function main() {
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: [path.resolve(__dirname, '../../test-fixture/')],
extensionTestsEnv: { CLI_PATH: cliPath },
extensionTestsEnv: { CLI_PATH: cliPath, DBT_LS_DISABLE_TELEMETRY: 'true' },
});
} catch (err) {
console.error('Failed to run tests');
Expand Down

0 comments on commit 8db1671

Please sign in to comment.