You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.9 KiB
2.9 KiB
Docker Testing Guide
This guide shows how to run the various test files in Docker containers for debugging the Islamic Scholar RAG application.
Available Test Services
1. Connection Test
Tests basic OpenRouter API connectivity
docker-compose run --rm test-connection
2. OpenRouter in App Environment
Tests OpenRouter connection with the same setup as app.py (including Qdrant)
docker-compose run --rm test-openrouter
3. AgentOS Simple Test
Tests AgentOS without RAG pipeline to isolate AgentOS issues
docker-compose run --rm test-agentos
4. RAG Agent Test
Tests the custom IslamicScholarAgent with RAG pipeline
docker-compose run --rm test-rag
Quick Test Commands
Run All Tests Sequentially
# Test 1: Basic connection
docker-compose run --rm test-connection
# Test 2: OpenRouter with app environment
docker-compose run --rm test-openrouter
# Test 3: AgentOS without RAG
docker-compose run --rm test-agentos
# Test 4: Full RAG pipeline
docker-compose run --rm test-rag
Run Tests in Running Container
If you have the main app container running:
# Enter the container
docker exec -it islamic-scholar-agent bash
# Run tests inside container
python app/connection_test.py
python app/test_openrouter_in_app.py
python app/test_rag_agent.py
# Note: test_agentos_simple.py needs a different port
Using the Test Runner
# In container
python run_test.py connection_test
python run_test.py openrouter_in_app
python run_test.py rag_agent
python run_test.py agentos_simple
Debugging Network Issues
1. Check Container Logs
docker-compose logs test-connection
docker-compose logs test-openrouter
2. Test Network Connectivity
# Test internet access from container
docker run --rm --network imam-javad_backend_imam-javad python:3.9 curl -I https://openrouter.ai/api/v1/models
# Test DNS resolution
docker exec islamic-scholar-agent nslookup openrouter.ai
3. Inspect Network
docker network inspect imam-javad_backend_imam-javad
Common Issues
Network Connection Lost
- Check if container has internet access
- Verify DNS settings (8.8.8.8 and 1.1.1.1 are configured)
- Test with different OpenRouter endpoints
Qdrant Connection Issues
- Ensure Qdrant container is running:
docker-compose ps - Check Qdrant logs:
docker-compose logs qdrant
Database Connection Issues
- PostgreSQL connection failures are now handled gracefully
- App will run without database but some AgentOS features may not work
Expected Results
- ✅ Connection Test: Should always work (like local testing)
- ✅ OpenRouter in App: May fail if Qdrant interferes with network
- ✅ AgentOS Simple: May fail if AgentOS has network issues
- ✅ RAG Agent: May fail if RAG pipeline has issues
Use these tests to isolate where exactly the network issue occurs!