Skip to content

Commit

Permalink
Merge pull request #112 from hedgehoglab/master
Browse files Browse the repository at this point in the history
Add Buildkite support
  • Loading branch information
coagulant committed Jun 15, 2016
2 parents a754127 + 90e7657 commit a58d6f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions coveralls/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def __init__(self, token_required=True, **kwargs):
self.config['service_job_id'] = os.environ.get('CIRCLE_BUILD_NUM')
if os.environ.get('CI_PULL_REQUEST', None):
self.config['service_pull_request'] = os.environ.get('CI_PULL_REQUEST').split('/')[-1]
elif os.environ.get('BUILDKITE'):
is_travis_or_circle = False
self.config['service_name'] = file_config.get('service_name', None) or 'buildkite'
self.config['service_job_id'] = os.environ.get('BUILDKITE_JOB_ID')
elif os.environ.get('APPVEYOR'):
is_travis_or_circle = False
self.config['service_name'] = file_config.get('service_name', None) or 'appveyor'
Expand Down Expand Up @@ -215,6 +219,7 @@ def git_info(self):
},
'branch': (os.environ.get('CIRCLE_BRANCH') or
os.environ.get('APPVEYOR_REPO_BRANCH') or
os.environ.get('BUILDKITE_BRANCH') or
os.environ.get('CI_BRANCH') or
os.environ.get('TRAVIS_BRANCH', rev)),
# origin git@github.com:coagulant/coveralls-python.git (fetch)
Expand Down
7 changes: 7 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ def test_appveyor_no_config(self):
assert cover.config['service_job_id'] == '1234567'
assert cover.config['service_pull_request'] == '1234'

@patch.dict(os.environ, {'BUILDKITE': 'True',
'BUILDKITE_JOB_ID': '1234567'}, clear=True)
def test_buildkite_no_config(self):
cover = Coveralls(repo_token='xxx')
assert cover.config['service_name'] == 'buildkite'
assert cover.config['service_job_id'] == '1234567'


class Git(GitBasedTest):

Expand Down

0 comments on commit a58d6f9

Please sign in to comment.