add valkey to pytest ci

This commit is contained in:
Georges-Antoine Assi
2026-01-10 09:22:46 -05:00
parent 38ce9897d4
commit 743bddcb23
2 changed files with 10 additions and 3 deletions

View File

@@ -29,6 +29,12 @@ jobs:
MYSQL_DATABASE: romm_test
MYSQL_ROOT_PASSWORD: passwd
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
valkey:
image: valkey/valkey:7.2
ports:
- 6379
options: >-
--health-cmd="redis-cli ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Checkout repository
uses: actions/checkout@v4.3.0
@@ -57,6 +63,8 @@ jobs:
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mariadb.ports['3306'] }}
REDIS_HOST: 127.0.0.1
REDIS_PORT: ${{ job.services.valkey.ports['6379'] }}
run: |
cd backend
uv run pytest -vv --maxfail=10 --junitxml=pytest-report.xml --cov --cov-report xml:coverage.xml --cov-config=.coveragerc .

View File

@@ -1,5 +1,6 @@
from abc import ABC, abstractmethod
from enum import Enum
from itertools import chain
from typing import Any
import httpx
@@ -77,9 +78,7 @@ class PeriodicTask(Task, ABC):
self.func = func
def _get_existing_job(self) -> Job | None:
existing_jobs = list(tasks_scheduler.get_jobs()) + list(
low_prio_queue.get_jobs()
)
existing_jobs = chain(tasks_scheduler.get_jobs(), low_prio_queue.get_jobs())
for job in existing_jobs:
if isinstance(job, Job) and get_job_func_name(job) == self.func:
return job