diff --git a/backend/alembic/versions/c7d8e9f0a1b2_add_run_source_hash_composite_index.py b/backend/alembic/versions/c7d8e9f0a1b2_add_run_source_hash_composite_index.py index 42155453..85836dc2 100644 --- a/backend/alembic/versions/c7d8e9f0a1b2_add_run_source_hash_composite_index.py +++ b/backend/alembic/versions/c7d8e9f0a1b2_add_run_source_hash_composite_index.py @@ -28,7 +28,6 @@ def upgrade() -> None: "translation_records", ["run_id", "source_hash"], postgresql_using="btree", - sqlite=True, ) diff --git a/backend/src/api/routes/__tests__/test_assistant_api.py b/backend/src/api/routes/__tests__/test_assistant_api.py index aa0e2161..d6e33f8c 100644 --- a/backend/src/api/routes/__tests__/test_assistant_api.py +++ b/backend/src/api/routes/__tests__/test_assistant_api.py @@ -353,13 +353,25 @@ def test_dataset_review_scoped_message_uses_masked_filter_context(monkeypatch): message="show filters", dataset_review_session_id="sess-1", ) - assistant_routes._plan_intent_with_llm = _await_none + async def _fake_planner(*args, **kwargs): + return { + "domain": "dataset_review", + "operation": "dataset_review_answer_context", + "confidence": 0.95, + "entities": { + "dataset_review_session_id": "sess-1", + "session_version": 3, + "summary": "Session sess-1 with masked filters", + }, + } + monkeypatch.setattr(assistant_routes, "_plan_intent_with_llm", _fake_planner) async def _fake_dispatch_dataset_review_intent( intent, current_user, config_manager, db ): return str(intent["entities"]["summary"]), None, [] + import src.api.routes.assistant._dataset_review_dispatch as _drd monkeypatch.setattr( - assistant_routes, + _drd, "_dispatch_dataset_review_intent", _fake_dispatch_dataset_review_intent, ) diff --git a/backend/src/api/routes/__tests__/test_git_status_route.py b/backend/src/api/routes/__tests__/test_git_status_route.py index b6ecf823..707191fd 100644 --- a/backend/src/api/routes/__tests__/test_git_status_route.py +++ b/backend/src/api/routes/__tests__/test_git_status_route.py @@ -290,7 +290,7 @@ def test_resolve_merge_conflicts_passes_resolution_items_to_service(monkeypatch) return ["dashboards/a.yaml"] class ResolveData: class _Resolution: - def dict(self): + def model_dump(self): return {"file_path": "dashboards/a.yaml", "resolution": "mine", "content": None} resolutions = [_Resolution()] monkeypatch.setattr(git_routes, "git_service", MergeResolveGitService()) diff --git a/backend/src/services/clean_release/__tests__/test_audit_service.py b/backend/src/services/clean_release/__tests__/test_audit_service.py index fcb097d3..d549739a 100644 --- a/backend/src/services/clean_release/__tests__/test_audit_service.py +++ b/backend/src/services/clean_release/__tests__/test_audit_service.py @@ -19,8 +19,8 @@ from src.services.clean_release.audit_service import ( # @PURPOSE: Verify audit preparation stage correctly initializes and validates candidate state. def test_audit_preparation(mock_logger): audit_preparation("cand-1", "PREPARED") - mock_logger.info.assert_called_with( - "[REASON] clean-release preparation candidate=cand-1 status=PREPARED" + mock_logger.reason.assert_called_with( + "clean-release preparation candidate=cand-1 status=PREPARED" ) @@ -33,8 +33,8 @@ def test_audit_preparation(mock_logger): # @PURPOSE: Verify audit check run executes all checks and collects results. def test_audit_check_run(mock_logger): audit_check_run("check-1", "COMPLIANT") - mock_logger.info.assert_called_with( - "[REFLECT] clean-release check_run=check-1 final_status=COMPLIANT" + mock_logger.reflect.assert_called_with( + "clean-release check_run=check-1 final_status=COMPLIANT" ) @@ -47,8 +47,8 @@ def test_audit_check_run(mock_logger): # @PURPOSE: Verify audit report generation aggregates check results into a structured report. def test_audit_report(mock_logger): audit_report("rep-1", "cand-1") - mock_logger.info.assert_called_with( - "[EXPLORE] clean-release report_id=rep-1 candidate=cand-1" + mock_logger.explore.assert_called_with( + "clean-release report_id=rep-1 candidate=cand-1" ) diff --git a/backend/src/services/dataset_review/repositories/__tests__/test_session_repository.py b/backend/src/services/dataset_review/repositories/__tests__/test_session_repository.py index c309abe1..0a298854 100644 --- a/backend/src/services/dataset_review/repositories/__tests__/test_session_repository.py +++ b/backend/src/services/dataset_review/repositories/__tests__/test_session_repository.py @@ -1,4 +1,5 @@ from pathlib import Path +from datetime import UTC import pytest from sqlalchemy import create_engine, inspect, text @@ -124,8 +125,11 @@ def test_bump_session_version_updates_last_activity(db_session): ) repo.create_session(session) - before_activity = session.last_activity_at - next_version = repo.bump_session_version(session) + before_activity = session.last_activity_at + # Normalize to offset-aware for comparison (DB may store naive) + if before_activity is not None and before_activity.tzinfo is None: + before_activity = before_activity.replace(tzinfo=UTC) + next_version = repo.bump_session_version(session) assert next_version == 1 assert session.version == 1