From 1c413b27accf02fc9f581408b41b672056de422b Mon Sep 17 00:00:00 2001 From: Constantin Gemmingen <49587165+constgemm@users.noreply.github.com> Date: Tue, 7 Jul 2026 23:16:49 +0200 Subject: [PATCH 1/2] ci: run unit suite inside the container image on PRs Build the image and run `python3 -m unittest discover -s tests` inside it (tests/ mounted read-only, since .dockerignore keeps it out of the image), so CI exercises the artifact we ship rather than a bare runner Python. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/tests.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..539d1cb --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,30 @@ +name: tests + +# Run the unit suite inside the actual container image, not against a bare Python +# on the runner — the image is the artifact we ship, so it's the thing we test. +# tests/ is excluded from the image by .dockerignore, so we mount it read-only +# into the built image and run unittest from /app (where the modules live). + +on: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + container-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build the Layover image + run: docker build -t layover:ci . + + - name: Run unit tests inside the container + run: > + docker run --rm + -e PYTHONDONTWRITEBYTECODE=1 + -v "${{ github.workspace }}/tests:/app/tests:ro" + -w /app + layover:ci + python3 -m unittest discover -s tests -v From a800aa1c9f5371ed682ecd2a74b0e8fd599d9ece Mon Sep 17 00:00:00 2001 From: Constantin Gemmingen <49587165+constgemm@users.noreply.github.com> Date: Tue, 7 Jul 2026 23:25:29 +0200 Subject: [PATCH 2/2] ci: override image entrypoint so tests run (not the scheduler loop) The image ENTRYPOINT is scheduler.py, which loops forever; without --entrypoint the test command was appended as scheduler args and the container never exited. Run python3 directly instead. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 539d1cb..238c74b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,10 +21,13 @@ jobs: run: docker build -t layover:ci . - name: Run unit tests inside the container + # Override the image ENTRYPOINT (scheduler.py — a forever loop) so the + # container runs the tests and exits instead of starting the scheduler. run: > docker run --rm + --entrypoint python3 -e PYTHONDONTWRITEBYTECODE=1 -v "${{ github.workspace }}/tests:/app/tests:ro" -w /app layover:ci - python3 -m unittest discover -s tests -v + -m unittest discover -s tests -v