Bug 1496341 - Run debugger tests on try. r=loganfsmyth,ahal
authorJason Laster <jlaster@mozilla.com>
Thu, 28 Feb 2019 14:18:59 +0000
changeset 519607 73298bafb7aec4181e2f10516c4d5e21be42e1d4
parent 519606 865ffd54922df9290d217c75d126da23d0a373c0
child 519608 d7d6b249119a5c8a8b179407f801152f09acb0b3
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersloganfsmyth, ahal
bugs1496341
milestone67.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 1496341 - Run debugger tests on try. r=loganfsmyth,ahal Differential Revision: https://phabricator.services.mozilla.com/D21217
devtools/client/debugger/new/package.json
devtools/client/debugger/new/src/test/tests-setup.js
taskcluster/ci/config.yml
taskcluster/ci/source-test/kind.yml
taskcluster/ci/source-test/mocha.yml
taskcluster/ci/source-test/node.yml
taskcluster/docker/lint/system-setup.sh
--- a/devtools/client/debugger/new/package.json
+++ b/devtools/client/debugger/new/package.json
@@ -6,19 +6,16 @@
     "url": "git://github.com/firefox-devtools/debugger.html.git",
     "type": "git"
   },
   "bugs": {
     "url": "https://github.com/firefox-devtools/debugger.html/issues"
   },
   "homepage": "https://github.com/firefox-devtools/debugger.html#readme",
   "engineStrict": true,
