diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b3e834e..4dec398 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,10 @@ variables: test: stage: test image: python:3.12-slim + variables: + # Unit tests must not use the Kubernetes PostgreSQL endpoint supplied to deploy. + BELKI_DATABASE_URL: "" + BELKI_IDENTITIES_DB: /tmp/belki-test-identities.sqlite3 before_script: - pip install --no-cache-dir -r requirements.txt script: diff --git a/structure_and_data.md b/structure_and_data.md index c89ab60..848e680 100644 --- a/structure_and_data.md +++ b/structure_and_data.md @@ -20,7 +20,7 @@ - The job waits for the DinD daemon and runs `docker info` before starting the build. - GitLab Runner retries source checkout up to three times (`GET_SOURCES_ATTEMPTS=3`) to absorb transient connectivity failures before the job script starts. A persistent inability to reach `git.nyan404.ru:443` still requires repair on the selected runner host. - The local image is currently `belki-calculator:test`; the CI target is now `$DOCKER_REGISTRY/belki:latest`. -- GitLab CI runs `python -m compileall -q app tests` and `python -m unittest discover -s tests -q` in a dedicated `test` stage before build/deploy. Local validation was performed with the same tests, JavaScript syntax check, a local browser/API smoke test, and container health/API smoke. +- GitLab CI runs `python -m compileall -q app tests` and `python -m unittest discover -s tests -q` in a dedicated `test` stage before build/deploy. The job explicitly clears `BELKI_DATABASE_URL` and uses `/tmp/belki-test-identities.sqlite3`, preventing unit tests from reaching the Kubernetes PostgreSQL service. Local validation was performed with the same tests, JavaScript syntax check, a local browser/API smoke test, and container health/API smoke. - The VK dialog layer is covered by tests for step-by-step entry, bulk detection, clarification, confirmation, and cancellation. - Bulk input accepts a natural one-line format without pipes, e.g. `15.08 11:00 11:20 Дикая Вишня 1604614 Серолап 1617140`; the web form calls `/api/inspect-bulk` and fills recognized fields. - Training and inspection have the same stepwise/bulk flow. Character identity can be resolved through `/api/resolve-identity` and the persistent SQLite directory; missing pairs produce an explicit prompt instead of guessed data.