* feat: add reverse proxy support * improve * improve * improve * improve * improve * fix: update integration test to use modern 'docker compose' command - Replace 'docker-compose' with 'docker compose' (Docker Compose v2+) - Add fallback to legacy docker-compose command for compatibility - Fixes test failures on systems using Docker Compose plugin * ci: trigger test rerun * fix: make docker-compose detection more robust for CI - Add get_docker_compose_command() to detect available command - Use shutil.which() to check command availability - Dynamically use correct command (docker compose vs docker-compose) - Should work in both modern and legacy Docker environments * fix: docker-compose networking in base path integration test Fix connection refused error in test_reverse_proxy_simple_config by handling host vs bridge networking modes correctly: - Linux (host mode): nginx listens on 18080 directly, no port mapping - Mac/Windows (bridge mode): nginx listens on 80, mapped to 18080 With host networking, port mappings in docker-compose don't work since the container binds directly to the host's network namespace.
1.5 KiB
1.5 KiB
Hindsight Integration Tests
E2E and integration tests for Hindsight API that require a running server.
Test Types
1. Tests with External Server
Tests like test_mcp_e2e.py expect a server to already be running.
Running:
# Start the API server
./scripts/dev/start-api.sh
# Run tests
cd hindsight-integration-tests
HINDSIGHT_API_URL=http://localhost:8888 uv run pytest tests/test_mcp_e2e.py -v
2. Self-Contained Tests
Tests like test_base_path_deployment.py manage their own server lifecycle and use docker-compose.
Running:
cd hindsight-integration-tests
# Run with pytest
uv run pytest tests/test_base_path_deployment.py -v
# Or run directly for nice output
uv run python tests/test_base_path_deployment.py
Requirements:
- Docker and docker-compose installed (for reverse proxy test)
- No nginx required on host!
What it tests:
- ✅ API with base path (direct server)
- ✅ Full reverse proxy via docker-compose + Nginx
- ✅ Regression: API without base path
- ✅ Full retain/recall workflow
These tests:
- Start their own API servers on dedicated ports (18888-18891)
- Use docker-compose to test actual deployment scenarios
- Run in parallel with other tests (no port conflicts)
- Clean up automatically
Running All Tests
cd hindsight-integration-tests
uv run pytest tests/ -v
This runs both types. Self-contained tests won't conflict with the external server.
Environment Variables
HINDSIGHT_API_URL- Base URL for external-server tests (default:http://localhost:8888)