Skip to content

Commit 4bc93ac

Browse files
committed
Merge branch 'master' of github.com:nickmerwin/node-coveralls
2 parents 671acca + f390392 commit 4bc93ac

File tree

5 files changed

+28
-21
lines changed

5 files changed

+28
-21
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ language: node_js
22
node_js:
33
- "node"
44
- "iojs"
5-
- "6.0"
6-
- "5.0"
7-
- "4.2"
5+
- "6"
6+
- "5"
7+
- "4"
88
- "0.12"
99
- "0.10"
1010
script: make test-coveralls

lib/getOptions.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,22 @@ var getBaseOptions = function(cb){
2020
if (process.env.TRAVIS){
2121
options.service_name = 'travis-ci';
2222
options.service_job_id = process.env.TRAVIS_JOB_ID;
23+
options.service_pull_request = process.env.TRAVIS_PULL_REQUEST;
2324
git_commit = 'HEAD';
2425
git_branch = process.env.TRAVIS_BRANCH;
2526
}
2627

27-
/*
28+
2829
if (process.env.DRONE){
2930
options.service_name = 'drone';
3031
options.service_job_id = process.env.DRONE_BUILD_NUMBER;
32+
options.service_pull_request = process.env.DRONE_PULL_REQUEST;
33+
git_committer_name = process.env.DRONE_COMMIT_AUTHOR;
34+
git_committer_email = process.env.DRONE_COMMIT_AUTHOR_EMAIL;
3135
git_commit = process.env.DRONE_COMMIT;
3236
git_branch = process.env.DRONE_BRANCH;
37+
git_message = process.env.DRONE_COMMIT_MESSAGE;
3338
}
34-
*/
3539

3640
if (process.env.JENKINS_URL){
3741
options.service_name = 'jenkins';

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@
3434
"lcov-parse": "0.0.10",
3535
"log-driver": "1.2.5",
3636
"minimist": "1.2.0",
37-
"request": "2.75.0"
37+
"request": "2.79.0"
3838
},
3939
"devDependencies": {
40-
"istanbul": "0.4.4",
40+
"istanbul": "0.4.5",
4141
"jshint": "2.9.3",
42-
"mocha": "2.5.3",
42+
"mocha": "3.2.0",
4343
"mocha-lcov-reporter": "1.2.0",
4444
"should": "9.0.2",
4545
"sinon-restore": "1.0.1",
46-
"snyk": "1.17.0"
46+
"snyk": "1.23.3"
4747
},
4848
"engines": {
4949
"node": ">=0.8.6"

test/convertLcovToCoveralls.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ logger = require('log-driver')({level : false});
88

99
describe("convertLcovToCoveralls", function(){
1010
it ("should convert a simple lcov file", function(done){
11-
process.env.TRAVIS_JOB_ID = -1;
11+
delete process.env.TRAVIS;
1212
var lcovpath = __dirname + "/../fixtures/onefile.lcov";
1313
var input = fs.readFileSync(lcovpath, "utf8");
1414
var libpath = __dirname + "/../fixtures/lib";
@@ -23,7 +23,7 @@ describe("convertLcovToCoveralls", function(){
2323
});
2424

2525
it ("should pass on all appropriate parameters from the environment", function(done){
26-
process.env.TRAVIS_JOB_ID = -1;
26+
delete process.env.TRAVIS;
2727
process.env.COVERALLS_GIT_COMMIT = "GIT_HASH";
2828
process.env.COVERALLS_GIT_BRANCH = "master";
2929
process.env.COVERALLS_SERVICE_NAME = "SERVICE_NAME";
@@ -47,7 +47,7 @@ describe("convertLcovToCoveralls", function(){
4747
});
4848
});
4949
it ("should work with a relative path as well", function(done){
50-
process.env.TRAVIS_JOB_ID = -1;
50+
delete process.env.TRAVIS;
5151
var lcovpath = __dirname + "/../fixtures/onefile.lcov";
5252
var input = fs.readFileSync(lcovpath, "utf8");
5353
var libpath = "fixtures/lib";
@@ -60,7 +60,7 @@ describe("convertLcovToCoveralls", function(){
6060
});
6161

6262
it ("should convert absolute input paths to relative", function(done){
63-
process.env.TRAVIS_JOB_ID = -1;
63+
delete process.env.TRAVIS;
6464
var lcovpath = __dirname + "/../fixtures/istanbul.lcov";
6565
var input = fs.readFileSync(lcovpath, "utf8");
6666
var libpath = "/Users/deepsweet/Dropbox/projects/svgo/lib";
@@ -89,7 +89,7 @@ describe("convertLcovToCoveralls", function(){
8989
});
9090

9191
it ("should ignore files that do not exists", function(done){
92-
process.env.TRAVIS_JOB_ID = -1;
92+
delete process.env.TRAVIS;
9393
var lcovpath = __dirname + "/../fixtures/istanbul.lcov";
9494
var input = fs.readFileSync(lcovpath, "utf8");
9595
var libpath = "/Users/deepsweet/Dropbox/projects/svgo/lib";

test/getOptions.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ describe("getBaseOptions", function(){
4949
it ("should set service_name and service_job_id if it's running on codeship", function(done){
5050
testCodeship(getBaseOptions, done);
5151
});
52-
/*
5352
it ("should set service_name and service_job_id if it's running on drone", function(done){
5453
testDrone(getBaseOptions, done);
5554
});
56-
*/
5755
it ("should set service_name and service_job_id if it's running on wercker", function(done){
5856
testWercker(getBaseOptions, done);
5957
});
@@ -133,11 +131,9 @@ describe("getOptions", function(){
133131
it ("should set service_name and service_job_id if it's running on codeship", function(done){
134132
testCodeship(getOptions, done);
135133
});
136-
/*
137134
it ("should set service_name and service_job_id if it's running on drone", function(done){
138135
testDrone(getBaseOptions, done);
139136
});
140-
*/
141137
it ("should set service_name and service_job_id if it's running on wercker", function(done){
142138
testWercker(getOptions, done);
143139
});
@@ -285,9 +281,11 @@ var testServicePullRequest = function(sut, done){
285281
var testTravisCi = function(sut, done){
286282
process.env.TRAVIS = "TRUE";
287283
process.env.TRAVIS_JOB_ID = "1234";
284+
process.env.TRAVIS_PULL_REQUEST = "123";
288285
sut(function(err, options){
289286
options.service_name.should.equal("travis-ci");
290287
options.service_job_id.should.equal("1234");
288+
options.service_pull_request.should.equal("123");
291289
done();
292290
});
293291
};
@@ -365,16 +363,21 @@ var testDrone = function(sut, done) {
365363
process.env.DRONE_BUILD_NUMBER = '1234';
366364
process.env.DRONE_COMMIT = "e3e3e3e3e3e3e3e3e";
367365
process.env.DRONE_BRANCH = "master";
366+
process.env.DRONE_PULL_REQUEST = '3';
367+
process.env.DRONE_COMMIT_AUTHOR = 'john doe';
368+
process.env.DRONE_COMMIT_AUTHOR_EMAIL = '[email protected]';
369+
process.env.DRONE_COMMIT_MESSAGE = 'msgmsgmsg';
370+
368371
sut(function(err, options){
369372
options.service_name.should.equal("drone");
370373
options.service_job_id.should.equal("1234");
371374
options.git.should.eql({ head:
372375
{ id: 'e3e3e3e3e3e3e3e3e',
373376
author_name: 'Unknown Author',
374377
author_email: '',
375-
committer_name: 'Unknown Committer',
376-
committer_email: '',
377-
message: 'Unknown Commit Message' },
378+
committer_name: 'john doe',
379+
committer_email: '[email protected]',
380+
message: 'msgmsgmsg' },
378381
branch: 'master',
379382
remotes: [] });
380383
done();

0 commit comments

Comments
 (0)