[Pkg-javascript-commits] [node-coveralls] 249/332: COVERALLS_PARALLEL env support
Bastien Roucariès
rouca at moszumanska.debian.org
Thu Nov 9 13:54:07 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 94ccb0e434c0fd029714793f11da336832489d9d
Author: Nick Merwin <n at mer.io>
Date: Fri Feb 26 11:21:07 2016 -0800
COVERALLS_PARALLEL env support
---
README.md | 3 ++-
lib/convertLcovToCoveralls.js | 3 +++
lib/getOptions.js | 4 ++++
test/convertLcovToCoveralls.js | 4 +++-
test/getOptions.js | 11 +++++++++++
5 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 842c532..f47805b 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
[Coveralls.io](https://coveralls.io/) support for node.js. Get the great coverage reporting of coveralls.io and add a cool coverage button ( like the one above ) to your README.
-Supported CI services: [travis-ci](https://travis-ci.org/), [codeship](https://www.codeship.io/), [circleci](https://circleci.com/), [jenkins](http://jenkins-ci.org/)
+Supported CI services: [travis-ci](https://travis-ci.org/), [codeship](https://www.codeship.io/), [circleci](https://circleci.com/), [jenkins](http://jenkins-ci.org/), [Gitlab CI](http://gitlab.com/)
##Installation:
Add the latest version of `coveralls` to your package.json:
@@ -31,6 +31,7 @@ There are optional environment variables for other build systems as well:
* COVERALLS_SERVICE_JOB_ID (an id that uniquely identifies the build job)
* COVERALLS_RUN_AT (a date string for the time that the job ran. RFC 3339 dates work. This defaults to your
build system's date/time if you don't set it.)
+* COVERALLS_PARALLEL (more info here: https://coveralls.zendesk.com/hc/en-us/articles/203484329)
### [Mocha](http://mochajs.org/) + [Blanket.js](https://github.com/alex-seville/blanket)
- Install [blanket.js](http://blanketjs.org/)
diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js
index a86dc4e..ca2c2c0 100644
--- a/lib/convertLcovToCoveralls.js
+++ b/lib/convertLcovToCoveralls.js
@@ -54,6 +54,9 @@ var convertLcovToCoveralls = function(input, options, cb){
if (options.repo_token) {
postJson.repo_token = options.repo_token;
}
+ if (options.parallel) {
+ postJson.parallel = options.parallel;
+ }
if (options.service_pull_request) {
postJson.service_pull_request = options.service_pull_request;
}
diff --git a/lib/getOptions.js b/lib/getOptions.js
index 682920b..e0cb1f0 100644
--- a/lib/getOptions.js
+++ b/lib/getOptions.js
@@ -90,6 +90,10 @@ var getBaseOptions = function(cb){
}
}
+ if (process.env.COVERALLS_PARALLEL) {
+ options.parallel = true;
+ }
+
// try to get the repo token as an environment variable
if (process.env.COVERALLS_REPO_TOKEN) {
options.repo_token = process.env.COVERALLS_REPO_TOKEN;
diff --git a/test/convertLcovToCoveralls.js b/test/convertLcovToCoveralls.js
index 24fa6c8..82ffdc8 100644
--- a/test/convertLcovToCoveralls.js
+++ b/test/convertLcovToCoveralls.js
@@ -30,7 +30,8 @@ describe("convertLcovToCoveralls", function(){
process.env.COVERALLS_SERVICE_JOB_ID = "SERVICE_JOB_ID";
process.env.COVERALLS_REPO_TOKEN = "REPO_TOKEN";
process.env.CI_PULL_REQUEST = "https://github.com/fake/fake/pulls/123";
-
+ process.env.COVERALLS_PARALLEL = "true";
+
getOptions(function(err, options){
var lcovpath = __dirname + "/../fixtures/onefile.lcov";
var input = fs.readFileSync(lcovpath, "utf8");
@@ -39,6 +40,7 @@ describe("convertLcovToCoveralls", function(){
convertLcovToCoveralls(input, options, function(err, output){
should.not.exist(err);
output.service_pull_request.should.equal("123");
+ output.parallel.should.equal(true);
//output.git.should.equal("GIT_HASH");
done();
});
diff --git a/test/getOptions.js b/test/getOptions.js
index 4bbe7d6..3394a85 100644
--- a/test/getOptions.js
+++ b/test/getOptions.js
@@ -112,6 +112,9 @@ describe("getOptions", function(){
it ("should detect repo_token if not passed in", function(done){
testRepoTokenDetection(getOptions, done);
});
+ it ("should set paralell if env var set", function(done){
+ testParallel(getOptions, done);
+ });
it ("should set service_name if it exists", function(done){
testServiceName(getOptions, done);
});
@@ -223,6 +226,14 @@ var testRepoToken = function(sut, done){
});
};
+var testParallel = function(sut, done){
+ process.env.COVERALLS_PARALLEL = "true";
+ sut(function(err, options){
+ options.parallel.should.equal(true);
+ done();
+ });
+};
+
var testRepoTokenDetection = function(sut, done) {
var fs = require('fs');
var path = require('path');
--
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