Bug 1546665 - node tests should include the filename in the logs. r=davidwalsh
authorJason Laster <jlaster@mozilla.com>
Tue, 14 May 2019 21:52:55 +0000
changeset 532744 17fa1b52803256a98954a02e6196d0a92a25593c
parent 532743 59ae39ef8edf171b0ef5417e74402ae233f71dc4
child 532745 2f0be794dff5eba3d9cdcc633ad2994497562d41
push id11272
push userapavel@mozilla.com
push dateThu, 16 May 2019 15:28:22 +0000
treeherdermozilla-beta@2265bfc5920d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidwalsh
bugs1546665
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546665 - node tests should include the filename in the logs. r=davidwalsh Differential Revision: https://phabricator.services.mozilla.com/D31101
devtools/client/debugger/bin/try-runner.js
--- a/devtools/client/debugger/bin/try-runner.js
+++ b/devtools/client/debugger/bin/try-runner.js
@@ -21,36 +21,36 @@ function execOut(...args) {
     out = execFileSync(...args);
   } catch (e) {
     out = e.stdout;
     err = e.stderr;
   }
   return { out: out.toString(), err: err && err.toString() };
 }
 
-function logErrors(text, regexp) {
+function logErrors(tool, text, regexp) {
   const errors = text.match(regexp) || [];
   for (const error of errors) {
-    console.log(`TEST-UNEXPECTED-FAIL | ${error}`);
+    console.log(`TEST-UNEXPECTED-FAIL ${tool} | ${error}`);
   }
   return errors;
 }
 
 function logStart(name) {
   console.log(`TEST START | ${name}`);
 }
 
 function runFlowJson() {
   const { out } = execOut(flow, ["check", "--json"]);
   const results = JSON.parse(out);
 
   if (!results.passed) {
     for (const error of results.errors) {
       for (const message of error.message) {
-        console.log(`TEST-UNEXPECTED-FAIL | ${message.descr}`);
+        console.log(`TEST-UNEXPECTED-FAIL flow | ${message.descr}`);
       }
     }
   }
 
   return results.passed;
 }
 
 function runFlow() {
@@ -59,50 +59,54 @@ function runFlow() {
   console.log(out);
   return runFlowJson();
 }
 
 function eslint() {
   logStart("Eslint");
   const { out } = execOut("yarn", ["lint:js"]);
   console.log(out);
-  const errors = logErrors(out, / {2}error {2}(.*)/g);
+  const errors = logErrors("eslint", out, / {2}error {2}(.*)/g);
   return errors.length == 0;
 }
 
 function jest() {
   logStart("Jest");
   const { out, err } = execOut("yarn", ["test"]);
   console.log(err);
-  const errors = logErrors(err || "", / {4}✕(.*)/g);
+  const errors = logErrors("jest", err || "", / {4}✕(.*)/g);
   return errors.length == 0;
 }
 
 function stylelint() {
   logStart("Stylelint");
   const { out } = execOut("yarn", ["lint:css"]);
   console.log(out);
-  const errors = logErrors(out, / {2}✖(.*)/g);
+  const errors = logErrors("stylelint", out, / {2}✖(.*)/g);
   return errors.length == 0;
 }
 
 function jsxAccessibility() {
   logStart("Eslint (JSX Accessibility)");
 
   const { out } = execOut("yarn", ["lint:jsx-a11y"]);
   console.log(out);
-  const errors = logErrors(out, / {2}error {2}(.*)/g);
+  const errors = logErrors(
+    "eslint (jsx accessibility)",
+    out,
+    / {2}error {2}(.*)/g
+  );
   return errors.length == 0;
 }
 
 function lintMd() {
   logStart("Remark");
 
   const { out, err } = execOut("yarn", ["lint:md"]);
-  const errors = logErrors(err || "", /warning(.+)/g);
+  const errors = logErrors("remark", err || "", /warning(.+)/g);
   return errors.length == 0;
 }
 
 chdir(dbgPath);
 const flowPassed = runFlow();
 const eslintPassed = eslint();
 const jestPassed = jest();
 const styleLintPassed = stylelint();