From 6c8fe86cf99e8ae8ee695c18ca3d06eacfd9617d Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Tue, 2 Jun 2026 15:31:42 +0000 Subject: [PATCH] ddd tests --- .github/workflows/ddd_tests.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/ddd_tests.yml diff --git a/.github/workflows/ddd_tests.yml b/.github/workflows/ddd_tests.yml new file mode 100644 index 00000000..85e318d5 --- /dev/null +++ b/.github/workflows/ddd_tests.yml @@ -0,0 +1,32 @@ +name: Run DDD tests + +on: + pull_request: + branches: + - "**" + +# The DDD rewrite (tests/) defines SQLModel table classes that map to the same +# physical tables as the legacy backend models. Both sets share the one global +# SQLModel.metadata, so they cannot be imported into the same pytest process — +# hence this runs as a separate workflow from unit_tests.yml until the legacy +# models are retired. It also covers the Lambda packaging linter +# (tests/test_lambda_packaging.py). Its DB is spawned in-process by +# pytest-postgresql, so no `services: postgres` and no env secrets are required, +# and it runs independently of (and in parallel with) the legacy unit tests. +jobs: + ddd-tests: + name: DDD tests (Docker) + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build test image + run: docker build -f Dockerfile.test -t model-test . + + - name: Run DDD tests + run: | + docker run --rm \ + --network host \ + model-test pytest -vv tests/