fix: correct pytest paths for tester container

The tester container uses WORKDIR /tests, so 'tests/pytest.ini' resolves
to /tests/tests/pytest.ini which does not exist, causing FileNotFoundError
in CI. Use paths relative to /tests (pytest . -c pytest.ini) for all
in-container invocations: CI job, Makefile target, tester image CMD, and
docs. Host-run scripts are unchanged (they run from repo root).

Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
This commit is contained in:
2026-07-15 17:59:12 +02:00
parent e1c78e7358
commit 51504f8a6f
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ test:compose:
# Run the slixmpp suite inside the compose network via the prebuilt tester
# image (deps + env vars already wired in docker-compose.yml). The ./tests
# volume mount surfaces report.xml on the runner for the junit artifact.
- docker compose --profile ci run --rm tester pytest tests/ -v -c tests/pytest.ini --junitxml=report.xml
- docker compose --profile ci run --rm tester pytest . -v -c pytest.ini --junitxml=report.xml
after_script:
- docker compose down -v || true
artifacts:
+1 -1
View File
@@ -13,7 +13,7 @@ Dockerized Prosody **13.0.6** XMPP server for VNCtalk, built against **Lua 5.4**
- **Docker-compose test harness** (`docker-compose.yml`): postgres + an aiohttp mock (stands in for auth/FCM/file-share/avatar backends) + prosody. Convenience wrappers in the `Makefile`:
- `make up` — build + start postgres/mocks/prosody (run pytest from host against published ports).
- `make down` / `make logs`.
- `make test` runs the suite in the `tester` service, but `tester` is gated behind the `ci` profile (`profiles: ["ci"]`) — invoke as `docker compose --profile ci run --rm tester pytest tests/ -v -c tests/pytest.ini`. Easier: use `run-compose-tests.sh` (see below).
- `make test` runs the suite in the `tester` service, but `tester` is gated behind the `ci` profile (`profiles: ["ci"]`) — invoke as `docker compose --profile ci run --rm tester pytest . -v -c pytest.ini`. Easier: use `run-compose-tests.sh` (see below).
- **`run-compose-tests.sh`** is the recommended one-shot runner: creates `tests/venv`, brings up the stack, waits for prosody health, and runs the full suite from the host with all env vars set. Flags: `--no-down` (leave stack up), `--down` (tear down only). It auto-remaps telnet to 5583 if 5582 is taken (e.g. by a stale kubectl port-forward).
- **`run-tests.sh` / `run-all-tests.sh`** target an **external microlab deployment** (hardcoded hosts/creds), not the compose harness. They require an SSH tunnel to PostgreSQL (`ssh -p 60024 … -L 14322:127.0.0.1:5432`) and a `kubectl port-forward services/telnet 5582:5582 -n prosody`. Not for local image testing.
- `test.sh` is a **manual smoke test**: `./test.sh <image-tag>` runs the image with example env vars. Not automated.
+1 -1
View File
@@ -21,7 +21,7 @@ up:
docker compose up -d --build postgres mocks prosody
test: up
docker compose run --rm --rm tester pytest tests/ -v -c tests/pytest.ini
docker compose run --rm --rm tester pytest . -v -c pytest.ini
down:
docker compose down
+1 -1
View File
@@ -7,7 +7,7 @@
# host can run pytest directly against the published ports.
#
# docker compose up -d --build postgres mocks prosody
# docker compose run --rm tester pytest tests/ -v -c tests/pytest.ini
# docker compose run --rm tester pytest . -v -c pytest.ini
#
# Env-var names below use the EXACT placeholders found in
# config/prosody.cfg.lua.template (snake_case ${fcm_api_url} / ${del_api_url}).
+1 -1
View File
@@ -4,4 +4,4 @@ COPY requirements.txt /tests/requirements.txt
RUN apk add --no-cache build-base libffi-dev openssl-dev libxml2-dev libxslt-dev \
&& pip install --no-cache-dir -r requirements.txt
COPY . /tests
CMD ["pytest", "tests/", "-v", "-c", "tests/pytest.ini"]
CMD ["pytest", ".", "-v", "-c", "pytest.ini"]
+1 -1
View File
@@ -154,7 +154,7 @@ and admin-only paths).
make test
# equivalent to:
# docker compose up -d --build postgres mocks prosody
# docker compose run --rm tester pytest tests/ -v -c tests/pytest.ini
# docker compose run --rm tester pytest . -v -c pytest.ini
```
The `tester` service is gated behind the `ci` profile, so it only starts when