Start fixing forecast service API 3
This commit is contained in:
@@ -569,28 +569,22 @@ echo ""
|
||||
|
||||
log_step "5.1. Testing basic dashboard functionality"
|
||||
|
||||
# Test basic forecasting capability (if training completed)
|
||||
if [ -n "$TRAINING_TASK_ID" ]; then
|
||||
# Use a real product name from our CSV for forecasting
|
||||
FIRST_PRODUCT=$(echo "$REAL_PRODUCTS" | sed 's/"//g' | cut -d',' -f1)
|
||||
# Use a real product name from our CSV for forecasting
|
||||
FIRST_PRODUCT=$(echo "$REAL_PRODUCTS" | sed 's/"//g' | cut -d',' -f1)
|
||||
|
||||
FORECAST_RESPONSE=$(curl -s -X POST "$API_BASE/api/v1/forecasting/predict" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $ACCESS_TOKEN" \
|
||||
-H "X-Tenant-ID: $TENANT_ID" \
|
||||
-d "{
|
||||
\"products\": [\"$FIRST_PRODUCT\"],
|
||||
\"forecast_days\": 7,
|
||||
\"date\": \"2024-01-15\"
|
||||
FORECAST_RESPONSE=$(curl -s -X POST "$API_BASE/api/v1/tenants/$TENANT_ID/forecast/single" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $ACCESS_TOKEN" \
|
||||
-d "{
|
||||
\"products\": [\"$FIRST_PRODUCT\"],
|
||||
\"forecast_days\": 7,
|
||||
\"date\": \"2025-09-15\"
|
||||
}")
|
||||
|
||||
if echo "$FORECAST_RESPONSE" | grep -q '"predictions"\|"forecast"'; then
|
||||
log_success "Forecasting service is accessible"
|
||||
else
|
||||
log_warning "Forecasting may not be ready yet (model training required)"
|
||||
fi
|
||||
if echo "$FORECAST_RESPONSE" | grep -q '"predictions"\|"forecast"'; then
|
||||
log_success "Forecasting service is accessible"
|
||||
else
|
||||
log_warning "Skipping forecast test - no training task ID available"
|
||||
log_warning "Forecasting may not be ready yet (model training required)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user