[Pkg-javascript-commits] [node-coveralls] 279/332: Get PR number from TRAVIS

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 13:54:11 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-coveralls.

commit f94b6479d7357fe4602d30fb7cf08939300bac6d
Author: d056950 <jan.matthias.pilzer at sap.com>
Date:   Fri Oct 14 13:56:45 2016 +0200

    Get PR number from TRAVIS
---
 lib/getOptions.js              |  1 +
 test/convertLcovToCoveralls.js | 10 +++++-----
 test/getOptions.js             |  2 ++
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/lib/getOptions.js b/lib/getOptions.js
index bb4248d..04750f3 100644
--- a/lib/getOptions.js
+++ b/lib/getOptions.js
@@ -20,6 +20,7 @@ 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;
   }
diff --git a/test/convertLcovToCoveralls.js b/test/convertLcovToCoveralls.js
index b927f05..e1e49b5 100644
--- a/test/convertLcovToCoveralls.js
+++ b/test/convertLcovToCoveralls.js
@@ -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";
@@ -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";
@@ -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";
@@ -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";
@@ -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";
diff --git a/test/getOptions.js b/test/getOptions.js
index bd38b7c..7915a29 100644
--- a/test/getOptions.js
+++ b/test/getOptions.js
@@ -285,9 +285,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();
   });
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-coveralls.git



More information about the Pkg-javascript-commits mailing list