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:
Anthony Dresser
2019-09-03 17:59:19 -07:00
committed by GitHub
parent c94291af52
commit b8518f5795
4 changed files with 23 additions and 36 deletions

View File

@@ -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));
};