Skip to content

Commit 0001833

Browse files
committed
tasks: use common module in container tasks
1 parent 584e644 commit 0001833

File tree

4 files changed

+17
-31
lines changed

4 files changed

+17
-31
lines changed

tasks/baseline.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
var exec = require('child_process').exec;
1+
var common = require('./util/common');
22
var containerCommands = require('./util/container_commands');
33

4-
var cmd = containerCommands([
5-
containerCommands.setup,
4+
var cmd = containerCommands.getRunCmd(
5+
process.env.CIRCLECI,
66
'node test/image/make_baseline.js ' + process.argv.slice(2).join(' ')
7-
]);
7+
);
88

9-
exec(cmd, function(err) {
10-
if(err) throw err;
11-
})
12-
.stdout.pipe(process.stdout);
9+
common.execCmd(cmd);

tasks/test_bundle.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
var path = require('path');
2-
var exec = require('child_process').exec;
3-
42
var glob = require('glob');
53

64
var constants = require('./util/constants');
5+
var common = require('./util/common');
76
var pathToJasmineBundleTests = path.join(constants.pathToJasmineBundleTests);
87

98

@@ -12,10 +11,6 @@ glob(pathToJasmineBundleTests + '/*.js', function(err, files) {
1211
var baseName = path.basename(file);
1312
var cmd = 'npm run citest-jasmine -- bundle_tests/' + baseName;
1413

15-
exec(cmd, function(err, stdout) {
16-
console.log(stdout);
17-
18-
if(err) throw err;
19-
});
14+
common.execCmd(cmd);
2015
});
2116
});

tasks/test_export.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
var exec = require('child_process').exec;
1+
var common = require('./util/common');
22
var containerCommands = require('./util/container_commands');
33

4-
var cmd = containerCommands[process.env.CIRCLECI ? 'runCI' : 'runLocal']([
5-
containerCommands.setup,
4+
var cmd = containerCommands.getRunCmd(
5+
process.env.CIRCLECI,
66
'node test/image/export_test.js ' + process.argv.slice(2).join(' ')
7-
]);
7+
);
88

9-
exec(cmd, function(err) {
10-
if(err) throw err;
11-
})
12-
.stdout.pipe(process.stdout);
9+
common.execCmd(cmd);

tasks/test_image.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
var exec = require('child_process').exec;
1+
var common = require('./util/common');
22
var containerCommands = require('./util/container_commands');
33

4-
var cmd = containerCommands[process.env.CIRCLECI ? 'runCI' : 'runLocal']([
5-
containerCommands.setup,
4+
var cmd = containerCommands.getRunCmd(
5+
process.env.CIRCLECI,
66
'node test/image/compare_pixels_test.js ' + process.argv.slice(2).join(' ')
7-
]);
7+
);
88

9-
exec(cmd, function(err) {
10-
if(err) throw err;
11-
})
12-
.stdout.pipe(process.stdout);
9+
common.execCmd(cmd);

0 commit comments

Comments
 (0)