From 2a85ed8ddb1664f1e11d80660bd44be8207335ce Mon Sep 17 00:00:00 2001 From: Max Jacobson Date: Mon, 13 Feb 2017 13:58:55 -0500 Subject: [PATCH 1/2] Add gitlab CI support Now all of our test reporters can be used on gitlab CI --- ci_info.js | 7 +++++++ test/test.js | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/ci_info.js b/ci_info.js index 34f4e1d..45c7d95 100644 --- a/ci_info.js +++ b/ci_info.js @@ -68,6 +68,13 @@ module.exports = { branch: env.BUILDKITE_BRANCH, commit_sha: env.BUILDKITE_COMMIT }; + } else if (env.GITLAB_CI) { + return { + name: "gitlab-ci", + build_identifier: env.CI_BUILD_ID, + branch: env.CI_BUILD_REF_NAME, + commit_sha: env.CI_BUILD_REF + }; } else { return {}; } diff --git a/test/test.js b/test/test.js index 92b4f27..c16f970 100644 --- a/test/test.js +++ b/test/test.js @@ -79,5 +79,11 @@ describe('ci_info', function() { assert.equal(ci.name, 'buildkite'); }); + it('should return gitlab-ci as name if process.env.GITLAB_CI is set', function() { + process.env.GITLAB_CI = 'true'; + + var ci = CiInfo.getInfo(); + assert.equal(ci.name, 'gitlab-ci'); + }); }); }); From 009f0773c862ad89d174520a2c05dc657b2a33cf Mon Sep 17 00:00:00 2001 From: Max Jacobson Date: Mon, 13 Feb 2017 14:03:32 -0500 Subject: [PATCH 2/2] Allow tests to run on Circle CI as well --- test/test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test.js b/test/test.js index c16f970..b326e82 100644 --- a/test/test.js +++ b/test/test.js @@ -48,6 +48,7 @@ describe('ci_info', function() { beforeEach(function(){ delete process.env['TRAVIS']; + delete process.env['CIRCLECI']; }); afterEach(function(){