Skip to content

Commit

Permalink
better catch istanbul process
Browse files Browse the repository at this point in the history
  • Loading branch information
darky committed Jul 30, 2015
1 parent 247636e commit b0e9e1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .crossbar/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{
"type": "guest",
"executable": "./node_modules/.bin/istanbul",
"arguments": ["cover", "--handle-sigint", "--dir", "coverage-node", "--6o56y45f36wmf7f", "test/node.js"],
"arguments": ["cover", "--handle-sigint", "--dir", "coverage-node", "test/node.js"],
"options": {
"workdir": "../",
"watch": {
Expand Down
9 changes: 3 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ var _ = require("underscore"),
combineCoverage = require("istanbul-combine"),
eslint = require("gulp-eslint"),
exec = require("child_process").exec,
KarmaServer = require("karma").Server,
ps = require("ps-node");
KarmaServer = require("karma").Server;


/* ******************
Expand Down Expand Up @@ -89,10 +88,8 @@ gulp.task("test-own", function (cb) {
reporters: ["progress", "coverage"],
singleRun: true
}, function () {
ps.lookup({
arguments: "--6o56y45f36wmf7f"
}, function (err, processes) {
process.kill(parseInt(processes[0].pid, 10), "SIGINT");
exec("ps -e | grep istanbul | sed \\$d | awk '{print $1}'", function (err, pid) {
process.kill(parseInt(pid.trim(), 10), "SIGINT");
crossbarProcess.kill();
cb(err);
});
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"karma-coverage" : "0.4.2",
"karma-firefox-launcher" : "0.1.6",
"karma-mocha" : "0.2.0",
"karma-qunit" : "0.1.4",
"ps-node" : "0.0.4"
"karma-qunit" : "0.1.4"
},
"scripts": {
"test": "./node_modules/.bin/gulp"
Expand Down

0 comments on commit b0e9e1a

Please sign in to comment.