mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 12:08:36 -05:00
Add coverage for extension tests (#8961)
* wip * Add code coverage files to all extensions * Update vscodetestcover * Update yarn.lock * Update CMS yarn.lock * Update vscodetestcover version
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
src/**
|
||||
src
|
||||
tsconfig.json
|
||||
python/**
|
||||
r_packages/**
|
||||
out/test/**
|
||||
python
|
||||
r_packages
|
||||
out/test
|
||||
coverage
|
||||
coverConfig.json
|
||||
|
||||
19
extensions/machine-learning-services/coverConfig.json
Normal file
19
extensions/machine-learning-services/coverConfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"enabled": true,
|
||||
"relativeSourcePath": "..",
|
||||
"relativeCoverageDir": "../../coverage",
|
||||
"ignorePatterns": [
|
||||
"**/node_modules/**",
|
||||
"**/test/**"
|
||||
],
|
||||
"includePid": false,
|
||||
"reports": [
|
||||
"cobertura",
|
||||
"lcov"
|
||||
],
|
||||
"verbose": false,
|
||||
"remapOptions": {
|
||||
"basePath": "..",
|
||||
"useAbsolutePaths": true
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,9 @@
|
||||
"mocha-multi-reporters": "^1.1.7",
|
||||
"should": "^13.2.1",
|
||||
"typemoq": "^2.1.0",
|
||||
"vscode": "1.1.26"
|
||||
"vscodetestcover": "github:corivera/vscodetestcover#1.0.4"
|
||||
},
|
||||
"resolutions": {
|
||||
"esprima": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const path = require('path');
|
||||
const testRunner = require('vscode/lib/testrunner');
|
||||
import * as path from 'path';
|
||||
const testRunner = require('vscodetestcover');
|
||||
|
||||
const suite = 'machine learning Extension Tests';
|
||||
|
||||
const options: any = {
|
||||
const mochaOptions: any = {
|
||||
ui: 'bdd',
|
||||
useColors: true,
|
||||
timeout: 10000
|
||||
@@ -16,25 +16,25 @@ const options: any = {
|
||||
|
||||
// set relevant mocha options from the environment
|
||||
if (process.env.ADS_TEST_GREP) {
|
||||
options.grep = process.env.ADS_TEST_GREP;
|
||||
console.log(`setting options.grep to: ${options.grep}`);
|
||||
mochaOptions.grep = process.env.ADS_TEST_GREP;
|
||||
console.log(`setting options.grep to: ${mochaOptions.grep}`);
|
||||
}
|
||||
if (process.env.ADS_TEST_INVERT_GREP) {
|
||||
options.invert = parseInt(process.env.ADS_TEST_INVERT_GREP);
|
||||
console.log(`setting options.invert to: ${options.invert}`);
|
||||
mochaOptions.invert = parseInt(process.env.ADS_TEST_INVERT_GREP);
|
||||
console.log(`setting options.invert to: ${mochaOptions.invert}`);
|
||||
}
|
||||
if (process.env.ADS_TEST_TIMEOUT) {
|
||||
options.timeout = parseInt(process.env.ADS_TEST_TIMEOUT);
|
||||
console.log(`setting options.timeout to: ${options.timeout}`);
|
||||
mochaOptions.timeout = parseInt(process.env.ADS_TEST_TIMEOUT);
|
||||
console.log(`setting options.timeout to: ${mochaOptions.timeout}`);
|
||||
}
|
||||
if (process.env.ADS_TEST_RETRIES) {
|
||||
options.retries = parseInt(process.env.ADS_TEST_RETRIES);
|
||||
console.log(`setting options.retries to: ${options.retries}`);
|
||||
mochaOptions.retries = parseInt(process.env.ADS_TEST_RETRIES);
|
||||
console.log(`setting options.retries to: ${mochaOptions.retries}`);
|
||||
}
|
||||
|
||||
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
||||
options.reporter = 'mocha-multi-reporters';
|
||||
options.reporterOptions = {
|
||||
mochaOptions.reporter = 'mocha-multi-reporters';
|
||||
mochaOptions.reporterOptions = {
|
||||
reporterEnabled: 'spec, mocha-junit-reporter',
|
||||
mochaJunitReporterReporterOptions: {
|
||||
testsuitesTitle: `${suite} ${process.platform}`,
|
||||
@@ -43,6 +43,6 @@ if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
||||
};
|
||||
}
|
||||
|
||||
testRunner.configure(options);
|
||||
testRunner.configure(mochaOptions, { coverConfig: '../../coverConfig.json' });
|
||||
|
||||
export = testRunner;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user