Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

(chore) The API unit job has no Postgres, so every database-backed test skips in CI

Aperta
#7,040 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, postgresql, python

Direzione di ricerca

Start with run-api-unit-tests in .github/workflows/12-check-unit-tests.yml and the skip fixture in api/oss/tests/pytest/unit/sessions/conftest.py; review how the job configures services and database URIs. The issue proposes adding Postgres and setting both URIs, or making CI report or fail on skips. Run the API unit job and verify the database-backed tests execute rather than silently skip.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

chore ci/cd tests

The API unit job in CI has no database, so every database-backed test in the API unit suite skips there. The job reports success with 179 tests skipped, and the check reads the same as it would if they had all passed.

What happens

run-api-unit-tests in .github/workflows/12-check-unit-tests.yml:260-309 has no services: block and sets no POSTGRES_URI_CORE. The suite's own fixture handles that gracefully: api/oss/tests/pytest/unit/sessions/conftest.py probes the database URI once and skips every test marked integration when nothing answers.

@pytest.fixture(autouse=True)
def _skip_when_postgres_unreachable(request):
    if request.node.get_closest_marker("integration") and not _postgres_reachable():
        pytest.skip("Postgres not reachable — skipping session DAO integration tests")

The skip is the right behaviour on a developer's machine, where load-env leaves the URI commented out. In CI it means the tests never run anywhere, and nothing says so on the pull request.

The effect is concrete. Three new tests for the session dispatch claim, written to prove that the claim and its release behave correctly under real SQL, are part of that skip set: the published CI result for the head that added them reads 5210 passed and 179 skipped, with the skip count up by exactly three against the previous head. The compare-and-set guards can be deleted from the real SQL and CI stays green. Verified by standing up a throwaway Postgres and running both migration chains into it, at which point the same file goes from 41 skipped to 41 passed.

Proposed fix

Add a postgres:17 service to run-api-unit-tests and set POSTGRES_URI_CORE (and POSTGRES_URI_TRACING, which a second set of cases probes the same way) so the database-backed tests actually run. The suite already applies the migration chains it needs, and the fixture keeps skipping on a bare developer machine, which is where the skip was intended.

If a database in that job is not wanted, the alternative is to stop letting the skip pass silently: fail the job when a marked test skips in CI, or publish the skip count as part of the check, so a reader can tell a green check from an empty one.

Lingua principale
TypeScript
Stelle
4.8k
Fork
690
Merge medio
21h 53m
PR unite (30g)
451

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Agenta-AI/agenta

Tutte le issue di Agenta-AI/agenta

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.