From 6f99de2ac97deabe045fe9fbaedb518fa8e39ef2 Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Mon, 14 Nov 2022 19:18:42 +1300 Subject: [PATCH 1/7] :art: Begin switch from codecov.io to coveralls.io --- .github/workflows/build.yml | 19 ++++++++++++++++--- README.rst | 6 +++--- doc/development.rst | 2 +- tox.ini | 5 +---- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39eae343f..aeba16cb4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,10 +37,23 @@ jobs: - name: Test with pytest via tox run: | tox -e gh - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + + - name: Coveralls Parallel + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + flag-name: Unittests-${{ matrix.os }}-${{ python-version }} + parallel: true + + finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@master with: - fail_ci_if_error: true + github-token: ${{ secrets.github_token }} + parallel-finished: true static-code-analysis: runs-on: ubuntu-latest diff --git a/README.rst b/README.rst index 0e5d79e3f..11404785a 100644 --- a/README.rst +++ b/README.rst @@ -37,9 +37,9 @@ python-can :target: https://app.travis-ci.com/github/hardbyte/python-can :alt: Travis CI Server for develop branch -.. |coverage| image:: https://codecov.io/gh/hardbyte/python-can/branch/develop/graph/badge.svg - :target: https://codecov.io/gh/hardbyte/python-can/branch/develop - :alt: Test coverage reports on Codecov.io +.. |coverage| image:: https://coveralls.io/repos/github/hardbyte/python-can/badge.svg?branch=develop + :target: https://coveralls.io/github/hardbyte/python-can?branch=develop + :alt: Test coverage reports on Coveralls.io .. |mergify| image:: https://img.shields.io/endpoint.svg?url=https://api.mergify.com/v1/badges/hardbyte/python-can&style=flat :target: https://mergify.io diff --git a/doc/development.rst b/doc/development.rst index 055401bdc..cfb8dbe5d 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -108,7 +108,7 @@ The modules in ``python-can`` are: Creating a new Release ---------------------- -- Release from the ``master`` branch (except for pre-releases). +- Release from the ``main`` branch (except for pre-releases). - Update the library version in ``__init__.py`` using `semantic versioning `__. - Check if any deprecations are pending. - Run all tests and examples against available hardware. diff --git a/tox.ini b/tox.ini index 248a6fd37..8f9f86760 100644 --- a/tox.ini +++ b/tox.ini @@ -5,9 +5,9 @@ isolated_build = true deps = pytest==7.1.*,>=7.1.2 pytest-timeout==2.0.2 + coveralls pytest-cov==3.0.0 coverage==6.3 - codecov==2.1.12 hypothesis~=6.35.0 pyserial~=3.5 parameterized~=0.8 @@ -31,11 +31,8 @@ passenv = CI TRAVIS TRAVIS_* - CODECOV_* TEST_SOCKETCAN -commands_post = - codecov -X gcov [pytest] testpaths = test From 871d935fe5d7b6dc6ba4c56e7752194e659eca19 Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Mon, 14 Nov 2022 19:20:51 +1300 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=90=9B=20typo=20in=20github=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aeba16cb4..95c879491 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: uses: coverallsapp/github-action@master with: github-token: ${{ secrets.github_token }} - flag-name: Unittests-${{ matrix.os }}-${{ python-version }} + flag-name: Unittests-${{ matrix.os }}-${{ matrix.python-version }} parallel: true finish: From e741b9aa772a20d93349db073bb750df8a016a42 Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Mon, 14 Nov 2022 20:03:52 +1300 Subject: [PATCH 3/7] Generate lcov coverage report for coveralls.io --- .github/workflows/build.yml | 2 +- tox.ini | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95c879491..fbea2154d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: flag-name: Unittests-${{ matrix.os }}-${{ matrix.python-version }} parallel: true - finish: + coveralls: needs: test runs-on: ubuntu-latest steps: diff --git a/tox.ini b/tox.ini index 8f9f86760..fb1d77627 100644 --- a/tox.ini +++ b/tox.ini @@ -24,6 +24,7 @@ recreate = True passenv = CI GITHUB_* + COVERALLS_* PY_COLORS [testenv:travis] @@ -36,7 +37,7 @@ passenv = [pytest] testpaths = test -addopts = -v --timeout=300 --cov=can --cov-config=tox.ini --cov-report=xml --cov-report=term +addopts = -v --timeout=300 --cov=can --cov-config=tox.ini --cov-report=lcov --cov-report=term [coverage:run] From 58c537e2399d2605600a1077464991a4bdbff95c Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Mon, 14 Nov 2022 20:14:46 +1300 Subject: [PATCH 4/7] Update coverage deps --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index fb1d77627..0dbd6423e 100644 --- a/tox.ini +++ b/tox.ini @@ -5,9 +5,9 @@ isolated_build = true deps = pytest==7.1.*,>=7.1.2 pytest-timeout==2.0.2 - coveralls - pytest-cov==3.0.0 - coverage==6.3 + coveralls==3.3.1 + pytest-cov==4.0.0 + coverage==6.5.0 hypothesis~=6.35.0 pyserial~=3.5 parameterized~=0.8 From 4ad9975aefc3630dc76bcf3005041c9516177957 Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Mon, 14 Nov 2022 20:18:00 +1300 Subject: [PATCH 5/7] Include path to lcov file --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbea2154d..2ed1742c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,7 @@ jobs: github-token: ${{ secrets.github_token }} flag-name: Unittests-${{ matrix.os }}-${{ matrix.python-version }} parallel: true + path-to-lcov: ./coverage.lcov coveralls: needs: test From e384575335825af5fe9c6bacc2f836ad6c407d69 Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Mon, 14 Nov 2022 21:09:24 +1300 Subject: [PATCH 6/7] Disable too_slow health check on test message class --- test/test_message_class.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_message_class.py b/test/test_message_class.py index 688cda24f..489f3d233 100644 --- a/test/test_message_class.py +++ b/test/test_message_class.py @@ -7,7 +7,7 @@ import pickle from datetime import timedelta -from hypothesis import given, settings +from hypothesis import HealthCheck, given, settings import hypothesis.errors import hypothesis.strategies as st @@ -42,12 +42,13 @@ class TestMessageClass(unittest.TestCase): # The first run may take a second on CI runners and will hit the deadline @settings( max_examples=2000, + suppress_health_check=HealthCheck.too_slow, deadline=None if IS_GITHUB_ACTIONS else timedelta(milliseconds=500), ) @pytest.mark.xfail( IS_WINDOWS and IS_PYPY, raises=hypothesis.errors.Flaky, - reason="Hypothesis generates inconistent timestamp floats on Windows+PyPy-3.7", + reason="Hypothesis generates inconsistent timestamp floats on Windows+PyPy-3.7", ) def test_methods(self, **kwargs): is_valid = not ( From a2f1e56f93f93dc34c6e511aae397ba2c88d21a9 Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Mon, 14 Nov 2022 21:56:54 +1300 Subject: [PATCH 7/7] Disable too_slow health check on test message class properly --- test/test_message_class.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_message_class.py b/test/test_message_class.py index 489f3d233..9fae7262e 100644 --- a/test/test_message_class.py +++ b/test/test_message_class.py @@ -42,7 +42,7 @@ class TestMessageClass(unittest.TestCase): # The first run may take a second on CI runners and will hit the deadline @settings( max_examples=2000, - suppress_health_check=HealthCheck.too_slow, + suppress_health_check=[HealthCheck.too_slow], deadline=None if IS_GITHUB_ACTIONS else timedelta(milliseconds=500), ) @pytest.mark.xfail(