mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 00:27:41 +01:00
add valkey to pytest ci
This commit is contained in:
8
.github/workflows/pytest.yml
vendored
8
.github/workflows/pytest.yml
vendored
@@ -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 .
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user