diff --git a/Makefile b/Makefile index abb85ef..8a6a342 100644 --- a/Makefile +++ b/Makefile @@ -234,11 +234,11 @@ test-coverage: test-integration: @echo "Running full integration tests (requires running PIC stack)..." - PIC_HOST=$${PIC_HOST:-localhost} pytest tests/integration/ -v + PIC_HOST=$${PIC_HOST:-localhost} python3 -m pytest tests/integration/ -v test-integration-readonly: @echo "Running read-only integration tests (no peer creation)..." - PIC_HOST=$${PIC_HOST:-localhost} pytest tests/integration/test_live_api.py tests/integration/test_webui.py -v + PIC_HOST=$${PIC_HOST:-localhost} python3 -m pytest tests/integration/test_live_api.py tests/integration/test_webui.py -v test-api: cd api && python3 -m pytest tests/test_api_endpoints.py -v @@ -247,24 +247,29 @@ test-cli: cd api && python3 -m pytest tests/test_cli_tool.py -v # ── E2E tests ───────────────────────────────────────────────────────────────── +# Run `make test-e2e-deps` once to install dependencies, then use the other targets. +# WG tests require wg-quick and run under sudo (passwordless sudo assumed on this host). test-e2e-deps: - pip install -r tests/e2e/requirements.txt - playwright install --with-deps chromium + sudo pip3 install --break-system-packages -r tests/e2e/requirements.txt + sudo python3 -m playwright install --with-deps chromium test-e2e-api: - @PIC_HOST=$${PIC_HOST:-localhost} pytest tests/e2e/api -v -m "not wg and not cell_link" + @PIC_HOST=$${PIC_HOST:-localhost} python3 -m pytest tests/e2e/api -v test-e2e-ui: - @PIC_HOST=$${PIC_HOST:-localhost} pytest tests/e2e/ui -v -m ui + @PIC_HOST=$${PIC_HOST:-localhost} python3 -m pytest tests/e2e/ui -v test-e2e-wg: - @PIC_HOST=$${PIC_HOST:-localhost} sudo -E env PATH=$$PATH pytest tests/e2e/wg -v -m wg -p no:xdist + @PIC_HOST=$${PIC_HOST:-localhost} sudo -E python3 -m pytest tests/e2e/wg -v -p no:xdist test-e2e: test-e2e-api test-e2e-ui test-e2e-wg reset-test-admin-pass: - @python3 scripts/reset_admin_password.py "$${PIC_TEST_ADMIN_PASS:?Set PIC_TEST_ADMIN_PASS=}" +ifndef PIC_TEST_ADMIN_PASS + $(error Usage: make reset-test-admin-pass PIC_TEST_ADMIN_PASS=newpassword) +endif + python3 scripts/reset_admin_password.py "$(PIC_TEST_ADMIN_PASS)" test-phase1: cd api && python3 -m pytest tests/test_network_manager.py tests/test_phase1_endpoints.py -v