commit python-coveralls-check for openSUSE:Factory
Hello community, here is the log from the commit of package python-coveralls-check for openSUSE:Factory checked in at 2019-05-22 15:41:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-coveralls-check (Old) and /work/SRC/openSUSE:Factory/.python-coveralls-check.new.5148 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-coveralls-check" Wed May 22 15:41:34 2019 rev:5 rq:704733 version:1.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-coveralls-check/python-coveralls-check.changes 2019-03-04 09:23:59.680561903 +0100 +++ /work/SRC/openSUSE:Factory/.python-coveralls-check.new.5148/python-coveralls-check.changes 2019-05-22 15:42:14.386427002 +0200 @@ -1,0 +2,7 @@ +Wed May 22 10:40:58 UTC 2019 - pgajdos@suse.com + +- version update to 1.2.1 + * Fix packaging and copyright. + * Add support for Coveralls parallel build stuff. + +------------------------------------------------------------------- Old: ---- coveralls-check-1.1.0.tar.gz New: ---- coveralls-check-1.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-coveralls-check.spec ++++++ --- /var/tmp/diff_new_pack.aloY2A/_old 2019-05-22 15:42:24.418426957 +0200 +++ /var/tmp/diff_new_pack.aloY2A/_new 2019-05-22 15:42:24.418426957 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-coveralls-check -Version: 1.1.0 +Version: 1.2.1 Release: 0 Summary: Coverage checking using https://coveralls.io/ License: MIT @@ -38,6 +38,7 @@ BuildRequires: fdupes Requires: python-backoff Requires: python-requests +Requires: python-setuptools BuildArch: noarch %python_subpackages ++++++ coveralls-check-1.1.0.tar.gz -> coveralls-check-1.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coveralls-check-1.1.0/.travis.yml new/coveralls-check-1.2.1/.travis.yml --- old/coveralls-check-1.1.0/.travis.yml 2017-09-14 09:45:40.000000000 +0200 +++ new/coveralls-check-1.2.1/.travis.yml 2018-07-11 09:48:59.000000000 +0200 @@ -3,6 +3,9 @@ # for container-y goodness: sudo: false +env: + secure: "r9ZM4KOnCohwd5xiXOCC4iTNWCrVJpEyN1wMPpaJTVentTnUs1pABw7CUgic0kYWbjC5BWh3kQBsXb1uQrxkwNWfBqmCuhBxSlxdd5mwVjF+jwnwq4R16pJ59l2NPThKirGw5xodLK/Sd5jw9eejToXx6Ak6ZHMzFan3A7DqmzXttx5mqmjmNujFIYRT19B7u6T06/cOWAOypajKJp2npHx5c2AXrd5+HdD4qfYwUBI1Rtj1GEKcQvDivOSOps3lXgr0Pwm6dH1VDegpvzlzcZ4KSVo6rvM7eImDuzgwloZlOuolqN7MCpKdTildnsYnTfErltb1oJlYkkkG0zMUMjA73owSTmXXpRoXfJpXuoxW8xwjG3K94uLRCB/ujFt/myHfUwJBw/OvnFOI2TAaS+B6MXgISjBNS6NXyJU+iM7K3zjOtzPO08yYy1he8gtX7sQ4k8wB0hPRImbbD9pPww7Oh6+vGyyTcGauy5R55fP2ZP0pj6VHAVqavQfRcUKxrcQ8fQBqV201wKgZJQgHe41+5K2NQlHV2toh32D3mzoT+GdRovSFnhJk/V3jXdblN7h2oEjVa7EGogwlbXtNoS3gikar9IVrw88wXuHwjujG7uB2yzBYiXG6tE2UJoliRXx0q0yImSnX2cWUXxIbuDvlj0U4FYYFNnY1BYU6N3Y=" + python: - "2.7" - "3.6" @@ -14,7 +17,7 @@ script: coverage run --source coveralls_check,tests -m py.test tests.py after_success: - - coveralls + - "COVERALLS_PARALLEL=true coveralls" jobs: include: @@ -25,9 +28,10 @@ # woof woof! install: "pip install -Ue ." - script: "coveralls-check $TRAVIS_COMMIT" + script: "coveralls-check $TRAVIS_COMMIT --parallel-build-number $TRAVIS_BUILD_NUMBER --repo-token $COVERALLS_REPO_TOKEN" - stage: release + if: tag IS present python: 3.6 script: skip # work around https://github.com/travis-ci/travis-ci/issues/8337: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coveralls-check-1.1.0/LICENSE.rst new/coveralls-check-1.2.1/LICENSE.rst --- old/coveralls-check-1.1.0/LICENSE.rst 2017-09-14 09:45:40.000000000 +0200 +++ new/coveralls-check-1.2.1/LICENSE.rst 2018-07-11 09:48:59.000000000 +0200 @@ -2,7 +2,7 @@ License ======= -Copyright (c) 2017 Chris Withers +Copyright (c) 2017-2018 Chris Withers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coveralls-check-1.1.0/PKG-INFO new/coveralls-check-1.2.1/PKG-INFO --- old/coveralls-check-1.1.0/PKG-INFO 2017-09-14 09:46:05.000000000 +0200 +++ new/coveralls-check-1.2.1/PKG-INFO 2018-07-11 09:49:21.000000000 +0200 @@ -1,12 +1,11 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: coveralls-check -Version: 1.1.0 +Version: 1.2.1 Summary: Check coverage at https://coveralls.io Home-page: https://github.com/cjw296/coverage-check Author: Chris Withers Author-email: chris@withers.org License: MIT -Description-Content-Type: UNKNOWN Description: |Travis|_ |Coveralls|_ .. |Travis| image:: https://api.travis-ci.org/cjw296/coveralls-check.svg?branch=master @@ -37,6 +36,9 @@ sudo: false + env: + secure: "..." + python: - "2.7" - "3.6" @@ -48,7 +50,7 @@ script: coverage run --source ... -m py.test after_success: - - coveralls + - "COVERALLS_PARALLEL=true coveralls" jobs: include: @@ -58,11 +60,25 @@ after_success: skip install: "pip install -U coveralls-check" - script: "coveralls-check $TRAVIS_COMMIT" + script: "coveralls-check $TRAVIS_COMMIT --parallel-build-number $TRAVIS_BUILD_NUMBER --repo-token $COVERALLS_REPO_TOKEN" + + The ``COVERALLS_REPO_TOKEN`` is set in the ``secure`` section, which can be obtained using:: + + travis encrypt COVERALLS_REPO_TOKEN=(your coveralls repo token) Changes ------- + 1.2.1 (11 Jul 2018) + ------------------- + + - Fix packaging and copyright. + + 1.2.0 (11 Jul 2018) + ------------------- + + - Add support for Coveralls parallel build stuff. + 1.1.0 (14 Sep 2017) ~~~~~~~~~~~~~~~~~~~ @@ -87,3 +103,5 @@ Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.6 +Provides-Extra: test +Provides-Extra: build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coveralls-check-1.1.0/README.rst new/coveralls-check-1.2.1/README.rst --- old/coveralls-check-1.1.0/README.rst 2017-09-14 09:45:40.000000000 +0200 +++ new/coveralls-check-1.2.1/README.rst 2018-07-11 09:48:59.000000000 +0200 @@ -28,6 +28,9 @@ sudo: false + env: + secure: "..." + python: - "2.7" - "3.6" @@ -39,7 +42,7 @@ script: coverage run --source ... -m py.test after_success: - - coveralls + - "COVERALLS_PARALLEL=true coveralls" jobs: include: @@ -49,11 +52,25 @@ after_success: skip install: "pip install -U coveralls-check" - script: "coveralls-check $TRAVIS_COMMIT" + script: "coveralls-check $TRAVIS_COMMIT --parallel-build-number $TRAVIS_BUILD_NUMBER --repo-token $COVERALLS_REPO_TOKEN" + +The ``COVERALLS_REPO_TOKEN`` is set in the ``secure`` section, which can be obtained using:: + + travis encrypt COVERALLS_REPO_TOKEN=(your coveralls repo token) Changes ------- +1.2.1 (11 Jul 2018) +------------------- + +- Fix packaging and copyright. + +1.2.0 (11 Jul 2018) +------------------- + +- Add support for Coveralls parallel build stuff. + 1.1.0 (14 Sep 2017) ~~~~~~~~~~~~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coveralls-check-1.1.0/coveralls_check.egg-info/PKG-INFO new/coveralls-check-1.2.1/coveralls_check.egg-info/PKG-INFO --- old/coveralls-check-1.1.0/coveralls_check.egg-info/PKG-INFO 2017-09-14 09:46:05.000000000 +0200 +++ new/coveralls-check-1.2.1/coveralls_check.egg-info/PKG-INFO 2018-07-11 09:49:21.000000000 +0200 @@ -1,12 +1,11 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: coveralls-check -Version: 1.1.0 +Version: 1.2.1 Summary: Check coverage at https://coveralls.io Home-page: https://github.com/cjw296/coverage-check Author: Chris Withers Author-email: chris@withers.org License: MIT -Description-Content-Type: UNKNOWN Description: |Travis|_ |Coveralls|_ .. |Travis| image:: https://api.travis-ci.org/cjw296/coveralls-check.svg?branch=master @@ -37,6 +36,9 @@ sudo: false + env: + secure: "..." + python: - "2.7" - "3.6" @@ -48,7 +50,7 @@ script: coverage run --source ... -m py.test after_success: - - coveralls + - "COVERALLS_PARALLEL=true coveralls" jobs: include: @@ -58,11 +60,25 @@ after_success: skip install: "pip install -U coveralls-check" - script: "coveralls-check $TRAVIS_COMMIT" + script: "coveralls-check $TRAVIS_COMMIT --parallel-build-number $TRAVIS_BUILD_NUMBER --repo-token $COVERALLS_REPO_TOKEN" + + The ``COVERALLS_REPO_TOKEN`` is set in the ``secure`` section, which can be obtained using:: + + travis encrypt COVERALLS_REPO_TOKEN=(your coveralls repo token) Changes ------- + 1.2.1 (11 Jul 2018) + ------------------- + + - Fix packaging and copyright. + + 1.2.0 (11 Jul 2018) + ------------------- + + - Add support for Coveralls parallel build stuff. + 1.1.0 (14 Sep 2017) ~~~~~~~~~~~~~~~~~~~ @@ -87,3 +103,5 @@ Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.6 +Provides-Extra: test +Provides-Extra: build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coveralls-check-1.1.0/coveralls_check.py new/coveralls-check-1.2.1/coveralls_check.py --- old/coveralls-check-1.1.0/coveralls_check.py 2017-09-14 09:45:40.000000000 +0200 +++ new/coveralls-check-1.2.1/coveralls_check.py 2018-07-11 09:48:59.000000000 +0200 @@ -7,7 +7,8 @@ import requests import sys -url = 'https://coveralls.io/builds/{}.json' +POLL_URL = 'https://coveralls.io/builds/{}.json' +DONE_URL = 'https://coveralls.io/webhook' def setup_logging(): @@ -23,7 +24,7 @@ def get_coverage(commit): - response = requests.get(url.format(commit)) + response = requests.get(POLL_URL.format(commit)) data = response.json() return data['covered_percent'] @@ -37,6 +38,29 @@ )(func) +def ensure_parallel_done(args): + if args.parallel_build_number: + response = requests.post( + DONE_URL, + params={'repo_token': args.repo_token}, + json={ + "payload": { + "build_num": args.parallel_build_number, + "status": "done" + } + } + ) + if response.status_code == 200: + print('Confirmed end of parallel build') + else: + print( + 'Attempt to confirmed end of parallel build got {}:\n{}'.format( + response.status_code, response.content + ) + ) + sys.exit(1) + + def parse_args(): parser = ArgumentParser() parser.add_argument('commit', help='the commit hash to check') @@ -46,12 +70,22 @@ parser.add_argument('--max-wait', type=int, default=5, help='Maximum time, in minutes, to wait for Coveralls ' 'data. Defaults to 5.') + parser.add_argument('--parallel-build-number', type=int, + help='The build number, eg $TRAVIS_BUILD_NUMBER.') + parser.add_argument('--repo-token', + help='Required if --parallel-build-number is used and ' + 'should be the token use when POSTing back to ' + 'coveralls to mark the parallel build as done. ' + 'Should come from a secret.') return parser.parse_args() def main(): args = parse_args() setup_logging() + + ensure_parallel_done(args) + get_coverage_ = decorate(get_coverage, args) covered = get_coverage_(args.commit) if covered is None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coveralls-check-1.1.0/setup.py new/coveralls-check-1.2.1/setup.py --- old/coveralls-check-1.1.0/setup.py 2017-09-14 09:45:40.000000000 +0200 +++ new/coveralls-check-1.2.1/setup.py 2018-07-11 09:48:59.000000000 +0200 @@ -1,5 +1,5 @@ # See LICENSE.rst for license details. -# Copyright (c) 2017 Chris Withers +# Copyright (c) 2017-2018 Chris Withers import os @@ -7,7 +7,7 @@ setup( name='coveralls-check', - version='1.1.0', + version='1.2.1', author='Chris Withers', author_email='chris@withers.org', license='MIT', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coveralls-check-1.1.0/tests.py new/coveralls-check-1.2.1/tests.py --- old/coveralls-check-1.1.0/tests.py 2017-09-14 09:45:40.000000000 +0200 +++ new/coveralls-check-1.2.1/tests.py 2018-07-11 09:48:59.000000000 +0200 @@ -1,8 +1,17 @@ +import json +import sys + import pytest -from coveralls_check import main from mock import Mock from responses import RequestsMock -from testfixtures import replace, ShouldRaise, OutputCapture, Replacer, compare +from testfixtures import ShouldRaise, OutputCapture, Replacer, compare + +from coveralls_check import main + +if sys.version_info[0] == 2: + PY2 = True +else: + PY2 = False SAMPLE_JSON = { "commit_sha": "xyz", @@ -10,7 +19,6 @@ "covered_percent": 99.38 } - @pytest.fixture(autouse=True) def responses(): with RequestsMock() as responses: @@ -59,3 +67,41 @@ 'No coverage information available for xyz\n' ) output.compare(expected) + + +def test_parallel_build(responses, mocks): + responses.add(responses.POST, 'https://coveralls.io/webhook', + json={"mock": 'ok'}) + responses.add(responses.GET, 'https://coveralls.io/builds/xyz.json', + json={"covered_percent": 100}) + mocks.argv.extend(['--parallel-build-number', '99', '--repo-token', 'thetoken']) + with OutputCapture() as output: + main() + output.compare('Confirmed end of parallel build\n' + 'Coverage OK for xyz as 100 >= 100') + post = responses.calls[0].request + compare(post.url, + expected='https://coveralls.io/webhook?repo_token=thetoken') + compare(json.loads(post.body), + expected={"payload": {"build_num": 99, "status": "done"}}) + + +def test_parallel_build_bad_response(responses, mocks): + responses.add(responses.POST, 'https://coveralls.io/webhook', + json={"mock": 'uh oh'}, + status=500) + mocks.argv.extend(['--parallel-build-number', '99', '--repo-token', 'thetoken']) + with ShouldRaise(SystemExit(1)): + with OutputCapture() as output: + main() + if PY2: + expected=( + 'Attempt to confirmed end of parallel build got 500:\n' + '{"mock": "uh oh"}' + ) + else: + expected=( + 'Attempt to confirmed end of parallel build got 500:\n' + 'b\'{"mock": "uh oh"}\'' + ) + output.compare(expected)
participants (1)
-
root