[Pkg-javascript-commits] [node-coveralls] 57/332: pass on all arguments to coveralls (https://coveralls.io/docs/api_reference).

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 13:53:40 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 e3dd6fb7fe9f025a667d859b655e54032aee5fa1
Author: cainus <gregg at caines.ca>
Date:   Sat Jun 22 13:54:07 2013 -0700

    pass on all arguments to coveralls (https://coveralls.io/docs/api_reference).
---
 lib/convertLcovToCoveralls.js | 22 +++++++++++++++-------
 lib/getOptions.js             | 16 ++++++++++++++++
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js
index a93c142..46fc777 100644
--- a/lib/convertLcovToCoveralls.js
+++ b/lib/convertLcovToCoveralls.js
@@ -27,8 +27,7 @@ var convertLcovFileObject = function(file, filepath){
 };
 
 var convertLcovToCoveralls = function(input, options, cb){
-  var repo_token = options.repo_token,
-      filepath = options.filepath || '';
+  var filepath = options.filepath || '';
   logger.debug("in: ", filepath);
   if (filepath[0] !== '/'){
     filepath = path.join(process.cwd(), filepath);
@@ -42,11 +41,20 @@ var convertLcovToCoveralls = function(input, options, cb){
     var postJson = {
       source_files : []
     };
-    if (repo_token) {
-      postJson.repo_token = repo_token;
-    } else {
-      postJson.service_job_id = TRAVIS_JOB_ID;
-      postJson.service_name = 'travis-ci';
+    if (options.git){
+      postJson.git = options.git;
+    }
+    if (options.run_at){
+      postJson.run_at = options.run_at;
+    }
+    if (options.service_name){
+      postJson.service_name = options.service_name;
+    }
+    if (options.service_job_id){
+      postJson.service_name = options.service_job_id;
+    }
+    if (options.repo_token) {
+      postJson.repo_token = options.repo_token;
     }
     parsed.forEach(function(file){
       postJson.source_files.push(convertLcovFileObject(file, filepath));
diff --git a/lib/getOptions.js b/lib/getOptions.js
index 9e6894d..fa294b1 100644
--- a/lib/getOptions.js
+++ b/lib/getOptions.js
@@ -17,6 +17,22 @@ var getOptions = function(){
 		}
 	}
 
+  if (process.env.git){
+    options.git = process.env.COVERALLS_GIT;
+  }
+  if (process.env.service_job_id){
+    options.git = process.env.COVERALLS_SERVICE_JOB_ID;
+  }
+
+  options.run_at = process.env.COVERALLS_RUN_AT || JSON.stringify(new Date()).slice(1, -1);
+  if (process.env.service_name){
+    options.service_name = service_name;
+  }
+  if (process.env.TRAVIS){
+    options.service_name = 'travis-ci';
+    options.service_job_id = process.env.TRAVIS_JOB_ID;
+  }
+
 	// try to get the repo token as an environment variable
   if (process.env.COVERALLS_REPO_TOKEN) {
     options.repo_token = process.env.COVERALLS_REPO_TOKEN;

-- 
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