fix(tradein): починить 3 теста-регрессии из #1543 — разблокировать deploy gate #1548
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1548
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/week-review-test-regressions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
🔴 Прод-деплой tradein заблокирован красным pytest-гейтом
После мержа #1543 («week-review автофиксы, 169 issue», commit
86e9ea29) jobtestвdeploy-tradein.ymlпадает 3/1787 → deploy не доезжает, уже влитые SQL-миграции (108/109) не применяются. Регрессии от #1543, не от #1546/#1547.Все три — устаревшие тесты/моки (#1543 легитимно изменил поведение кода, тесты не обновили). Production-код НЕ тронут.
Фиксы (только тестовые файлы)
test_cian_price_history_saves_changes— #1543 добавил вcian_price_history.pyдваSELECT COUNT(*)(before/after) вокруг save. Тест отдавал одинreturn_valueна все execute →int(MagicMock)-int(MagicMock)=0. Заменил наside_effect=[listings, before=0, after=2].test_match_house_tier0_cadastr— #1543 добавил_insert_alias(db,…)послеcadastr_exact(houses.py:92) → +1db.execute. Тест давал 3 side_effect, нужно 4 (advisory_lock → cadastr → _insert_alias → _upsert_house_source). ДобавилNone.test_pull_sber_indices_error_per_series_continues— #1543 добавилawait asyncio.to_thread(db.rollback)в error-recovery (sber_index.py:472, фикс #1345/#1348). Фейк_ExecuteCaptureне имелrollback. Добавилdef rollback(self) -> None: pass.Верификация
Полный CI-гейт прогнан в реальном окружении (
uv run pytest+ те же 2 documented deselect):Три ранее-падавших — зелёные. ruff clean.
После мержа
Deploy gate станет зелёным → deploy применит накопленные миграции (
108_clean_avito_addresses_v2,108_merge_duplicate_houses,109_asking_to_sold_ratio) — все провалидированы dry-run против прод-данных. houses 13456 → 8978.