# Makefile — convenience wrappers for the docker-compose test harness.
#
#   make test         build + up the stack, run the full suite in the tester container
#   make up           build + start postgres/mocks/prosody (run pytest from the host)
#   make down         tear the stack down
#   make logs         tail prosody logs
#
# Host-run example (after `make up`):
#   XMPP_HOST=localhost XMPP_PORT=5222 XMPP_DOMAIN=example.com \
#   MUC_DOMAIN=conference.example.com XMPP_JID=user1@example.com XMPP_PASSWORD=pass1 \
#   XMPP_JID2=user2@example.com XMPP_PASSWORD2=pass2 \
#   REST_URL=http://localhost:5280/rest BOSH_URL=http://localhost:5280/http-bind \
#   WS_URL=ws://localhost:5280/xmpp-websocket ADMIN_TELNET_HOST=localhost \
#   PG_HOST=localhost PG_PORT=5434 PG_DB=prosody PG_USER=prosody PG_PASSWORD=prosody \
#   MOCK_URL=http://localhost:8092 SMACKS_HIBERNATION_TIME=10 \
#   pytest tests/ -v -c tests/pytest.ini

.PHONY: test up down logs

up:
	docker compose up -d --build postgres mocks prosody

test: up
	docker compose run --rm --rm tester pytest . -v -c pytest.ini

down:
	docker compose down

logs:
	docker compose logs -f prosody
