From 44c526c8a38bbf016d8dabdd136f8c2c99e9dca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Wed, 1 Feb 2023 23:56:38 +0000 Subject: [PATCH 1/8] CI: sync the pytest reporting args in Cirrus and GA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index e07f20e53..ad8271a41 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,7 +7,7 @@ test_template: &test - command -v python3 - python3 --version - python3 -m pip install .[test] - - python3 -m pytest + - python3 -m pytest --showlocals -vv alpine-3_task: container: From df238c380de60ce15d2df33cfa2593f2483e547e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Thu, 2 Feb 2023 00:05:27 +0000 Subject: [PATCH 2/8] CI: report coverage in Cirrus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- .cirrus.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ad8271a41..55d9492fa 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,11 +3,13 @@ # SPDX-License-Identifier: MIT test_template: &test + environment: + CODECOV_TOKEN: ENCRYPTED[e18180139fa0a70726bb6f8dfbbc9fd53da36e6a4d2b449e30f99a255fdfdab63863117e8b6665deb06dd99d95e5aaad] test_script: - command -v python3 - python3 --version - - python3 -m pip install .[test] - - python3 -m pytest --showlocals -vv + - python3 -m pip install .[test] pytest-codecov + - python3 -m pytest --showlocals -vv --cov --cov-report=xml:coverage-$CIRRUS_TASK_NAME.xml --codecov alpine-3_task: container: From 448266bd982875d9e3909886b530720e711f9ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Thu, 2 Feb 2023 00:07:59 +0000 Subject: [PATCH 3/8] CI: ignore tests/packages/* from coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b0c55a038..675b42bfd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,6 +104,9 @@ known_first_party = 'mesonpy' disable_warnings = [ 'couldnt-parse', ] +omit = [ + 'tests/packages/*' +] [tool.coverage.html] show_contexts = true From beac9b45f969163db7fcbf6287c718c75975f21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Thu, 2 Feb 2023 00:18:51 +0000 Subject: [PATCH 4/8] fixup! CI: ignore tests/packages/* from coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 675b42bfd..a13cb9009 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -105,7 +105,7 @@ disable_warnings = [ 'couldnt-parse', ] omit = [ - 'tests/packages/*' + 'tests/packages/*', ] [tool.coverage.html] From b5ed4c6ce35013214193d5a5efc49177184ef9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Thu, 2 Feb 2023 00:18:55 +0000 Subject: [PATCH 5/8] CI: set coverage source directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index a13cb9009..c0ea6bdf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,6 +104,7 @@ known_first_party = 'mesonpy' disable_warnings = [ 'couldnt-parse', ] +source = ['.'] omit = [ 'tests/packages/*', ] From 8a7c76972572e48d73e8d2750aa452a1fc5a0d37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Thu, 2 Feb 2023 00:23:13 +0000 Subject: [PATCH 6/8] CI: ignore errors in coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This turns them into warnings instead. Signed-off-by: Filipe Laíns --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index c0ea6bdf4..f04a8ebf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -108,6 +108,7 @@ source = ['.'] omit = [ 'tests/packages/*', ] +ignore_errors = true [tool.coverage.html] show_contexts = true From 30acad1cadafa2b895e00afb8391093f7db6983d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Thu, 2 Feb 2023 00:25:48 +0000 Subject: [PATCH 7/8] fixup! CI: ignore errors in coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f04a8ebf6..dc4a727a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -108,6 +108,8 @@ source = ['.'] omit = [ 'tests/packages/*', ] + +[tool.coverage.report] ignore_errors = true [tool.coverage.html] From 14d23e6384308a20c72b30c081b846f89101a541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Thu, 2 Feb 2023 00:45:39 +0000 Subject: [PATCH 8/8] CI: ignore TYPE_CHECKING and NotImplementedError for coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index dc4a727a2..949e5994c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,6 +111,11 @@ omit = [ [tool.coverage.report] ignore_errors = true +exclude_lines = [ + '\#\s*pragma: no cover', # we need this because this field overrides the default + '^\s*raise NotImplementedError\b', + '^\sif typing.TYPE_CHECKING', +] [tool.coverage.html] show_contexts = true