diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index fa4fdf2a..15d4cfe9 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -60,3 +60,15 @@ jobs: -e DB_PASSWORD=test \ -e DB_PORT=5432 \ model-test pytest -vv -m 'not integration' + + # 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. It runs as a separate invocation until the legacy + # models are retired. Its DB is spawned in-process by pytest-postgresql, + # so no DB service or env is required. + - name: Run DDD tests + run: | + docker run --rm \ + --network host \ + model-test pytest -vv tests/ diff --git a/pytest.ini b/pytest.ini index 5044465b..99cc8e1b 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,7 +4,6 @@ log_cli = true log_cli_level = INFO addopts = --cov-report term-missing --cov=etl/epc --cov=recommendations --cov=backend --cov=etl/epc_clean --cov=etl/spatial testpaths = - tests recommendations/tests backend/tests backend/address2UPRN/tests