Telemetry for Data Workspaces extension (#13846)

* Add CodeQL Analysis workflow (#10195)

* Add CodeQL Analysis workflow

* Fix path

* test commit pls ignore

* telemetry points

* yarn lock changes

* making test xplat friendly

* PR feedback

* Adding additional telemetry points

Co-authored-by: Justin Hutchings <jhutchings1@users.noreply.github.com>
This commit is contained in:
Benjin Dubishar
2021-01-22 14:18:43 -08:00
committed by GitHub
parent e280205340
commit c903cd87bf
18 changed files with 626 additions and 17 deletions

View File

@@ -0,0 +1,21 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as os from 'os';
import * as path from 'path';
import should = require('should');
import { calculateRelativity } from '../common/telemetry';
suite('Utilities Tests', function (): void {
test('test CalculateRelativity', async () => {
const root = os.platform() === 'win32' ? 'Z:\\' : '/';
const workspacePath = path.join(root, 'Source', 'Workspace', 'qwerty.code-workspace');
should.equal(calculateRelativity(path.join(root, 'Source', 'Workspace', 'qwerty.sqlproj'), workspacePath), 'sameFolder');
should.equal(calculateRelativity(path.join(root, 'Source', 'Workspace', 'qwerty', 'asdfg', 'qwerty.sqlproj'), workspacePath), 'directAncestor');
should.equal(calculateRelativity(path.join(root, 'Users', 'BillG', 'qwerty.sqlproj'), workspacePath), 'other');
});
});