feat(clean-release): complete and verify backend test suite (33 passing tests)
- Relocated and standardized tests for clean_release subsystem into __tests__ sub-packages. - Implemented missing unit tests for preparation_service, audit_service, and stages. - Enhanced API contract tests for candidate preparation and compliance reporting. - Updated 023-clean-repo-enterprise coverage matrix with final verification results. - Fixed relative import issues and model validation mismatches during test migration.
This commit is contained in:
@@ -489,7 +489,6 @@
|
||||
- 📝 Render unified list of normalized reports with canonical minimum fields.
|
||||
- 🏗️ Layer: UI
|
||||
- 🔒 Invariant: Every rendered row shows task_type label, status, summary, and updated_at.
|
||||
- ⚡ Events: select
|
||||
- ➡️ WRITES_TO `props`
|
||||
- 📦 **ReportsList** (`Module`) `[TRIVIAL]`
|
||||
- 📝 Auto-generated module for frontend/src/lib/components/reports/ReportsList.svelte
|
||||
@@ -534,6 +533,9 @@
|
||||
- 📝 Validate report type profile mapping and unknown fallback behavior.
|
||||
- 🏗️ Layer: UI (Tests)
|
||||
- 🔒 Invariant: Unknown task_type always resolves to the fallback profile.
|
||||
- 📦 **frontend.src.lib.components.reports.__tests__.reports_list.ux** (`Module`)
|
||||
- 📝 Test ReportsList component iteration and event forwarding.
|
||||
- 🏗️ Layer: UI
|
||||
- 📦 **frontend.src.lib.components.reports.__tests__.report_card.ux** (`Module`)
|
||||
- 📝 Test UX states and transitions for ReportCard component
|
||||
- 🏗️ Layer: UI
|
||||
@@ -2833,6 +2835,25 @@
|
||||
- 📝 Create a sub-context with a different default source.
|
||||
- ƒ **execute** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **test_task_logger** (`Module`) `[TRIVIAL]`
|
||||
- 📝 Auto-generated module for backend/src/core/task_manager/__tests__/test_task_logger.py
|
||||
- 🏗️ Layer: Unknown
|
||||
- ƒ **mock_add_log** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **task_logger** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_task_logger_initialization** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_log_methods_delegation** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_with_source** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_missing_task_id** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_invalid_add_log_fn** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_progress_log** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.src.api.auth** (`Module`) `[CRITICAL]`
|
||||
- 📝 Authentication API endpoints.
|
||||
- 🏗️ Layer: API
|
||||
@@ -3478,6 +3499,41 @@
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_reports_detail_openapi_required_keys** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.tests.api.routes.test_clean_release_source_policy** (`Module`)
|
||||
- 📝 Validate API behavior for source isolation violations in clean release preparation.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: External endpoints must produce blocking violation entries.
|
||||
- ƒ **_repo_with_seed_data** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_prepare_candidate_blocks_external_source** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.tests.api.routes.test_clean_release_api** (`Module`)
|
||||
- 📝 Contract tests for clean release checks and reports endpoints.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: API returns deterministic payload shapes for checks and reports.
|
||||
- ƒ **_repo_with_seed_data** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_start_check_and_get_status_contract** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_report_not_found_returns_404** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_report_success** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_prepare_candidate_api_success** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **test_tasks_logs** (`Module`) `[TRIVIAL]`
|
||||
- 📝 Auto-generated module for backend/src/api/routes/__tests__/test_tasks_logs.py
|
||||
- 🏗️ Layer: Unknown
|
||||
- ƒ **client** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_task_logs_success** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_task_logs_not_found** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_task_logs_invalid_limit** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_task_log_stats_success** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.tests.test_reports_api** (`Module`)
|
||||
- 📝 Contract tests for GET /api/reports defaults, pagination, and filtering behavior.
|
||||
- 🏗️ Layer: Domain (Tests)
|
||||
@@ -4004,6 +4060,29 @@
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_with_all_fields** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **test_clean_release** (`Module`) `[TRIVIAL]`
|
||||
- 📝 Auto-generated module for backend/src/models/__tests__/test_clean_release.py
|
||||
- 🏗️ Layer: Unknown
|
||||
- ƒ **valid_candidate_data** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_release_candidate_valid** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_release_candidate_empty_id** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **valid_policy_data** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_enterprise_policy_valid** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_enterprise_policy_missing_prohibited** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_enterprise_policy_external_allowed** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_manifest_count_mismatch** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_compliant_run_validation** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_report_validation** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.src.services.resource_service** (`Module`)
|
||||
- 📝 Shared service for fetching resource data with Git status and task status
|
||||
- 🏗️ Layer: Service
|
||||
@@ -4132,6 +4211,8 @@
|
||||
- 📝 Wrapper for GitPython operations with semantic logging and error handling.
|
||||
- ƒ **__init__** (`Function`)
|
||||
- 📝 Initializes the GitService with a base path for repositories.
|
||||
- ƒ **_ensure_base_path_exists** (`Function`)
|
||||
- 📝 Ensure the repositories root directory exists and is a directory.
|
||||
- ƒ **_resolve_base_path** (`Function`)
|
||||
- 📝 Resolve base repository directory from explicit argument or global storage settings.
|
||||
- ƒ **_normalize_repo_key** (`Function`)
|
||||
@@ -4259,6 +4340,27 @@
|
||||
- 📝 Verify provider binding resolution priority.
|
||||
- ƒ **test_normalize_llm_settings_keeps_assistant_planner_settings** (`Function`)
|
||||
- 📝 Ensure assistant planner provider/model fields are preserved and normalized.
|
||||
- 📦 **test_llm_provider** (`Module`) `[TRIVIAL]`
|
||||
- 📝 Auto-generated module for backend/src/services/__tests__/test_llm_provider.py
|
||||
- 🏗️ Layer: Unknown
|
||||
- ƒ **test_encryption_cycle** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_empty_string_encryption** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_decrypt_invalid_data** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **mock_db** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **service** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_all_providers** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_create_provider** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_decrypted_api_key** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_decrypted_api_key_not_found** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.src.services.__tests__.test_resource_service** (`Module`)
|
||||
- 📝 Unit tests for ResourceService
|
||||
- 🏗️ Layer: Service
|
||||
@@ -4402,6 +4504,32 @@
|
||||
- 📝 Initialize clean release service package and provide explicit module exports.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: Package import must not execute runtime side effects beyond symbol export setup.
|
||||
- 📦 **backend.tests.services.clean_release.test_audit_service** (`Module`)
|
||||
- 📝 Validate audit hooks emit expected log patterns for clean release lifecycle.
|
||||
- 🏗️ Layer: Infra
|
||||
- ƒ **test_audit_preparation** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_audit_check_run** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_audit_report** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **test_policy_engine** (`Module`) `[TRIVIAL]`
|
||||
- 📝 Auto-generated module for backend/src/services/clean_release/__tests__/test_policy_engine.py
|
||||
- 🏗️ Layer: Unknown
|
||||
- ƒ **enterprise_clean_setup** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_policy_valid** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_missing_registry_ref** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_conflicting_registry** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_classify_artifact** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_validate_resource_source** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_evaluate_candidate** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.tests.services.clean_release.test_compliance_orchestrator** (`Module`)
|
||||
- 📝 Validate compliance orchestrator stage transitions and final status derivation.
|
||||
- 🏗️ Layer: Domain
|
||||
@@ -4430,6 +4558,51 @@
|
||||
- 📝 Verify violations counters remain consistent for blocking payload.
|
||||
- ƒ **test_missing_operator_summary** (`Function`)
|
||||
- 📝 Validate non-terminal run prevents operator summary/report generation.
|
||||
- 📦 **backend.tests.services.clean_release.test_manifest_builder** (`Module`)
|
||||
- 📝 Validate deterministic manifest generation behavior for US1.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: Same input artifacts produce identical deterministic hash.
|
||||
- ƒ **test_manifest_deterministic_hash_for_same_input** (`Function`)
|
||||
- 📝 Ensure hash is stable for same candidate/policy/artifact input.
|
||||
- 📦 **backend.tests.services.clean_release.test_stages** (`Module`)
|
||||
- 📝 Validate final status derivation logic from stage results.
|
||||
- 🏗️ Layer: Domain
|
||||
- ƒ **test_derive_final_status_compliant** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_derive_final_status_blocked** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_derive_final_status_failed_missing** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_derive_final_status_failed_skipped** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.tests.services.clean_release.test_source_isolation** (`Module`)
|
||||
- 📝 Verify internal source registry validation behavior.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: External endpoints always produce blocking violations.
|
||||
- ƒ **_registry** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_validate_internal_sources_all_internal_ok** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_validate_internal_sources_external_blocked** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.tests.services.clean_release.test_preparation_service** (`Module`)
|
||||
- 📝 Validate release candidate preparation flow, including policy evaluation and manifest persisting.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: Candidate preparation always persists manifest and candidate status deterministically.
|
||||
- ƒ **_mock_policy** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **_mock_registry** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **_mock_candidate** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_prepare_candidate_success** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_prepare_candidate_with_violations** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_prepare_candidate_not_found** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_prepare_candidate_no_active_policy** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.src.services.reports.normalizer** (`Module`) `[CRITICAL]`
|
||||
- 📝 Convert task manager task objects into canonical unified TaskReport entities with deterministic fallback behavior.
|
||||
- 🏗️ Layer: Domain
|
||||
@@ -4490,6 +4663,17 @@
|
||||
- 📝 Return filtered, sorted, paginated report collection.
|
||||
- ƒ **get_report_detail** (`Function`)
|
||||
- 📝 Return one normalized report with timeline/diagnostics/next actions.
|
||||
- 📦 **test_type_profiles** (`Module`) `[TRIVIAL]`
|
||||
- 📝 Auto-generated module for backend/src/services/reports/__tests__/test_type_profiles.py
|
||||
- 🏗️ Layer: Unknown
|
||||
- ƒ **test_resolve_task_type_fallbacks** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_resolve_task_type_valid** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_type_profile_valid** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_type_profile_fallback** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **test_report_service** (`Module`)
|
||||
- 📝 Unit tests for ReportsService list/detail operations
|
||||
- 🏗️ Layer: Domain
|
||||
@@ -5224,6 +5408,8 @@
|
||||
- 🏗️ Layer: Unknown
|
||||
- ƒ **test_git_service_get_repo_path_guard** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_git_service_get_repo_path_recreates_base_dir** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_superset_client_import_dashboard_guard** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.tests.core.test_migration_engine** (`Module`)
|
||||
@@ -5269,59 +5455,3 @@
|
||||
- 🏗️ Layer: Domain
|
||||
- ƒ **test_extract_objects_from_zip_collects_all_types** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.tests.api.routes.test_clean_release_source_policy** (`Module`)
|
||||
- 📝 Validate API behavior for source isolation violations in clean release preparation.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: External endpoints must produce blocking violation entries.
|
||||
- ƒ **_repo_with_seed_data** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_prepare_candidate_blocks_external_source** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.tests.api.routes.test_clean_release_api** (`Module`)
|
||||
- 📝 Contract tests for clean release checks and reports endpoints.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: API returns deterministic payload shapes for checks and reports.
|
||||
- ƒ **_repo_with_seed_data** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_start_check_and_get_status_contract** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_get_report_not_found_returns_404** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- 📦 **backend.tests.services.clean_release.test_policy_engine** (`Module`)
|
||||
- 📝 Validate policy model contracts and deterministic classification prerequisites for US1.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: Enterprise policy rejects invalid activation states.
|
||||
- ƒ **test_policy_enterprise_clean_valid** (`Function`)
|
||||
- 📝 Ensure valid enterprise policy payload is accepted.
|
||||
- ƒ **test_policy_missing_registry_fails** (`Function`)
|
||||
- 📝 Verify missing registry ref violates policy contract.
|
||||
- ƒ **test_policy_empty_prohibited_categories_fails** (`Function`)
|
||||
- 📝 Verify enterprise policy cannot activate without prohibited categories.
|
||||
- ƒ **test_policy_conflicting_external_forbidden_flag_fails** (`Function`)
|
||||
- 📝 Verify enterprise policy enforces external_source_forbidden=true.
|
||||
- ƒ **_policy_enterprise_clean** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **_registry** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_policy_valid** (`Function`)
|
||||
- 📝 Validate policy valid scenario
|
||||
- ƒ **test_conflicting_registry** (`Function`)
|
||||
- 📝 Validate policy conflicting registry edge
|
||||
- ƒ **test_external_endpoint** (`Function`)
|
||||
- 📝 Validate policy external endpoint edge
|
||||
- 📦 **backend.tests.services.clean_release.test_manifest_builder** (`Module`)
|
||||
- 📝 Validate deterministic manifest generation behavior for US1.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: Same input artifacts produce identical deterministic hash.
|
||||
- ƒ **test_manifest_deterministic_hash_for_same_input** (`Function`)
|
||||
- 📝 Ensure hash is stable for same candidate/policy/artifact input.
|
||||
- 📦 **backend.tests.services.clean_release.test_source_isolation** (`Module`)
|
||||
- 📝 Verify internal source registry validation behavior.
|
||||
- 🏗️ Layer: Domain
|
||||
- 🔒 Invariant: External endpoints always produce blocking violations.
|
||||
- ƒ **_registry** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_validate_internal_sources_all_internal_ok** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
- ƒ **test_validate_internal_sources_external_blocked** (`Function`) `[TRIVIAL]`
|
||||
- 📝 Auto-detected function (orphan)
|
||||
|
||||
Reference in New Issue
Block a user