Skip to content

Commit

Permalink
QA: Configure pytest and add coverage tracking using Codecov.io
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Dec 3, 2024
1 parent 41813ed commit 38ee1fc
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,14 @@ jobs:
- name: Run linters and software tests
run: poe check

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
.DS_Store
gecko.log
*.orig
.coverage
coverage.xml
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ setup-virtualenv:
# Test
# ----
test: setup-virtualenv
$(pytest) -vvv tests
$(pytest)

format-js:
brew install prettier
Expand Down
16 changes: 15 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ optional-dependencies.release = [
optional-dependencies.test = [
"freezegun>=1,<2",
"pytest>=6,<9",
"pytest-cov<7",
]
urls.Homepage = "https://github.com/grafana-toolbox/grafanimate"
urls.Issues = "https://github.com/grafana-toolbox/grafanimate/issues"
Expand All @@ -100,7 +101,7 @@ lint.select = [
# pyupgrade
# "UP",
# flake8-commas
"COM",
# "COM",
# Pycodestyle
"E",
# eradicate
Expand Down Expand Up @@ -163,6 +164,19 @@ lint.per-file-ignores."tests/*" = [
profile = "black"
src_paths = [ "grafanimate", "tests" ]

[tool.pytest.ini_options]
addopts = "-rA --verbosity=3 --cov --cov-report=term-missing --cov-report=xml"
minversion = "2.0"
log_level = "DEBUG"
log_cli_level = "DEBUG"
log_format = "%(asctime)-15s [%(name)-36s] %(levelname)-8s: %(message)s"
testpaths = [
"grafanimate",
"tests",
]
xfail_strict = true
markers = [
]
[tool.poe.tasks]

check = [
Expand Down

0 comments on commit 38ee1fc

Please sign in to comment.