From 506b5af8e741795af048929753dc4359882686e8 Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Mon, 17 Apr 2023 19:14:23 -0400 Subject: [PATCH 1/3] chore: Add test coverage report in XML format Ref: https://cordada.aha.io/requirements/TECHINFRA-194-8 Ref: https://cordada.aha.io/features/TECHINFRA-194 --- Makefile | 6 +++++- setup.cfg | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4680ef81..b74f83ec 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ TOXENV ?= py310 .PHONY: clean clean-build clean-pyc clean-test .PHONY: install-dev install-deps-dev .PHONY: lint lint-fix test test-all test-coverage -.PHONY: test-coverage-report test-coverage-report-console test-coverage-report-html +.PHONY: test-coverage-report test-coverage-report-console test-coverage-report-xml test-coverage-report-html .PHONY: build dist deploy upload-release .PHONE: python-virtualenv .PHONY: python-deps-compile python-deps-sync-check python-pip-tools-install @@ -87,12 +87,16 @@ test-coverage: ## run tests and record test coverage coverage run --rcfile=setup.cfg setup.py test test-coverage-report: test-coverage-report-console +test-coverage-report: test-coverage-report-xml test-coverage-report: test-coverage-report-html test-coverage-report: ## Run tests, measure code coverage, and generate reports test-coverage-report-console: ## print test coverage summary coverage report --rcfile=setup.cfg -m +test-coverage-report-xml: ## Generate test coverage XML report + coverage xml --rcfile=setup.cfg + test-coverage-report-html: ## generate test coverage HTML report coverage html --rcfile=setup.cfg diff --git a/setup.cfg b/setup.cfg index 45faa047..c8f5641a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,6 +13,9 @@ exclude_lines = if __name__ == .__main__. show_missing = True +[coverage:xml] +output = test-reports/coverage/xml/coverage.xml + [coverage:html] directory = test-reports/coverage/html From ace455fd27493b1b70aab443db2db4bf5c070464 Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Tue, 18 Apr 2023 14:57:04 -0400 Subject: [PATCH 2/3] chore: Remove Python package `codecov` The package's functionality will be provided by a GitHub Action. Ref: https://cordada.aha.io/requirements/TECHINFRA-194-8 Ref: https://cordada.aha.io/features/TECHINFRA-194 --- .github/workflows/ci.yaml | 2 -- requirements-dev.in | 1 - requirements-dev.txt | 7 +------ 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0214e4e3..e03c3c6c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -120,8 +120,6 @@ jobs: source "$PYTHON_VIRTUALENV_ACTIVATE" make test-coverage-report - codecov - - name: Check that compiled Python dependency manifests are up-to-date with their sources # FIXME: There are issues related to testing with multiple Python versions. if: ${{ startsWith(matrix.python_version, '3.8.') }} diff --git a/requirements-dev.in b/requirements-dev.in index 21df2341..99e34d84 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -6,7 +6,6 @@ black==23.1.0 bumpversion==0.5.3 -codecov==2.1.12 coverage==7.1.0 flake8==6.0.0 isort==5.12.0 diff --git a/requirements-dev.txt b/requirements-dev.txt index 2e9b5ab9..206dcd25 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -24,12 +24,8 @@ chardet==4.0.0 # via requests click==8.0.3 # via black -codecov==2.1.12 - # via -r requirements-dev.in coverage==7.1.0 - # via - # -r requirements-dev.in - # codecov + # via -r requirements-dev.in cryptography==39.0.1 # via # -c requirements.txt @@ -92,7 +88,6 @@ readme-renderer==35.0 # via twine requests==2.25.1 # via - # codecov # requests-toolbelt # twine requests-toolbelt==0.9.1 From 4eaba6b63e75e3c918de27ee80375f36a280fead Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Tue, 18 Apr 2023 15:00:41 -0400 Subject: [PATCH 3/3] chore: Add Codecov to CI workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > Codecov is the all-in-one code coverage reporting solution for any > test suite — giving developers actionable insights to deploy reliable > code with confidence. - Codecov web site: https://about.codecov.io/ - Documentation: https://docs.codecov.com/ Ref: https://cordada.aha.io/requirements/TECHINFRA-194-8 Ref: https://cordada.aha.io/features/TECHINFRA-194 --- .github/workflows/ci.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e03c3c6c..93b1b0d4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -120,6 +120,12 @@ jobs: source "$PYTHON_VIRTUALENV_ACTIVATE" make test-coverage-report + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3.1.2 + with: + directory: ./test-reports/coverage/ + fail_ci_if_error: true + - name: Check that compiled Python dependency manifests are up-to-date with their sources # FIXME: There are issues related to testing with multiple Python versions. if: ${{ startsWith(matrix.python_version, '3.8.') }}