-  "engines": {
-    "node": ">=10.15.0"
-  },
   "scripts": {
     "start": "node bin/dev-server",
     "start-app": "TARGET=application node bin/dev-server",
     "flow": "flow",
     "eslint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
     "prettier": "node bin/prettier.js",
     "license-check": "devtools-license-check",
     "links": "ls -l node_modules/ | grep ^l || echo 'no linked packages'",
--- a/devtools/client/debugger/new/src/test/tests-setup.js
+++ b/devtools/client/debugger/new/src/test/tests-setup.js
@@ -37,21 +37,22 @@ import { clearDocuments } from "../utils
 import { clearHistory } from "./utils/history";
 
 import env from "devtools-environment/test-flag";
 env.testing = true;
 
 const rootPath = path.join(__dirname, "../../");
 
 function getL10nBundle() {
-  const read = file => readFileSync(path.join(__dirname, file));
+  const read = file => readFileSync(path.join(rootPath, file));
+
   try {
-    return read("../../assets/panel/debugger.properties");
+    return read("./assets/panel/debugger.properties");
   } catch (e) {
-    return read("../../../../locales/en-us/debugger.properties");
+    return read("../../locales/en-US/debugger.properties");
   }
 }
 
 global.DebuggerConfig = {};
 global.L10N = require("devtools-launchpad").L10N;
 global.L10N.setBundle(getL10nBundle());
 global.jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000;
 global.performance = { now: () => 0 };
@@ -106,8 +107,25 @@ function mockIndexeddDB() {
   return {
     open: () => ({}),
     getItem: async key => store[key],
     setItem: async (key, value) => {
       store[key] = value;
     }
   };
 }
+
+// NOTE: We polyfill finally because TRY uses node 8
+if (!global.Promise.prototype.finally) {
+  global.Promise.prototype.finally = function finallyPolyfill(callback) {
+    var constructor = this.constructor;
+
+    return this.then(function(value) {
+        return constructor.resolve(callback()).then(function() {
+          return value;
+        });
+      }, function(reason) {
+        return constructor.resolve(callback()).then(function() {
+          throw reason;
+        });
+      });
+  };
+}
--- a/taskcluster/ci/config.yml
+++ b/taskcluster/ci/config.yml
@@ -1,17 +1,17 @@
 trust-domain: gecko
 project-repo-param-prefix: ''
 product-dir: 'browser'
 treeherder:
     group-names:
         'cram': 'Cram tests'
         'js-bench-sm': 'JavaScript shell benchmarks with Spidermonkey'
         'js-bench-v8': 'JavaScript shell benchmarks with Google V8'
-        'mocha': 'Mocha unit tests'
+        'node': 'Node tests'
         'py2': 'Python 2 unit tests'
         'py3': 'Python 3 unit tests'
         'A': 'Android Gradle tests'
         'Bpgo': 'Profile-guided optimization builds'
         'Fetch-URL': 'Fetch and store content'
         'Fxfn-l': 'Firefox functional tests (local)'
         'Fxfn-l-e10s': 'Firefox functional tests (local) with e10s'
         'Fxfn-r': 'Firefox functional tests (remote)'
--- a/taskcluster/ci/source-test/kind.yml
+++ b/taskcluster/ci/source-test/kind.yml
@@ -14,18 +14,18 @@ kind-dependencies:
    - fetch
    - toolchain
 
 jobs-from:
    - cram.yml
    - doc.yml
    - file-metadata.yml
    - jsshell.yml
-   - mocha.yml
    - mozlint.yml
+   - node.yml
    - python.yml
    - webidl.yml
    - wpt-manifest.yml
 
 # This is used by run-task based tasks to lookup which build task it
 # should depend on based on its own platform.
 dependent-build-platforms:
    linux64-asan/opt: build-linux64-asan/opt
deleted file mode 100644
--- a/taskcluster/ci/source-test/mocha.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-eslint-plugin-mozilla:
-    description: eslint-plugin-mozilla integration tests
-    platform: linux64/opt
-    treeherder:
-        symbol: mocha(epm)
-        kind: test
-        tier: 1
-    worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
-    worker:
-        docker-image: {in-tree: "lint"}
-        max-run-time: 1800
-    run:
-        using: run-task
-        cache-dotcache: true
-        command: >
-            cd /builds/worker/checkouts/gecko/tools/lint/eslint/eslint-plugin-mozilla &&
-            cp -r /build/node_modules_eslint-plugin-mozilla node_modules &&
-            npm run test
-    when:
-        files-changed:
-            - 'tools/lint/eslint/eslint-plugin-mozilla/**'
new file mode 100644
--- /dev/null
+++ b/taskcluster/ci/source-test/node.yml
@@ -0,0 +1,44 @@
+debugger-tests:
+    description: devtools debugger unit tests and flow type checks
+    platform: linux64/opt
+    treeherder:
+        symbol: node(debugger)
+        kind: test
+        tier: 1
+    worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
+    worker:
+        docker-image: {in-tree: "lint"}
+        max-run-time: 1800
+    run:
+        using: run-task
+        cache-dotcache: true
+        command: >
+            cd /builds/worker/checkouts/gecko/devtools/client/debugger/new/ &&
+            yarn &&
+            yarn flow &&
+            yarn test
+    when:
+        files-changed:
+            - 'devtools/client/debugger/new/**'
+
+eslint-plugin-mozilla:
+    description: eslint-plugin-mozilla integration tests
+    platform: linux64/opt
+    treeherder:
+        symbol: node(epm)
+        kind: test
+        tier: 1
+    worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
+    worker:
+        docker-image: {in-tree: "lint"}
+        max-run-time: 1800
+    run:
+        using: run-task
+        cache-dotcache: true
+        command: >
+            cd /builds/worker/checkouts/gecko/tools/lint/eslint/eslint-plugin-mozilla &&
+            cp -r /build/node_modules_eslint-plugin-mozilla node_modules &&
+            npm run test
+    when:
+        files-changed:
+            - 'tools/lint/eslint/eslint-plugin-mozilla/**'
--- a/taskcluster/docker/lint/system-setup.sh
+++ b/taskcluster/docker/lint/system-setup.sh
@@ -46,21 +46,18 @@ cd /build
 ###
 # ESLint Setup
 ###
 
 # install node
 # shellcheck disable=SC1091
 . install-node.sh
 
-###
-# jsdoc Setup
-###
-
 npm install -g jsdoc@3.5.5
+npm install -g yarn@1.9.4
 
 /build/tooltool.py fetch -m /tmp/eslint.tt
 mv /build/node_modules /build/node_modules_eslint
 /build/tooltool.py fetch -m /tmp/eslint-plugin-mozilla.tt
 mv /build/node_modules /build/node_modules_eslint-plugin-mozilla
 
 ###
 # fzf setup