Add lifecycle-style tests

Aperta
#437 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
fastapi, github-actions, python
Ambito
ci-cd, testing

Direzione di ricerca

Start by reading tests/test_server_catch_uvicorn_shutdown.py and the clean-shutdown test in tests/test_mjpeg_stream.py around line 398. Add a CI job that runs a non-pytest lifecycle test, sends Ctrl+C at the appropriate point, and checks the expected output; adapting or factoring out the MJPEG shutdown helper is suggested. Done when the CI job verifies server shutdown successfully.

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

Descrizione

good first issue help wanted low priority

@julianstirling pointed out on #433 that it might be worth running a non-pytest test or two in CI, to verify e.g. shutdown logic in a full-blown server.

We don't think this needs to happen immediately, but it would be a nice self-contained job for a rainy day or someone who fancies contributing to the CI workflow.

The code could be as simple as running [tests/test_server_catch_uvicorn_shutdown.py](https://github.com/labthings/labthings-fastapi/pull/433/changes#diff-03df0a3c13dc7f04b79c2d785feeb45b5fb2f607fd06707333be6c2b69bc7ca0), though it would need to figure out how to send a Ctrl + C at the right moment and then check for the right output.

It's possible the test code I added for clean shutdown of the MJPEG stream could be adapted for this, possibly by factoring it out into a utility function.

Lingua principale
Python
Stelle
10
Fork
4
Merge medio
4g 15h
PR unite (30g)
11

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 labthings/labthings-fastapi

Tutte le issue di labthings/labthings-fastapi

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.