Files
sientia-dataops-model-manager/e2e/scenarios.md
vitor-aignosi 6bd30e3328 feat: enhance test scenarios and configuration for regression models
- Updated `pyproject.toml` to include new linting rules for end-to-end tests.
- Modified `requirements-dev.txt` to add dependencies for E2E testing with `testcontainers` and `requests`.
- Refactored multiple JSON test scenario files to standardize structure, including new fields for `experiment_run_id`, `bucket_name`, and `file_name`.
- Improved model training parameters in `train_model_params.py` to use `experiment_name` directly.
- Adjusted `data_manager_repository.py` to utilize the updated `experiment_name` for logging.

These changes improve the organization and clarity of regression model tests and enhance the overall testing framework.
2026-05-04 11:11:16 -03:00

3.7 KiB

E2E Test Scenarios

This document maps the workflow scenarios tested in the E2E suite to their corresponding JSON input files and expected behaviors.

1. TrainModel Workflow (test_train_model_workflow.py)

1.1 Happy Paths (Successful execution)

Test Function Input JSON Expected Status Description
test_scenario_1_1_1_linear_regression_basic 01-linear-regression-basic.json TRAINING_SUCCESS Basic linear regression without scaler. Verifies end-to-end pipeline.
test_scenario_1_1_2_polynomial_regression_degree2_with_scaler 03-polynomial-regression-degree2.json TRAINING_SUCCESS Polynomial regression (degree 2) with Standard Scaler.
test_scenario_1_1_3_linear_regression_with_lags 05-linear-regression-with-lags.json TRAINING_SUCCESS Linear regression with lag_train/lag_val per variable.
test_scenario_1_1_4_linear_regression_nan_interpolation 06-linear-regression-nan-interpolation.json TRAINING_SUCCESS Linear regression with nan_treatment='linear interpolation'.
test_scenario_1_1_5_linear_regression_with_limits 08-linear-regression-with-limits.json TRAINING_SUCCESS Linear regression with support_filters (min/max limits per variable).
test_scenario_1_1_6_polynomial_degree2_scaler_and_lags 09-polynomial-degree2-with-scaler-and-lags.json TRAINING_SUCCESS Polynomial regression (degree 2), Standard Scaler, and lags.
test_scenario_1_1_7_static_window_removal 11-linear-regression-static-threshold-custom.json TRAINING_SUCCESS Linear regression with rem_static_win=true, window, and static_threshold.
test_scenario_1_1_8_polynomial_with_support_filters 14-angular-test-polynomial-support-filters.json TRAINING_SUCCESS Polynomial regression (degree 4), Standard Scaler, and support filters.

1.2 Error Paths

Test Function Input JSON Expected Status Description
test_scenario_1_2_1_minio_file_not_found 01-linear-regression-basic.json TRAINING_ERROR MinIO file does not exist. Workflow fails during file download.
test_scenario_1_2_2_experiment_run_id_not_in_db 01-linear-regression-basic.json N/A (raises Exception) experiment_run_id does not exist in DB. Workflow fails immediately on status update attempt.

2. Parameter Validation (test_train_model_validation.py)

These scenarios test the business rule validations inside validate_train_params. All are expected to terminate with ORCHESTRATOR_VALIDATION_ERROR.

Test Function Modification Expected Error Substring
test_scenario_2_1_1_train_size_out_of_range train_size = 5 'train_size'
test_scenario_2_1_2_empty_variable_columns variable_columns = [] 'variable_columns'
test_scenario_2_1_3_invalid_date_format date_format = 'INVALID' 'date_format'
test_scenario_2_1_4_whitespace_only_model_name model_name = ' ' 'model_name'
test_scenario_2_1_5_unknown_model_type model_type = 'totally_unknown_model' 'totally_unknown_model'
test_scenario_2_1_6_missing_target_variable target_variable = '' 'target_variable'
test_scenario_2_1_7_missing_experiment_run_id Missing experiment_run_id N/A (raises ValueError immediately)

3. CleanupFiles Workflow (test_cleanup_files_workflow.py)

Test Function Description
test_scenario_3_1_1_cleanup_with_no_temp_dirs Temp directory is empty. Activity completes without error.
test_scenario_3_1_2_cleanup_removes_old_temp_dirs Two stale timestamped directories are removed.
test_scenario_3_1_3_cleanup_nonexistent_temp_path Target path does not exist. Handled gracefully without error.