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:
+1
-1
@@ -46,7 +46,7 @@ test:compose:
|
|||||||
# Run the slixmpp suite inside the compose network via the prebuilt tester
|
# Run the slixmpp suite inside the compose network via the prebuilt tester
|
||||||
# image (deps + env vars already wired in docker-compose.yml). The ./tests
|
# image (deps + env vars already wired in docker-compose.yml). The ./tests
|
||||||
# volume mount surfaces report.xml on the runner for the junit artifact.
|
# 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:
|
after_script:
|
||||||
- docker compose down -v || true
|
- docker compose down -v || true
|
||||||
artifacts:
|
artifacts:
|
||||||
|
|||||||
@@ -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`:
|
- **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 up` — build + start postgres/mocks/prosody (run pytest from host against published ports).
|
||||||
- `make down` / `make logs`.
|
- `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-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.
|
- **`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.
|
- `test.sh` is a **manual smoke test**: `./test.sh <image-tag>` runs the image with example env vars. Not automated.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ up:
|
|||||||
docker compose up -d --build postgres mocks prosody
|
docker compose up -d --build postgres mocks prosody
|
||||||
|
|
||||||
test: up
|
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:
|
down:
|
||||||
docker compose down
|
docker compose down
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
# host can run pytest directly against the published ports.
|
# host can run pytest directly against the published ports.
|
||||||
#
|
#
|
||||||
# docker compose up -d --build postgres mocks prosody
|
# 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
|
# Env-var names below use the EXACT placeholders found in
|
||||||
# config/prosody.cfg.lua.template (snake_case ${fcm_api_url} / ${del_api_url}).
|
# config/prosody.cfg.lua.template (snake_case ${fcm_api_url} / ${del_api_url}).
|
||||||
|
|||||||
+1
-1
@@ -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 \
|
RUN apk add --no-cache build-base libffi-dev openssl-dev libxml2-dev libxslt-dev \
|
||||||
&& pip install --no-cache-dir -r requirements.txt
|
&& pip install --no-cache-dir -r requirements.txt
|
||||||
COPY . /tests
|
COPY . /tests
|
||||||
CMD ["pytest", "tests/", "-v", "-c", "tests/pytest.ini"]
|
CMD ["pytest", ".", "-v", "-c", "pytest.ini"]
|
||||||
|
|||||||
+1
-1
@@ -154,7 +154,7 @@ and admin-only paths).
|
|||||||
make test
|
make test
|
||||||
# equivalent to:
|
# equivalent to:
|
||||||
# docker compose up -d --build postgres mocks prosody
|
# 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
|
The `tester` service is gated behind the `ci` profile, so it only starts when
|
||||||
|
|||||||
Reference in New Issue
Block a user