aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregg Caines <[email protected]>2014-02-19 02:31:28 -0800
committerGregg Caines <[email protected]>2014-02-19 02:31:28 -0800
commit26581f2eeec2635c713ae6a438cce81bff458e4b (patch)
treeef44167f879bdcbff27eed26fd7a39c115942026
parent43e903cde9f9fdf5a2972927f9a1b7426676adea (diff)
parent038408b78cff7d9a974e652f426ff786ed730bbb (diff)
downloadnode-coveralls-26581f2eeec2635c713ae6a438cce81bff458e4b.tar.xz
node-coveralls-26581f2eeec2635c713ae6a438cce81bff458e4b.zip
Merge branch 'master' of github.com:cainus/node-coveralls
-rw-r--r--README.md2
-rw-r--r--lib/getOptions.js7
-rw-r--r--test/getOptions.js27
3 files changed, 35 insertions, 1 deletions
diff --git a/README.md b/README.md
index 3a454c8..290694f 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Status](https://drone.io/github.com/cainus/node-coveralls/status.png)](https://d
[Coveralls.io](https://coveralls.io/) support for node.js. Get the great coverage reporting of coveralls.io and add a cool coverage button ( like the one above ) to your README.
-Supported CI services: [travis-ci](https://travis-ci.org/), [codeship](https://www.codeship.io/), [circle-ci](https://circleci.com/), [jenkins](http://jenkins-ci.org/)
+Supported CI services: [travis-ci](https://travis-ci.org/), [codeship](https://www.codeship.io/), [circle-ci](https://circleci.com/), [jenkins](http://jenkins-ci.org/), [drone](https://drone.io/)
##Installation:
Add the latest version of `coveralls` to your package.json:
diff --git a/lib/getOptions.js b/lib/getOptions.js
index 3641ffc..68016aa 100644
--- a/lib/getOptions.js
+++ b/lib/getOptions.js
@@ -14,6 +14,13 @@ var getBaseOptions = function(cb){
options.service_job_id = process.env.TRAVIS_JOB_ID;
}
+ if (process.env.DRONE){
+ options.service_name = 'drone';
+ options.service_job_id = process.env.DRONE_BUILD_NUMBER;
+ git_commit = process.env.DRONE_COMMIT;
+ git_branch = process.env.DRONE_BRANCH;
+ }
+
if (process.env.JENKINS_URL){
options.service_name = 'jenkins';
options.service_job_id = process.env.BUILD_ID;
diff --git a/test/getOptions.js b/test/getOptions.js
index 76691a3..a0aef46 100644
--- a/test/getOptions.js
+++ b/test/getOptions.js
@@ -49,6 +49,9 @@ describe("getBaseOptions", function(){
it ("should set service_name and service_job_id if it's running on codeship", function(done){
testCodeship(getBaseOptions, done);
});
+ it ("should set service_name and service_job_id if it's running on drone", function(done){
+ testDrone(getBaseOptions, done);
+ });
});
describe("getOptions", function(){
@@ -119,6 +122,9 @@ describe("getOptions", function(){
it ("should set service_name and service_job_id if it's running on codeship", function(done){
testCodeship(getOptions, done);
});
+ it ("should set service_name and service_job_id if it's running on drone", function(done){
+ testDrone(getBaseOptions, done);
+ });
});
var testServiceJobId = function(sut, done){
@@ -303,6 +309,27 @@ var testCodeship = function(sut, done) {
});
};
+var testDrone = function(sut, done) {
+ process.env.DRONE = true;
+ process.env.DRONE_BUILD_NUMBER = '1234';
+ process.env.DRONE_COMMIT = "e3e3e3e3e3e3e3e3e";
+ process.env.DRONE_BRANCH = "master";
+ sut(function(err, options){
+ options.service_name.should.equal("drone");
+ options.service_job_id.should.equal("1234");
+ options.git.should.eql({ head:
+ { id: 'e3e3e3e3e3e3e3e3e',
+ author_name: 'Unknown Author',
+ author_email: '',
+ committer_name: 'Unknown Committer',
+ committer_email: '',
+ message: 'Unknown Commit Message' },
+ branch: 'master',
+ remotes: [] });
+ done();
+ });
+};
+
function ensureLocalGitContext(options) {
var path = require('path');
var fs = require('fs');