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. """