Bug 1190298 - Make it easier to access Loop's code coverage. r=andreio NPOTB
authorMark Banner <standard8@mozilla.com>
Tue, 04 Aug 2015 11:57:20 +0100
changeset 287715 102bc51e9a574541c4a1589ac2c4e6bdcdb7a082
parent 287714 3f94e478ad8eb5590547f594f43f8d7fdde14fe6
child 287716 256463501f11564afd5a23ec9d36648c3545529b
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersandreio
bugs1190298
milestone42.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 1190298 - Make it easier to access Loop's code coverage. r=andreio NPOTB
browser/components/loop/.gitignore
browser/components/loop/test/coverage/index.html
browser/components/loop/test/index.html
browser/components/loop/test/karma/karma.conf.base.js
--- a/browser/components/loop/.gitignore
+++ b/browser/components/loop/.gitignore
@@ -1,2 +1,4 @@
 .module-cache
-test/coverage
+test/coverage/desktop
+test/coverage/shared_standalone
+test/node_modules
copy from browser/components/loop/test/index.html
copy to browser/components/loop/test/coverage/index.html
--- a/browser/components/loop/test/index.html
+++ b/browser/components/loop/test/coverage/index.html
@@ -1,18 +1,18 @@
 <!DOCTYPE html>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/.  -->
 <html>
 <head>
   <meta charset="utf-8">
-  <title>Loop test index</title>
+  <title>Loop coverage index</title>
 </head>
 <body>
-  <h1>Loop tests</h1>
+  <h1>Loop Coverage</h1>
   <ul>
-    <li><a href="shared/">Shared tests</a></li>
-    <li><a href="desktop-local/">Local tests</a></li>
-    <li><a href="standalone/">Standalone tests</a></li>
+    <li><a href="desktop/firefox/">Desktop Coverage</a></li>
+    <li><a href="shared_standalone/firefox/">Standalone Coverage</a></li>
+    <li><a href="../">Back to unit tests</a></li>
  </ul>
 </body>
 </html>
--- a/browser/components/loop/test/index.html
+++ b/browser/components/loop/test/index.html
@@ -8,11 +8,12 @@
   <title>Loop test index</title>
 </head>
 <body>
   <h1>Loop tests</h1>
   <ul>
     <li><a href="shared/">Shared tests</a></li>
     <li><a href="desktop-local/">Local tests</a></li>
     <li><a href="standalone/">Standalone tests</a></li>
+    <li><a href="coverage/">Code Coverage</a></li>
  </ul>
 </body>
 </html>
--- a/browser/components/loop/test/karma/karma.conf.base.js
+++ b/browser/components/loop/test/karma/karma.conf.base.js
@@ -23,18 +23,27 @@ module.exports = function(config) {
     frameworks: ["mocha"],
 
     // Test results reporter to use.
     // Possible values: "dots", "progress".
     // Available reporters: https://npmjs.org/browse/keyword/karma-reporter .
     reporters: ["progress", "coverage"],
 
     coverageReporter: {
-      type: "html",
-      dir: "test/coverage/"
+      dir: "test/coverage/",
+      reporters: [{
+        type: "html",
+        subdir: function(browser) {
+          // normalization process to keep a consistent browser name
+          // across different OS
+          return browser.toLowerCase().split(/[ /-]/)[0];
+        }
+      }, {
+        type: "text-summary"
+      }]
     },
 
     // Web server port.
     port: 9876,
 
     // Enable / disable colors in the output (reporters and logs).
     colors: true,