From bf3bb406f296ddca9189fb84ff1caa62a178bfb3 Mon Sep 17 00:00:00 2001 From: aprilahijriyan Date: Sat, 27 Apr 2024 15:57:48 +0700 Subject: [PATCH] fix(ci: action): :bug: fix codecov workflow --- .github/workflows/python-tests.yml | 1 + pyproject.toml | 2 +- tests/test_cache.py | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 1203562..355329c 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -46,3 +46,4 @@ jobs: uses: codecov/codecov-action@v4.0.1 with: token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml diff --git a/pyproject.toml b/pyproject.toml index 14a1cc2..eedf9b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,6 +104,6 @@ saq = "popol.jobs.saq.cli:saq" "Bug Tracker" = "https://github.com/aprilahijriyan/popol/issues" [tool.pytest.ini_options] -addopts = "--cov=popol -v" +addopts = "--cov=popol -v --cov-report xml --cov-report term " testpaths = ["tests"] # asyncio_mode = "auto" diff --git a/tests/test_cache.py b/tests/test_cache.py index a697e74..c0b2dfb 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -69,6 +69,7 @@ def test_sync_redis_backend(): assert cache.get(key) == 1 assert cache.incr(key) == 2 assert cache.decr(key) == 1 + cache.clear() @pytest.mark.anyio async def test_async_redis_backend(): @@ -81,3 +82,4 @@ async def test_async_redis_backend(): assert await cache.get(key) == 1 assert await cache.incr(key) == 2 assert await cache.decr(key) == 1 + await cache.clear()