Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available:
6.1.0
Testing Guide
Quick Test
Run the automated test suite:
python tests/test_rag_system.py
Or with venv:
source venv/bin/activate
python tests/test_rag_system.py
Manual Testing
1. Test Modal Connection
source venv/bin/activate
modal --version
Expected: Shows Modal version number
2. Test Indexing
source venv/bin/activate
python src/web/query_product_design.py --index
Expected:
- β Loads Word/PDF/Excel files
- β Creates embeddings
- β Stores in ChromaDB
- β Shows success message
Time: 2-5 minutes
3. Test Query (CLI)
source venv/bin/activate
python src/web/query_product_design.py --query "What are the three product tiers?"
Expected:
- β Returns answer with product tier information
- β Shows retrieval and generation times
- β Lists sources
Time: 3-10 seconds (first query may be slower due to cold start)
4. Test Query (Interactive Mode)
source venv/bin/activate
python src/web/query_product_design.py --interactive
Then type questions like:
- "What are the three product tiers?"
- "What is the Year 3 premium volume?"
- "What coverage does the Standard tier include?"
5. Test Web Interface
source venv/bin/activate
python src/web/web_app.py
Then:
- Open browser:
http://127.0.0.1:5000 - Enter a question
- Click "Ask Question"
- Verify answer appears
Test Cases
Product Information Queries
- β "What are the three product tiers?"
- β "What are the premium ranges for each tier?"
- β "What coverage does the Standard tier include?"
- β "What are the unique features of TokyoDrive Insurance?"
Financial Queries
- β "What is the Year 3 premium volume projection?"
- β "What is the target loss ratio?"
- β "What are the break-even projections?"
Market & Strategy Queries
- β "What is the target market size in Tokyo?"
- β "Who are the main competitors?"
- β "What are the key value propositions?"
Compliance Queries
- β "What are the FSA licensing requirements?"
- β "What is the minimum capital requirement?"
- β "What data privacy requirements apply?"
Expected Behavior
Successful Query
- Answer appears within 10-30 seconds
- Answer is relevant and accurate
- Sources are listed
- Timing information is shown
Failed Query
- Clear error message
- Suggestion for fixing the issue
- No crash or hang
Troubleshooting Tests
"Modal command not found"
source venv/bin/activate
pip install modal
"No documents found"
# Upload documents first
modal volume put mcp-hack-ins-products \
docs/product-design/tokyo_auto_insurance_product_design.docx \
docs/product-design/tokyo_auto_insurance_product_design.docx
# Then index
python src/web/query_product_design.py --index
"Collection not found"
# Run indexing first
python src/web/query_product_design.py --index
Slow queries
- First query: 10-30 seconds (cold start)
- Subsequent queries: 3-10 seconds (warm container)
Performance Benchmarks
| Operation | Expected Time |
|---|---|
| Indexing (first time) | 2-5 minutes |
| Query (cold start) | 10-30 seconds |
| Query (warm) | 3-10 seconds |
| Web app startup | < 5 seconds |
File Format Tests
Should Work
- β
.docxfiles (Word) - β
.pdffiles (PDF) - β
.xlsxfiles (Excel 2007+) - β
.xlsfiles (Excel 97-2003)
Should Be Ignored
- β
.mdfiles (markdown) - β
.txtfiles - β
.csvfiles - β Other formats
Integration Tests
End-to-End Test
- Upload Word/PDF/Excel document
- Index documents
- Query via CLI
- Query via web interface
- Verify answers are consistent
Error Handling Test
- Query without indexing β Should show helpful error
- Query with invalid question β Should handle gracefully
- Network issues β Should show timeout/connection error
Continuous Testing
For development, run tests after:
- Code changes
- Dependency updates
- Configuration changes
- Document updates