-
Notifications
You must be signed in to change notification settings - Fork 17
GPII-2515: Add code coverage reporting... #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
aa022b6
7a00d8a
ef44933
1736769
3435914
868ebe3
17229e6
db4b892
fe15eae
1f5327a
f1e851b
21b322b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # A common istanbul configuration file. Avoids generating reports, as we are collecting data from various runs, and | ||
| # will do that as a "posttest" step. You must explicitly generate a report and summary, see the package.json for an | ||
| # example command. | ||
| instrumentation: | ||
| root: . | ||
| include-pid: true | ||
| default-excludes: false | ||
| excludes: ["tests/**", "coverage/**", "instrumented/**", "node_modules/**"] | ||
| complete-copy: true | ||
| reporting: | ||
| dir: ./coverage | ||
| print: none | ||
| reports: | ||
| - none |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,49 @@ | ||
| { | ||
| "name": "gpii-linux", | ||
| "description": "Components of the GPII personalization infrastructure for use on Linux", | ||
| "version": "0.3.0", | ||
| "author": "GPII", | ||
| "bugs": "http://issues.gpii.net/browse/GPII", | ||
| "homepage": "http://gpii.net/", | ||
| "dependencies": { | ||
| "universal": "GPII/universal#1a3434d970cb484956eb18310683bdfe473123d6" | ||
| }, | ||
| "devDependencies": { | ||
| "grunt": "1.0.1", | ||
| "fluid-grunt-eslint": "18.1.1", | ||
| "grunt-jsonlint": "1.0.4", | ||
| "grunt-shell": "1.3.0", | ||
| "nan": "2.4.0" | ||
| }, | ||
| "license" : "BSD-3-Clause", | ||
| "keywords": [ | ||
| "gpii", | ||
| "accessibility", | ||
| "settings", | ||
| "fluid", | ||
| "IoC", | ||
| "Inversion of Control", | ||
| "configuration", | ||
| "evented" | ||
| ], | ||
| "repository": "git://github.com/GPII/linux.git", | ||
| "main": "./gpii/index.js", | ||
| "engines": { | ||
| "node": ">=4.2.1" | ||
| } | ||
| "name": "gpii-linux", | ||
| "description": "Components of the GPII personalization infrastructure for use on Linux", | ||
| "version": "0.3.0", | ||
| "author": "GPII", | ||
| "bugs": "http://issues.gpii.net/browse/GPII", | ||
| "homepage": "http://gpii.net/", | ||
| "dependencies": { | ||
| "universal": "GPII/universal#06d5b9b672feecac88e2cf8e351248fad503a111" | ||
| }, | ||
| "devDependencies": { | ||
| "fluid-grunt-eslint": "18.1.1", | ||
| "grunt": "1.0.1", | ||
| "grunt-jsonlint": "1.0.4", | ||
| "grunt-shell": "1.3.0", | ||
| "istanbul": "git://github.com/the-t-in-rtf/istanbul#828eb930add7bd663ca20649a917f3f3829e48c5", | ||
| "nan": "2.4.0", | ||
| "rimraf": "2.6.1" | ||
| }, | ||
| "license": "BSD-3-Clause", | ||
| "keywords": [ | ||
| "gpii", | ||
| "accessibility", | ||
| "settings", | ||
| "fluid", | ||
| "IoC", | ||
| "Inversion of Control", | ||
| "configuration", | ||
| "evented" | ||
| ], | ||
| "repository": "git://github.com/GPII/linux.git", | ||
| "main": "./gpii/index.js", | ||
| "engines": { | ||
| "node": ">=4.2.1" | ||
| }, | ||
| "scripts": { | ||
| "pretest": "node node_modules/rimraf/bin.js coverage/* reports/*", | ||
| "test": "npm run test:unit && npm run test:acceptance", | ||
| "test:unit": "npm run test:unit:pretest && npm run test:unit:run && npm run test:unit:posttest", | ||
| "test:unit:pretest": "/usr/bin/bash ./gpii/node_modules/gsettingsBridge/tests/scripts/pretest.sh", | ||
| "test:unit:run": "node node_modules/istanbul/lib/cli.js cover tests/UnitTests.js --include-pid", | ||
| "test:unit:posttest": "/usr/bin/bash ./gpii/node_modules/gsettingsBridge/tests/scripts/posttest.sh", | ||
| "test:acceptance": "node node_modules/istanbul/lib/cli.js cover tests/AcceptanceTests.js --include-pid", | ||
| "test:vagrant": "vagrant ssh -c 'cd /home/vagrant/sync; npm install && DISPLAY=:0 npm test'", | ||
| "test:vagrantUnit": "vagrant ssh -c 'cd /home/vagrant/sync; npm install && DISPLAY=:0 npm run test:unit'", | ||
| "test:vagrantAcceptance": "vagrant ssh -c 'cd /home/vagrant/sync; npm install && DISPLAY=:0 npm run test:acceptance'", | ||
| "posttest": "node node_modules/istanbul/lib/cli.js report lcov text-summary" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // Rollup to run all javascript-only unit tests. | ||
| "use strict"; | ||
| require("../gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js"); | ||
| require("../gpii/node_modules/orca/test/orcaSettingsHandlerTests.js"); | ||
| require("../gpii/node_modules/packagekit/test/all-tests.js"); | ||
| require("../gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test"); | ||
| require("../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js"); | ||
| require("../gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js"); | ||
| require("../gpii/node_modules/gsettingsBridge/tests/gsettingsTests"); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,34 +17,16 @@ declare -i error_code | |
|
|
||
| trap 'error_code=$?' ERR EXIT | ||
|
|
||
| # TODO: Convert this to a javascript-only approach so that we can test code coverage. | ||
| pushd . | ||
| cd ../gpii/node_modules/alsa/test | ||
| node alsaSettingsHandlerTests.js | ||
| popd | ||
|
|
||
| pushd . | ||
| cd ../gpii/node_modules/gsettingsBridge/tests | ||
| cd gpii/node_modules/gsettingsBridge/tests | ||
| # TODO: See if we can make this into a javascript-only approach | ||
| ./runUnitTests.sh | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess that we will get rid of this shell script (UnitTests.sh) but it won't run after your refactoring of runUnitTests.sh.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As soon as I confirm the node_gsettings tests will run, I'll get rid of it.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
| # TODO: Produces no output when run on its own from the repo root. Investigate. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't produce any output unless there's an error as nodegsettings_tests.js uses the assert module. I'd say that these tests must be updated to use jqUnit so we can get the output even if they're not failing. In any case, you can just add it into UnitTests.js so it runs like the others and we can just get rid of this script. The side-effect of this is that we won't get the results of the rest of the tests when this one (nodegsettings_tests.js) fails until we refactor the tests to use jqUnit.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll rewrite the tests to use node-jqUnit, that seems too easy to not just take care of while I'm here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
| cd ../nodegsettings | ||
| node .//nodegsettings_tests.js | ||
| popd | ||
|
|
||
| pushd . | ||
| cd ../gpii/node_modules/orca/test | ||
| node orcaSettingsHandlerTests.js | ||
| popd | ||
|
|
||
| pushd . | ||
| cd ../gpii/node_modules/packagekit/test/ | ||
| node .//all-tests.js | ||
| cd ../nodepackagekit | ||
| node nodepackagekit_test.js | ||
| popd | ||
|
|
||
| # These XRANDR tests crash out on my system (AMB - Fedora 19 64-bit in VMWare Workstation 10.0.1 on Windows 7 64-bit) | ||
| node ../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js | ||
| node ../gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js | ||
|
|
||
| if [ -n "$error_code" ]; then | ||
| exit 1 | ||
| else | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/GPII/linux/blob/master/gpii/node_modules/alsa/nodealsa/nodealsa_tests.js must be included too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch on the missing test. I searched to make sure I had the rest.