Files
bakery-ia/services/training/tests/results/test_report.json

53 lines
95 KiB
JSON
Raw Normal View History

{
"test_run_summary": {
"timestamp": "2025-07-25T11:22:46.885733",
"total_suites": 4,
"passed_suites": 0,
"failed_suites": 4,
"error_suites": 0,
"timeout_suites": 0,
"success_rate": 0.0,
"total_duration_seconds": 9.403800010681152
},
"suite_results": {
"unit": {
"suite": "unit",
"status": "failed",
"return_code": 1,
"duration": 6.222464323043823,
"stdout": "\n================================================================================\nTRAINING SERVICE TEST SESSION STARTING\n================================================================================\n============================= test session starts ==============================\nplatform linux -- Python 3.11.13, pytest-7.4.3, pluggy-1.6.0 -- /usr/local/bin/python\ncachedir: .pytest_cache\nrootdir: /app\nplugins: anyio-3.7.1, mock-3.12.0, asyncio-0.21.1, cov-4.1.0\nasyncio: mode=Mode.STRICT\ncollecting ... collected 83 items\n\ntests/test_api.py::TestTrainingAPI::test_health_check FAILED\ntests/test_api.py::TestTrainingAPI::test_readiness_check_ready 2025-07-25 11:22:39 [INFO] shared.monitoring.logging: Logging configured for training-service at level INFO\nFAILED\ntests/test_api.py::TestTrainingAPI::test_readiness_check_not_ready FAILED\ntests/test_api.py::TestTrainingAPI::test_liveness_check_healthy FAILED\ntests/test_api.py::TestTrainingAPI::test_liveness_check_unhealthy FAILED\ntests/test_api.py::TestTrainingAPI::test_metrics_endpoint FAILED\ntests/test_api.py::TestTrainingAPI::test_root_endpoint FAILED\ntests/test_api.py::TestTrainingJobsAPI::test_start_training_job_success ERROR\ntests/test_api.py::TestTrainingJobsAPI::test_start_training_job_validation_error FAILED\ntests/test_api.py::TestTrainingJobsAPI::test_get_training_status_existing_job ERROR\ntests/test_api.py::TestTrainingJobsAPI::test_get_training_status_nonexistent_job FAILED\ntests/test_api.py::TestTrainingJobsAPI::test_list_training_jobs ERROR\ntests/test_api.py::TestTrainingJobsAPI::test_list_training_jobs_with_status_filter ERROR\ntests/test_api.py::TestTrainingJobsAPI::test_cancel_training_job_success ERROR\ntests/test_api.py::TestTrainingJobsAPI::test_cancel_nonexistent_job FAILED\ntests/test_api.py::TestTrainingJobsAPI::test_get_training_logs ERROR\ntests/test_api.py::TestTrainingJobsAPI::test_validate_training_data_valid ERROR\ntests/test_api.py::TestSingleProductTrainingAPI::test_train_single_product_success ERROR\ntests/test_api.py::TestSingleProductTrainingAPI::test_train_single_product_validation_error FAILED\ntests/test_api.py::TestSingleProductTrainingAPI::test_train_single_product_special_characters ERROR\ntests/test_api.py::TestModelsAPI::test_list_models ERROR\ntests/test_api.py::TestModelsAPI::test_get_model_details ERROR\ntests/test_api.py::TestErrorHandling::test_database_error_handling FAILED\ntests/test_api.py::TestErrorHandling::test_missing_tenant_id FAILED\ntests/test_api.py::TestErrorHandling::test_invalid_job_id_format FAILED\ntests/test_api.py::TestErrorHandling::test_messaging_failure_handling ERROR\ntests/test_api.py::TestErrorHandling::test_invalid_json_payload FAILED\ntests/test_api.py::TestErrorHandling::test_unsupported_content_type FAILED\ntests/test_api.py::TestAuthenticationIntegration::test_endpoints_require_auth FAILED\ntests/test_api.py::TestAuthenticationIntegration::test_tenant_isolation_in_api ERROR\ntests/test_api.py::TestAPIValidation::test_training_request_validation FAILED\ntests/test_api.py::TestAPIValidation::test_single_product_request_validation FAILED\ntests/test_api.py::TestAPIValidation::test_query_parameter_validation FAILED\ntests/test_api.py::TestAPIPerformance::test_concurrent_requests FAILED\ntests/test_api.py::TestAPIPerformance::test_large_payload_handling FAILED\ntests/test_api.py::TestAPIPerformance::test_rapid_successive_requests FAILED\ntests/test_ml.py::TestBakeryDataProcessor::test_prepare_training_data_basic PASSED\ntests/test_ml.py::TestBakeryDataProcessor::test_prepare_training_data_empty_weather PASSED\ntests/test_ml.py::TestBakeryDataProcessor::test_prepare_prediction_features PASSED\ntests/test_ml.py::TestBakeryDataProcessor::test_add_temporal_features PASSED\ntests/test_ml.py::TestBakeryDataProcessor::test_spanish_holiday_detection PASSED\ntests/test_ml.py::TestBakeryDataProcessor::test_prepare_training_data_insufficient_data FAILED\ntests/test_ml.py::TestBakeryProphetManager::test_train_bakery_model_success FAILED\ntests/test_ml.py::TestBakeryProphetManage
"stderr": "sys:1: RuntimeWarning: coroutine 'test_db_session' was never awaited\n",
"timestamp": "2025-07-25T11:22:43.703966"
},
"integration": {
"suite": "integration",
"status": "failed",
"return_code": 5,
"duration": 0.5286672115325928,
"stdout": "\n================================================================================\nTRAINING SERVICE TEST SESSION STARTING\n================================================================================\n============================= test session starts ==============================\nplatform linux -- Python 3.11.13, pytest-7.4.3, pluggy-1.6.0 -- /usr/local/bin/python\ncachedir: .pytest_cache\nrootdir: /app\nplugins: anyio-3.7.1, mock-3.12.0, asyncio-0.21.1, cov-4.1.0\nasyncio: mode=Mode.STRICT\ncollecting ... collected 0 items\n\n================================================================================\nTRAINING SERVICE TEST SESSION FINISHED\nExit Status: 5\n================================================================================\n\n--------- generated xml file: /app/tests/results/junit_integration.xml ---------\n\n---------- coverage: platform linux, python 3.11.13-final-0 ----------\nName Stmts Miss Cover Missing\n----------------------------------------------------------------\napp/__init__.py 0 0 100%\napp/api/__init__.py 0 0 100%\napp/api/models.py 18 18 0% 5-33\napp/api/training.py 166 166 0% 4-472\napp/core/__init__.py 0 0 100%\napp/core/config.py 32 32 0% 6-65\napp/core/database.py 115 115 0% 2-251\napp/main.py 89 89 0% 4-224\napp/ml/__init__.py 0 0 100%\napp/ml/data_processor.py 238 238 0% 2-493\napp/ml/prophet_manager.py 162 162 0% 2-408\napp/ml/trainer.py 127 127 0% 2-365\napp/models/__init__.py 0 0 100%\napp/models/training.py 87 87 0% 2-154\napp/schemas/__init__.py 0 0 100%\napp/schemas/training.py 184 184 0% 2-287\napp/services/__init__.py 0 0 100%\napp/services/messaging.py 41 41 0% 2-206\napp/services/training_service.py 285 285 0% 2-694\n----------------------------------------------------------------\nTOTAL 1544 1544 0%\nCoverage HTML written to dir /app/tests/results/coverage_integration_html\nCoverage XML written to file /app/tests/results/coverage_integration.xml\n\n============================ no tests ran in 0.20s =============================\n",
"stderr": "/usr/local/lib/python3.11/site-packages/coverage/control.py:883: CoverageWarning: No data was collected. (no-data-collected)\n self._warn(\"No data was collected.\", slug=\"no-data-collected\")\n",
"timestamp": "2025-07-25T11:22:44.232765"
},
"performance": {
"suite": "performance",
"status": "failed",
"return_code": 2,
"duration": 0.6394450664520264,
"stdout": "\n================================================================================\nTRAINING SERVICE TEST SESSION STARTING\n================================================================================\n============================= test session starts ==============================\nplatform linux -- Python 3.11.13, pytest-7.4.3, pluggy-1.6.0 -- /usr/local/bin/python\ncachedir: .pytest_cache\nrootdir: /app\nplugins: anyio-3.7.1, mock-3.12.0, asyncio-0.21.1, cov-4.1.0\nasyncio: mode=Mode.STRICT\ncollecting ... collected 0 items / 1 error\n\n================================================================================\nTRAINING SERVICE TEST SESSION FINISHED\nExit Status: 2\n================================================================================\n\n==================================== ERRORS ====================================\n__________________ ERROR collecting tests/test_performance.py __________________\nImportError while importing test module '/app/tests/test_performance.py'.\nHint: make sure your test modules/packages have valid Python names.\nTraceback:\n/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\ntests/test_performance.py:16: in <module>\n import psutil\nE ModuleNotFoundError: No module named 'psutil'\n--------- generated xml file: /app/tests/results/junit_performance.xml ---------\n\n---------- coverage: platform linux, python 3.11.13-final-0 ----------\nName Stmts Miss Cover Missing\n----------------------------------------------------------------\napp/__init__.py 0 0 100%\napp/api/__init__.py 0 0 100%\napp/api/models.py 18 18 0% 5-33\napp/api/training.py 166 166 0% 4-472\napp/core/__init__.py 0 0 100%\napp/core/config.py 32 32 0% 6-65\napp/core/database.py 115 115 0% 2-251\napp/main.py 89 89 0% 4-224\napp/ml/__init__.py 0 0 100%\napp/ml/data_processor.py 238 238 0% 2-493\napp/ml/prophet_manager.py 162 162 0% 2-408\napp/ml/trainer.py 127 127 0% 2-365\napp/models/__init__.py 0 0 100%\napp/models/training.py 87 87 0% 2-154\napp/schemas/__init__.py 0 0 100%\napp/schemas/training.py 184 184 0% 2-287\napp/services/__init__.py 0 0 100%\napp/services/messaging.py 41 41 0% 2-206\napp/services/training_service.py 285 285 0% 2-694\n----------------------------------------------------------------\nTOTAL 1544 1544 0%\nCoverage HTML written to dir /app/tests/results/coverage_performance_html\nCoverage XML written to file /app/tests/results/coverage_performance.xml\n\n=========================== short test summary info ============================\nERROR tests/test_performance.py\n!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!\n=============================== 1 error in 0.23s ===============================\n",
"stderr": "/usr/local/lib/python3.11/site-packages/coverage/control.py:883: CoverageWarning: No data was collected. (no-data-collected)\n self._warn(\"No data was collected.\", slug=\"no-data-collected\")\n",
"timestamp": "2025-07-25T11:22:44.872314"
},
"end_to_end": {
"suite": "end_to_end",
"status": "failed",
"return_code": 1,
"duration": 2.01322340965271,
"stdout": "\n================================================================================\nTRAINING SERVICE TEST SESSION STARTING\n================================================================================\n============================= test session starts ==============================\nplatform linux -- Python 3.11.13, pytest-7.4.3, pluggy-1.6.0 -- /usr/local/bin/python\ncachedir: .pytest_cache\nrootdir: /app\nplugins: anyio-3.7.1, mock-3.12.0, asyncio-0.21.1, cov-4.1.0\nasyncio: mode=Mode.STRICT\ncollecting ... 2025-07-25 11:22:46 [INFO] shared.monitoring.logging: Logging configured for training-service at level INFO\ncollected 1 item\n\ntests/test_end_to_end.py::TestTrainingServiceEndToEnd::test_complete_training_workflow_api ERROR\ntests/test_end_to_end.py::TestTrainingServiceEndToEnd::test_complete_training_workflow_api ERROR\n================================================================================\nTRAINING SERVICE TEST SESSION FINISHED\nExit Status: 1\n================================================================================\n\n\n==================================== ERRORS ====================================\n_ ERROR at setup of TestTrainingServiceEndToEnd.test_complete_training_workflow_api _\ntests/test_end_to_end.py:75: in real_bakery_data\n temp = 15 + 12 * np.sin((date.timetuple().tm_yday / 365) * 2 * np.pi)\nE UnboundLocalError: cannot access local variable 'np' where it is not associated with a value\n_ ERROR at teardown of TestTrainingServiceEndToEnd.test_complete_training_workflow_api _\ntests/conftest.py:464: in setup_test_environment\n os.environ.pop(var, None)(scope=\"session\")\nE TypeError: 'str' object is not callable\n=============================== warnings summary ===============================\nshared/config/base.py:280\n /app/shared/config/base.py:280: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/\n @validator('JWT_SECRET_KEY')\n\nshared/config/base.py:288\n /app/shared/config/base.py:288: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/\n @validator('LOG_LEVEL')\n\nshared/config/base.py:295\n /app/shared/config/base.py:295: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/\n @validator('ENVIRONMENT')\n\n../usr/local/lib/python3.11/site-packages/pydantic/_internal/_config.py:268\n /usr/local/lib/python3.11/site-packages/pydantic/_internal/_config.py:268: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/\n warnings.warn(DEPRECATION_MESSAGE, DeprecationWarning)\n\napp/schemas/training.py:41\n /app/app/schemas/training.py:41: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/\n @validator('seasonality_mode')\n\napp/schemas/training.py:106\n /app/app/schemas/training.py:106: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should
"stderr": "",
"timestamp": "2025-07-25T11:22:46.885639"
}
},
"recommendations": [
"Failed test suites: unit, integration, performance, end_to_end. Check logs for detailed error messages."
]
}