aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcainus <[email protected]>2013-06-22 13:54:07 -0700
committercainus <[email protected]>2013-06-22 13:54:07 -0700
commite3dd6fb7fe9f025a667d859b655e54032aee5fa1 (patch)
tree392bf47b3dffdabae70cf2eb808df23c623e8f81 /lib
parent10c62543ac595ed2205172f76aa6b4018b7f6c24 (diff)
downloadnode-coveralls-e3dd6fb7fe9f025a667d859b655e54032aee5fa1.tar.xz
node-coveralls-e3dd6fb7fe9f025a667d859b655e54032aee5fa1.zip
pass on all arguments to coveralls (https://coveralls.io/docs/api_reference).
Diffstat (limited to 'lib')
-rw-r--r--lib/convertLcovToCoveralls.js22
-rw-r--r--lib/getOptions.js16
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;