Revert "Merge from vscode merge-base (#22769)" (#22779)

This reverts commit 6bd0a17d3c.
This commit is contained in:
Karl Burtram
2023-04-18 21:44:05 -07:00
committed by GitHub
parent 6bd0a17d3c
commit 47a1745180
2389 changed files with 42588 additions and 92170 deletions

View File

@@ -99,7 +99,7 @@ const testModules = (async function () {
return promise.then(files => {
const modules = [];
for (const file of files) {
for (let file of files) {
if (!minimatch(file, excludeGlob)) {
modules.push(file.replace(/\.js$/, ''));
@@ -147,18 +147,15 @@ async function runTestsInBrowser(testModules, browserType) {
withReporter(browserType, new EchoRunner(emitter, browserType.toUpperCase()));
// collection failures for console printing
const failingModuleIds = [];
const failingTests = [];
const fails = [];
emitter.on('fail', (test, err) => {
failingTests.push({ title: test.fullTitle, message: err.message });
if (err.stack) {
const regex = /(vs\/.*\.test)\.js/;
for (const line of String(err.stack).split('\n')) {
for (let line of String(err.stack).split('\n')) {
const match = regex.exec(line);
if (match) {
failingModuleIds.push(match[1]);
return;
fails.push(match[1]);
break;
}
}
}
@@ -175,14 +172,8 @@ async function runTestsInBrowser(testModules, browserType) {
}
await browser.close();
if (failingTests.length > 0) {
let res = `The followings tests are failing:\n - ${failingTests.map(({ title, message }) => `${title} (reason: ${message})`).join('\n - ')}`;
if (failingModuleIds.length > 0) {
res += `\n\nTo DEBUG, open ${browserType.toUpperCase()} and navigate to ${target.href}?${failingModuleIds.map(module => `m=${module}`).join('&')}`;
}
return `${res}\n`;
if (fails.length > 0) {
return `to DEBUG, open ${browserType.toUpperCase()} and navigate to ${target.href}?${fails.map(module => `m=${module}`).join('&')}`;
}
}
@@ -264,7 +255,7 @@ testModules.then(async modules => {
}
// aftermath
for (const msg of messages) {
for (let msg of messages) {
if (msg) {
didFail = true;
console.log(msg);