62 lines
1.6 KiB
Bash
Executable file
62 lines
1.6 KiB
Bash
Executable file
#!/bin/bash
|
|
# Local testing script for HM QC Report Tool
|
|
|
|
echo "=== HM QC Report Tool - Local Testing ==="
|
|
echo ""
|
|
|
|
# Check if server is running
|
|
echo "1. Testing health endpoint..."
|
|
HEALTH=$(curl -s http://localhost:7183/health)
|
|
if [ $? -eq 0 ]; then
|
|
echo "✅ Health check passed"
|
|
echo "$HEALTH" | python3 -m json.tool
|
|
else
|
|
echo "❌ Server not responding. Make sure Flask is running on port 7183"
|
|
exit 1
|
|
fi
|
|
echo ""
|
|
|
|
# Test Box client directly
|
|
echo "2. Testing Box client integration..."
|
|
python3 << 'EOF'
|
|
from box_client import BoxReportClient
|
|
|
|
# Initialize client
|
|
client = BoxReportClient(
|
|
config_path='config/box_config.json',
|
|
report_folder_id='133295752718'
|
|
)
|
|
|
|
# Test search
|
|
print(" Searching for campaign 2069052...")
|
|
reports = client.search_by_job_number('2069052')
|
|
print(f" ✅ Found {len(reports)} reports")
|
|
|
|
if len(reports) > 0:
|
|
print(f"\n Sample reports:")
|
|
for i, report in enumerate(reports[:3], 1):
|
|
print(f" {i}. {report['name'][:60]}...")
|
|
EOF
|
|
echo ""
|
|
|
|
echo "3. Testing with non-existent campaign..."
|
|
python3 << 'EOF'
|
|
from box_client import BoxReportClient
|
|
|
|
client = BoxReportClient(
|
|
config_path='config/box_config.json',
|
|
report_folder_id='133295752718'
|
|
)
|
|
|
|
reports = client.search_by_job_number('9999999')
|
|
print(f" ✅ Correctly returned {len(reports)} reports for non-existent campaign")
|
|
EOF
|
|
echo ""
|
|
|
|
echo "=== Testing Complete ==="
|
|
echo ""
|
|
echo "To test the web interface:"
|
|
echo "1. Open http://localhost:7183 in your browser"
|
|
echo "2. Authenticate with Azure AD"
|
|
echo "3. Search for campaign number: 2069052"
|
|
echo "4. Should display 19 QC reports"
|