Fundamental_Analysis/scripts/inspect_logs.sh
Lv, Qi 0cb31e363e Refactor E2E tests and improve error handling in Orchestrator
- Fix `simple_test_analysis` template in E2E test setup to align with Orchestrator's data fetch logic.
- Implement and verify additional E2E scenarios:
    - Scenario C: Partial Provider Failure (verified error propagation fix in Orchestrator).
    - Scenario D: Invalid Symbol input.
    - Scenario E: Analysis Module failure.
- Update `WorkflowStateMachine::handle_report_failed` to correctly scope error broadcasting to the specific task instead of failing effectively silently or broadly.
- Update testing strategy documentation to reflect completed Phase 4 testing.
- Skip Scenario B (Orchestrator Restart) as persistence is not yet implemented (decision made to defer persistence).
2025-11-21 20:44:32 +08:00

49 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
# Define the services we are interested in
SERVICES=(
"api-gateway"
"report-generator-service"
"data-persistence-service"
"alphavantage-provider-service"
"tushare-provider-service"
"finnhub-provider-service"
"yfinance-provider-service"
"workflow-orchestrator-service"
"fundamental_analysis-nats-1"
)
# Get line count from first argument, default to 10
LINES_INPUT=${1:-10}
echo "========================================================"
echo " FUNDAMENTAL ANALYSIS SYSTEM STATUS REPORT "
echo "========================================================"
echo "Showing last $LINES_INPUT lines of logs per service"
echo ""
for service in "${SERVICES[@]}"; do
echo "--------------------------------------------------------"
echo ">>> SERVICE: $service"
echo "--------------------------------------------------------"
if docker ps -a --format '{{.Names}}' | grep -q "^${service}$"; then
STATUS=$(docker inspect --format='{{.State.Status}}' "$service")
echo "Status: $STATUS"
echo "Logs (Last $LINES_INPUT lines):"
echo ""
# Execute docker logs directly without extra piping that might buffer output weirdly in some shells, though unlikely.
# The issue might be how variables are expanded or env.
# Using simple variable expansion.
docker logs "$service" --tail $LINES_INPUT 2>&1
else
echo "Status: NOT FOUND / NOT RUNNING"
fi
echo ""
echo ""
done
echo "========================================================"
echo " END OF LOG REPORT "
echo "========================================================"