Add lifecycle-style tests

Offen
#437 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
65/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
fastapi, github-actions, python
Bereich
ci-cd, testing

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
10
Forks
4
Ø Merge
4 T. 15 Std.
Gemergte PRs (30 T.)
11

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus labthings/labthings-fastapi

Alle Issues in labthings/labthings-fastapi

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.