Skip to content

Commit 511004e

Browse files
committed
Merge pull request #5 from VisualTesting/smallchange
Smallchange
2 parents fd11313 + d30819f commit 511004e

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22

33
before_install:
4+
- git fetch origin master:master
45
- sudo apt-get update
56
- sudo apt-get install imagemagick graphicsmagick libcairo2-dev
67

libs/gitInfo.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ var exec = require('child_process').exec;
44

55
function execute(cmd, cb) {
66
exec(cmd, function (err, stdout, stderr) {
7+
if(err) {
8+
console.error('err', err);
9+
}
10+
11+
if(stderr) {
12+
console.error('err', err);
13+
}
14+
715
cb(stdout.split('\n').join(''));
816
});
917
}
@@ -39,8 +47,8 @@ var GitInfo = {
3947
},
4048
getCommonAncestor: function(headSha, baseBranch) {
4149
return new Bluebird(function(resolve) {
42-
var command = "bash -c 'diff -u <(git rev-list --all " + headSha + ") "+
43-
"<(git rev-list --first-parent " + baseBranch+")' "+
50+
var command = "bash -c 'diff -u <(git rev-list " + headSha + " --all) "+
51+
"<(git rev-list " + baseBranch + " --first-parent)' "+
4452
"| sed -ne 's/^ //p' | head -1";
4553

4654
execute(command, function(data) {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"webdriverio": "^2.4.3"
2222
},
2323
"scripts": {
24-
"postinstall": "selenium-standalone install",
2524
"start": "node main.js",
2625
"test": "grunt serve"
2726
}

test/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,19 @@ fs.removeAsync(config.screenshotRoot)
4848
.then(function(branchSha) {
4949
branchInfo = branchSha;
5050

51-
console.log('Currently at', branchInfo.sha);
51+
console.log('Currently at', branchInfo.branch, branchInfo.sha);
5252

5353
if (branchInfo.branch !== 'master') {
5454
return gitInfo.getCommonAncestor(branchInfo.sha, 'master')
5555
.then(function(ancestor) {
56+
console.log('diffing against', ancestor);
5657
return startBuild({
5758
head: branchInfo.sha,
5859
base: ancestor,
5960
numBrowsers: 1
61+
})
62+
.then(function(build) {
63+
console.log('Build started', build.build);
6064
});
6165
});
6266
}
@@ -75,6 +79,7 @@ fs.removeAsync(config.screenshotRoot)
7579
console.error(e);
7680
});
7781

82+
7883
return;
7984

8085
function upload(options) {
@@ -95,7 +100,7 @@ function upload(options) {
95100

96101
var r = request.post(args, function(error, response, body) {
97102
if (error || response.statusCode !== 200) {
98-
reject(error || new Error(body));
103+
reject(error || body);
99104
return;
100105
}
101106

@@ -129,7 +134,7 @@ function startBuild(options) {
129134

130135
request(options, function(error, response, body) {
131136
if (error || response.statusCode !== 200) {
132-
reject(error || new Error(body));
137+
reject(error || body);
133138
return;
134139
}
135140

0 commit comments

Comments
 (0)