mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add pipeline args for testing (#7028)
* add pipeline args for testing * fix test publish step * simplify some testing code * change coverage reporters * fix coverage reports
This commit is contained in:
@@ -12,15 +12,12 @@ const iLibSourceMaps = require('istanbul-lib-source-maps');
|
||||
const iLibReport = require('istanbul-lib-report');
|
||||
const iReports = require('istanbul-reports');
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
var SQL_TEST_GLOB = '**/test/**/*.test.js|**/sqltest/**/*.test.jss';
|
||||
|
||||
const REPO_PATH = toUpperDriveLetter(path.join(__dirname, '..'));
|
||||
|
||||
exports.initialize = function (loaderConfig) {
|
||||
const instrumenter = iLibInstrument.createInstrumenter();
|
||||
loaderConfig.nodeInstrumenter = function (contents, source) {
|
||||
if (minimatch(source, SQL_TEST_GLOB)) { // {{SQL CARBON EDIT}}
|
||||
if (minimatch(source, '**/test/**/*.test.js')) {
|
||||
// tests don't get instrumented
|
||||
return contents;
|
||||
}
|
||||
@@ -45,10 +42,9 @@ exports.createReport = function (isSingle) {
|
||||
Object.keys(transformed.map.data).forEach((file) => {
|
||||
const entry = transformed.map.data[file];
|
||||
const fixedPath = fixPath(entry.path);
|
||||
if (!fixedPath.includes('\\vs\\') && !fixedPath.includes('/vs/')) {
|
||||
entry.data.path = fixedPath;
|
||||
newData[fixedPath] = entry;
|
||||
}
|
||||
if (fixedPath.includes('\\vs\\') || fixedPath.includes('/vs/')) { return; } // {{SQL CARBON EDIT}} skip vscode files
|
||||
entry.data.path = fixedPath;
|
||||
newData[fixedPath] = entry;
|
||||
});
|
||||
transformed.map.data = newData;
|
||||
|
||||
@@ -64,6 +60,7 @@ exports.createReport = function (isSingle) {
|
||||
reports.push(iReports.create('json'));
|
||||
reports.push(iReports.create('lcov'));
|
||||
reports.push(iReports.create('html'));
|
||||
reports.push(iReports.create('cobertura')); // {{SQL CARBON EDIT}} add covertura
|
||||
}
|
||||
reports.forEach(report => tree.visit(report, context));
|
||||
};
|
||||
|
||||
@@ -13,19 +13,14 @@ const util = require('util');
|
||||
const bootstrap = require('../../src/bootstrap');
|
||||
const coverage = require('../coverage');
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
require('reflect-metadata');
|
||||
require('reflect-metadata'); // {{SQL CARBON EDIT}}
|
||||
|
||||
// Disabled custom inspect. See #38847
|
||||
if (util.inspect && util.inspect['defaultOptions']) {
|
||||
util.inspect['defaultOptions'].customInspect = false;
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
let _tests_glob = '**/*test*/**/*.test.js';
|
||||
// {{SQL CARBON EDIT}}
|
||||
let _sql_tests_glob = '**/sqltest/**/*.test.js';
|
||||
|
||||
let _tests_glob = '**/test/**/*.test.js';
|
||||
let loader;
|
||||
let _out;
|
||||
|
||||
@@ -40,16 +35,14 @@ function initLoader(opts) {
|
||||
nodeMain: __filename,
|
||||
catchError: true,
|
||||
baseUrl: bootstrap.uriFromPath(path.join(__dirname, '../../src')),
|
||||
// {{SQL CARBON EDIT}}
|
||||
paths: {
|
||||
'vs': `../${outdir}/vs`,
|
||||
'sqltest': `../${outdir}/sqltest`,
|
||||
'sql': `../${outdir}/sql`,
|
||||
'sqltest': `../${outdir}/sqltest`, // {{SQL CARBON EDIT}}
|
||||
'sql': `../${outdir}/sql`, // {{SQL CARBON EDIT}}
|
||||
'lib': `../${outdir}/lib`,
|
||||
'bootstrap-fork': `../${outdir}/bootstrap-fork`
|
||||
},
|
||||
// {{SQL CARBON EDIT}}
|
||||
nodeModules: [
|
||||
nodeModules: [ // {{SQL CARBON EDIT}}
|
||||
'@angular/common',
|
||||
'@angular/core',
|
||||
'@angular/forms',
|
||||
|
||||
Reference in New Issue
Block a user