Bug 1575570 - Check if yarn is installed when running DevTools node tests r=ochameau
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 22 Aug 2019 16:16:05 +0000
changeset 553225 e18558240aab248c3fed1dd90f584f5a3dd4f234
parent 553224 29f5987dc9351ed3fbce4657a723cf0cdc8f9e42
child 553226 57a5a83f9a6275931ffa5b3f6504e2fea1f91ebf
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1575570
milestone70.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 1575570 - Check if yarn is installed when running DevTools node tests r=ochameau Depends on D42894 Differential Revision: https://phabricator.services.mozilla.com/D42895
devtools/client/bin/devtools-node-test-runner.js
--- a/devtools/client/bin/devtools-node-test-runner.js
+++ b/devtools/client/bin/devtools-node-test-runner.js
@@ -115,16 +115,28 @@ function runTests() {
       "Invalid suite argument to devtools-node-test-runner: " + suite
     );
   }
 
   console.log("[devtools-node-test-runner] Found test suite: " + suite);
   const testPath = path.join(__dirname, SUITES[suite].path);
   chdir(testPath);
 
+  console.log("[devtools-node-test-runner] Check `yarn` is available");
+  try {
+    // This will throw if yarn is unavailable
+    execFileSync("yarn", ["--version"]);
+  } catch (e) {
+    console.log(
+      "[devtools-node-test-runner] ERROR: `yarn` is not installed. " +
+        "See https://yarnpkg.com/docs/install/ "
+    );
+    return false;
+  }
+
   console.log("[devtools-node-test-runner] Run `yarn` in test folder");
   execOut("yarn");
 
   console.log(`TEST START | ${SUITES[suite].type} | ${suite}`);
 
   console.log("[devtools-node-test-runner] Run `yarn test` in test folder");
   const { out, err } = execOut("yarn", ["test-ci"]);