From c9ac85bffcd6ba95c57b64ddb047c0ea3362ab97 Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Sat, 20 Dec 2025 16:06:49 +0000 Subject: [PATCH] Rename the test that fully boots the server to lifecycle_test --- .gitlab-ci.yml | 4 ++-- tests/{integration_tests => lifecycle_test}/testfile.py | 8 ++++++-- tests/unit_tests/test_dummy_server.py | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) rename tests/{integration_tests => lifecycle_test}/testfile.py (95%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f9dda30d..378fda4a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -209,14 +209,14 @@ build-docs: - !reference [.python, rules] # Only runs when a .py file is edited -server_integration_tests: +server_lifecycle_test: extends: .python stage: integration needs: - job: build artifacts: true script: - - tests/integration_tests/testfile.py + - tests/lifecycle_test/testfile.py pages: needs: diff --git a/tests/integration_tests/testfile.py b/tests/lifecycle_test/testfile.py similarity index 95% rename from tests/integration_tests/testfile.py rename to tests/lifecycle_test/testfile.py index 02dd30a0..2278c6e2 100755 --- a/tests/integration_tests/testfile.py +++ b/tests/lifecycle_test/testfile.py @@ -1,8 +1,12 @@ #! /usr/bin/env python3 -"""Start a server subprocess for integration tests. +"""Start a server subprocess for testing the server's life cycle. + +This test spools up a server in a sub process. Connects to an MJPEG stream, runs a +couple of other tests. Most importantly it checks the server shuts down gracefully +despite the MJPEG stream being connected. These tests are separated from unit tests to avoid inflating test coverage. -For now, this file should be run directly rather than through a test framework. +This file should be run directly rather than through a test framework. They are designed to run on CI and should work on Linux or WSL for local debugging. """ diff --git a/tests/unit_tests/test_dummy_server.py b/tests/unit_tests/test_dummy_server.py index ed7206c0..e666eb1b 100644 --- a/tests/unit_tests/test_dummy_server.py +++ b/tests/unit_tests/test_dummy_server.py @@ -4,7 +4,7 @@ Rather than spinning up a full uvicorn webserver for each test these tests use the FastAPI ``TestClient`` or directly communicate with the underlying LabThings-FastAPI code. This increases speed of testing significantly. -For tests that require a full running server see the ``integration_tests`` +For tests that require a full running server see the ``lifecycle_test`` directory in the tests directory. """