Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nickmerwin/node-coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmerwin committed Feb 5, 2017
2 parents 671acca + f390392 commit 4bc93ac
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -2,9 +2,9 @@ language: node_js
node_js:
- "node"
- "iojs"
- "6.0"
- "5.0"
- "4.2"
- "6"
- "5"
- "4"
- "0.12"
- "0.10"
script: make test-coveralls
Expand Down
8 changes: 6 additions & 2 deletions lib/getOptions.js
Expand Up @@ -20,18 +20,22 @@ var getBaseOptions = function(cb){
if (process.env.TRAVIS){
options.service_name = 'travis-ci';
options.service_job_id = process.env.TRAVIS_JOB_ID;
options.service_pull_request = process.env.TRAVIS_PULL_REQUEST;
git_commit = 'HEAD';
git_branch = process.env.TRAVIS_BRANCH;
}

/*

if (process.env.DRONE){
options.service_name = 'drone';
options.service_job_id = process.env.DRONE_BUILD_NUMBER;
options.service_pull_request = process.env.DRONE_PULL_REQUEST;
git_committer_name = process.env.DRONE_COMMIT_AUTHOR;
git_committer_email = process.env.DRONE_COMMIT_AUTHOR_EMAIL;
git_commit = process.env.DRONE_COMMIT;
git_branch = process.env.DRONE_BRANCH;
git_message = process.env.DRONE_COMMIT_MESSAGE;
}
*/

if (process.env.JENKINS_URL){
options.service_name = 'jenkins';
Expand Down
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -34,16 +34,16 @@
"lcov-parse": "0.0.10",
"log-driver": "1.2.5",
"minimist": "1.2.0",
"request": "2.75.0"
"request": "2.79.0"
},
"devDependencies": {
"istanbul": "0.4.4",
"istanbul": "0.4.5",
"jshint": "2.9.3",
"mocha": "2.5.3",
"mocha": "3.2.0",
"mocha-lcov-reporter": "1.2.0",
"should": "9.0.2",
"sinon-restore": "1.0.1",
"snyk": "1.17.0"
"snyk": "1.23.3"
},
"engines": {
"node": ">=0.8.6"
Expand Down
10 changes: 5 additions & 5 deletions test/convertLcovToCoveralls.js
Expand Up @@ -8,7 +8,7 @@ logger = require('log-driver')({level : false});

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

it ("should pass on all appropriate parameters from the environment", function(done){
process.env.TRAVIS_JOB_ID = -1;
delete process.env.TRAVIS;
process.env.COVERALLS_GIT_COMMIT = "GIT_HASH";
process.env.COVERALLS_GIT_BRANCH = "master";
process.env.COVERALLS_SERVICE_NAME = "SERVICE_NAME";
Expand All @@ -47,7 +47,7 @@ describe("convertLcovToCoveralls", function(){
});
});
it ("should work with a relative path as well", function(done){
process.env.TRAVIS_JOB_ID = -1;
delete process.env.TRAVIS;
var lcovpath = __dirname + "/../fixtures/onefile.lcov";
var input = fs.readFileSync(lcovpath, "utf8");
var libpath = "fixtures/lib";
Expand All @@ -60,7 +60,7 @@ describe("convertLcovToCoveralls", function(){
});

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

it ("should ignore files that do not exists", function(done){
process.env.TRAVIS_JOB_ID = -1;
delete process.env.TRAVIS;
var lcovpath = __dirname + "/../fixtures/istanbul.lcov";
var input = fs.readFileSync(lcovpath, "utf8");
var libpath = "/Users/deepsweet/Dropbox/projects/svgo/lib";
Expand Down
17 changes: 10 additions & 7 deletions test/getOptions.js
Expand Up @@ -49,11 +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);
});
*/
it ("should set service_name and service_job_id if it's running on wercker", function(done){
testWercker(getBaseOptions, done);
});
Expand Down Expand Up @@ -133,11 +131,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);
});
*/
it ("should set service_name and service_job_id if it's running on wercker", function(done){
testWercker(getOptions, done);
});
Expand Down Expand Up @@ -285,9 +281,11 @@ var testServicePullRequest = function(sut, done){
var testTravisCi = function(sut, done){
process.env.TRAVIS = "TRUE";
process.env.TRAVIS_JOB_ID = "1234";
process.env.TRAVIS_PULL_REQUEST = "123";
sut(function(err, options){
options.service_name.should.equal("travis-ci");
options.service_job_id.should.equal("1234");
options.service_pull_request.should.equal("123");
done();
});
};
Expand Down Expand Up @@ -365,16 +363,21 @@ var testDrone = function(sut, done) {
process.env.DRONE_BUILD_NUMBER = '1234';
process.env.DRONE_COMMIT = "e3e3e3e3e3e3e3e3e";
process.env.DRONE_BRANCH = "master";
process.env.DRONE_PULL_REQUEST = '3';
process.env.DRONE_COMMIT_AUTHOR = 'john doe';
process.env.DRONE_COMMIT_AUTHOR_EMAIL = 'john@doe.com';
process.env.DRONE_COMMIT_MESSAGE = 'msgmsgmsg';

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' },
committer_name: 'john doe',
committer_email: 'john@doe.com',
message: 'msgmsgmsg' },
branch: 'master',
remotes: [] });
done();
Expand Down

0 comments on commit 4bc93ac

Please sign in to comment.