Skip to content

Commit

Permalink
Fixed coveralls issues with KeyError and HTTP 422 Unprocessable Entity
Browse files Browse the repository at this point in the history
Details:

* Increased minimum version of coveralls to 3.3.0 since it is the first
  version that allows overriding the service_job_id parameter via an
  environment variable.

* In the test workflow, specified two changes that solved both issues:
  * Changed the service name to 'github' (the default is 'github-actions')
  * Set the service_job_id request parameter by setting the
    COVERALLS_SERVICE_JOB_ID env var to GITHUB_RUN_ID.

* Improved the build ID shown on coveralls.io, to workflow name
  plus run number of that workflow. This allows for easier matching
  of Github Actions runs and coveralls.io builds.

Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Apr 30, 2023
1 parent d73f0cf commit c7b2f64
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -272,6 +272,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: "${{ matrix.os }},${{ matrix.python-version }},${{ matrix.package_level }}"
COVERALLS_SERVICE_NAME: github
COVERALLS_SERVICE_JOB_ID: "${{ github.run_id }}"
COVERALLS_SERVICE_NUMBER: "${{ github.workflow }}-${{ github.run_number }}"
run: |
coveralls -v
Expand All @@ -286,5 +289,6 @@ jobs:
- name: Send coverage finish to coveralls.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NUMBER: "${{ github.workflow }}-${{ github.run_number }}"
run: |
coveralls -v --finish
3 changes: 1 addition & 2 deletions dev-requirements.txt
Expand Up @@ -57,8 +57,7 @@ coverage>=5.0
pytest-cov>=2.7.0
# coveralls 2.0 has removed support for Python 2.7
git+https://github.com/andy-maier/coveralls-python.git@andy/add-py27#egg=coveralls; python_version == '2.7'
# TODO: Remove coveralls pinning to <3.0.0 once fixed (TheKevJames/coveralls-python#252)
coveralls>=2.1.2,<3.0.0; python_version >= '3.5'
coveralls>=3.3.0; python_version >= '3.5'

# PyYAML: covered in direct deps for development

Expand Down
4 changes: 2 additions & 2 deletions minimum-constraints.txt
Expand Up @@ -126,7 +126,7 @@ python-dateutil==2.8.2
prompt-toolkit==1.0.15; python_version == '2.7'
prompt-toolkit==2.0.1; python_version >= '3.5'

# PyYAML is pulled in by dparse and python-coveralls
# PyYAML is pulled in by dparse
PyYAML==5.3.1; python_version <= '3.5'
PyYAML==5.4; python_version >= '3.6'

Expand Down Expand Up @@ -190,7 +190,7 @@ packaging==21.0; python_version >= '3.6'
coverage==5.0
pytest-cov==2.7.0
# handled by dev-requirements.txt: git+https://github.com/andy-maier/coveralls-python.git@andy/add-py27#egg=coveralls; python_version == '2.7'
coveralls==2.1.2; python_version >= '3.5'
coveralls==3.3.0; python_version >= '3.5'

# Sphinx (no imports, invoked via sphinx-build script):
Sphinx==1.7.6; python_version == '2.7'
Expand Down

0 comments on commit c7b2f64

Please sign in to comment.