Skip to content

Commit

Permalink
why is git so hard on saucelabs?
Browse files Browse the repository at this point in the history
  • Loading branch information
drewfish committed Jan 15, 2014
1 parent ffb8601 commit d57e6c8
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions tests/saucelabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,22 @@ function calculateGitDetails(state, done) {
state.git = {};
LIBS.async.series([
function(taskDone) {
if (process.env.TRAVIS_COMMIT) {
state.git.shasum = process.env.TRAVIS_COMMIT;
taskDone();
return;
}
runCommand(['git', 'rev-parse', 'HEAD'], function(err, code, stdout, stderr) {
if (err) {
taskDone(err);
return;
}
state.git.shasum = stdout.trim();
taskDone(err);
if (! state.git.shasum) {
taskDone(new Error("failed to find current commit"));
return;
}
taskDone();
});
},
// DEBUGGING
Expand Down Expand Up @@ -141,6 +154,14 @@ function calculateGitDetails(state, done) {
});
},
function(taskDone) {
if (process.env.TRAVIS_REPO_SLUG) {
var parts = process.env.TRAVIS_REPO_SLUG.split('/');
state.git.user = parts[0];
state.git.repo = parts[1];
state.git.rawURL = 'https://rawgit.luolix.top/' + state.git.user + '/' + state.git.repo + '/' + state.git.shasum + '/tests/test262/pages/';
taskDone();
return;
}
runCommand(['git', 'config', '--get', ['remote', state.git.remote, 'url'].join('.')], function(err, code, stdout, stderr) {
var matches;
if (err) {
Expand Down Expand Up @@ -289,10 +310,9 @@ function main() {
state.capabilities.tags.push(process.env.TRAVIS_NODE_VERSION);
}
state.capabilities.build = process.env.TRAVIS_BUILD_NUMBER || process.pid;
console.log(JSON.stringify(state.capabilities, null, 4));

console.log(JSON.stringify(state, null, 4));
console.log('================================================ START');

LIBS.async.series([
calculateGitDetails.bind(null, state),
runTests.bind(null, state)
Expand Down

0 comments on commit d57e6c8

Please sign in to comment.