Repository: incubator-zeppelin Updated Branches: refs/heads/master 77f7faec2 -> a884e0278
ZEPPELIN-294 Enable karma code coverage plugin - grunt build generates the coverage report for js in zeppelin-web - to view the report open `zeppelin-web/reports/coverage/PhantomJS 1.9.8 (Mac OS X 0.0.0)/index.html` in browser <img width="1242" alt="screen shot 2015-09-10 at 12 45 28 pm" src="https://cloud.githubusercontent.com/assets/2031306/9782316/e27a2d8c-57b9-11e5-9c13-c9ff212c7bc0.png"> Author: Renjith Kamath <[email protected]> Closes #292 from r-kamath/ZEPPELIN-294 and squashes the following commits: 991c753 [Renjith Kamath] ZEPPELIN-294 update report dir path f045695 [Renjith Kamath] ZEPPELIN-294 update components path and coverage report path in karma conf 88ffb1c [Renjith Kamath] ZEPPELIN-294 Enable karma code coverage plugin Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/a884e027 Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/a884e027 Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/a884e027 Branch: refs/heads/master Commit: a884e0278f334ca6dee81f01373931cee2054547 Parents: 77f7fae Author: Renjith Kamath <[email protected]> Authored: Thu Sep 10 14:51:27 2015 +0530 Committer: Damien CORNEAU <[email protected]> Committed: Thu Oct 15 15:20:25 2015 +0900 ---------------------------------------------------------------------- .gitignore | 1 + zeppelin-web/package.json | 3 ++- zeppelin-web/pom.xml | 1 + zeppelin-web/test/karma.conf.js | 15 ++++++++++++++- 4 files changed, 18 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/a884e027/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index b914343..aa53060 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ zeppelin-web/.sass-cache zeppelin-web/bower_components **nbproject/ **node/ +zeppelin-web/reports/coverage # project level http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/a884e027/zeppelin-web/package.json ---------------------------------------------------------------------- diff --git a/zeppelin-web/package.json b/zeppelin-web/package.json index e984e88..4a5eea3 100644 --- a/zeppelin-web/package.json +++ b/zeppelin-web/package.json @@ -32,7 +32,8 @@ "grunt-karma": "~0.8.3", "karma-phantomjs-launcher": "~0.1.4", "karma": "~0.12.23", - "karma-jasmine": "~0.1.5" + "karma-jasmine": "~0.1.5", + "karma-coverage": "^0.5.1" }, "engines": { "node": ">=0.10.0" http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/a884e027/zeppelin-web/pom.xml ---------------------------------------------------------------------- diff --git a/zeppelin-web/pom.xml b/zeppelin-web/pom.xml index 68f7550..ac71bcd 100644 --- a/zeppelin-web/pom.xml +++ b/zeppelin-web/pom.xml @@ -79,6 +79,7 @@ <exclude>bower.json</exclude> <exclude>package.json</exclude> <exclude>*.md</exclude> + <exclude>reports/**</exclude> </excludes> </configuration> </plugin> http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/a884e027/zeppelin-web/test/karma.conf.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/test/karma.conf.js b/zeppelin-web/test/karma.conf.js index ce72b7c..409c3a7 100644 --- a/zeppelin-web/test/karma.conf.js +++ b/zeppelin-web/test/karma.conf.js @@ -59,6 +59,7 @@ module.exports = function(config) { 'src/app/app.js', 'src/app/app.controller.js', 'src/app/**/*.js', + 'src/components/**/*.js', 'test/spec/**/*.js' ], @@ -80,10 +81,22 @@ module.exports = function(config) { 'PhantomJS' ], + reporters: 'coverage', + + preprocessors: { + 'src/*/{*.js,!(test)/**/*.js}': 'coverage' + }, + + coverageReporter: { + type: 'html', + dir: 'reports/coverage' + }, + // Which plugins to enable plugins: [ 'karma-phantomjs-launcher', - 'karma-jasmine' + 'karma-jasmine', + 'karma-coverage' ], // Continuous Integration mode
