gendesign/tradein-mvp/backend/tests
bot-backend f7d0bbd30e
All checks were successful
CI / changes (pull_request) Successful in 7s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
feat(tradein/backtest): frozen fixture + baseline + hermetic CI regression gate (#1966 PR 3/3)
Commits the gzipped 277-deal prod fixture (frozen _price_from_inputs inputs),
the frozen backtest_baseline.json (overall MAPE 18.63% / bias -1.2%; per-segment
бизнес -21.5% / элит -38.6% — the systemic expensive-segment underestimation,
now measured), and a hermetic pytest gate that replays the fixture through the
full pricing spine (ZERO DB) and asserts metrics == baseline within float tolerance.

Relative regression gate, not an absolute SLA (live coverage ~55% is data-blocked
per #1966). To change estimator behaviour: regenerate the baseline
(--from-fixture --update-baseline, no DB) and justify the per-segment deltas in the PR.
The fixture (gzipped prod inputs) re-extracts rarely; the per-change artifact is the
3 KB baseline. Large-file hook excludes the fixture (re-extracted only on ground-truth refresh).

Refs #1966
2026-06-27 15:49:58 +03:00
..
fixtures feat(tradein/backtest): frozen fixture + baseline + hermetic CI regression gate (#1966 PR 3/3) 2026-06-27 15:49:58 +03:00
matching fix(matching): conflict_resolution picks freshest (last_seen_at) value, deterministic (#1539) 2026-06-17 22:43:59 +03:00
scrapers fix(tradein/domclick): rewrite dead scraper to BFF JSON API + honest status (#1846, #1968) 2026-06-27 13:57:07 +03:00
scripts fix(backfill): drop nonexistent kadastr_num column from listings SELECT 2026-06-17 23:47:30 +03:00
services test(tradein): patch _geoportal_house_match in cadastral-before-yandex test 2026-06-19 18:06:28 +03:00
tasks feat(tradein): бэкфилл координат листингов из ekb_geoportal_buildings (street+house match) 2026-06-20 17:08:46 +03:00
__init__.py feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests) (#444) 2026-05-23 12:16:47 +00:00
test_781_quality_gate.py test(tradein): quality-gate anti-regression тесты на 5 P0-фиксов (#1098) 2026-06-06 19:27:23 +00:00
test_849_matching_savepoint.py fix(test): test_849 expects 3 begin_nested/lot after #1921 upsert-reconcile SAVEPOINT — unblock red main gate (#1925) 2026-06-26 17:23:24 +00:00
test_account_quota.py fix(tradein): atomic conditional quota increment — close TOCTOU (#747) (#749) 2026-05-30 15:52:34 +00:00
test_admin_ssrf.py fix(tradein): SSRF host-allowlist на admin scrape + удалён dead ADMIN_TOKEN (Refs #756) (#778) 2026-05-30 16:27:19 +00:00
test_anchor_watchdog.py fix(avito): scale per-anchor timeout for detail-enrich + durable SERP counters (#1661) 2026-06-17 06:07:50 +00:00
test_api_avito_stage4a.py fix(tradein): single-run guard на avito-city-sweep admin-endpoint (#874) 2026-05-31 08:55:33 +00:00
test_asking_to_sold_ratio.py fix(tradein): guard listing_segment во всех читателях listings — novostroyki вне comps (#1186) 2026-06-12 11:52:09 +03:00
test_audit_address_mismatch.py feat(tradein): Phase 1 of #582 — address mismatch audit infrastructure 2026-05-25 12:50:30 +05:00
test_avito_address_clean.py fix(avito): de-glue house number from district marker in _clean_address (#1773) 2026-06-19 13:33:43 +05:00
test_avito_blockpage.py fix(scrapers): avito per-card parse_failures counter + logging (Refs #823) (#830) 2026-05-30 20:01:50 +00:00
test_avito_browser_mode.py fix(avito): post-merge polish — unify fetch_mode guard + empty-render guard (#1811) (#1909) 2026-06-26 07:44:22 +00:00
test_avito_citywide.py feat(tradein): avito citywide + byrooms sweep mode (T6) (#848) 2026-05-31 06:13:19 +00:00
test_avito_detail_parse.py fix(tradein): drop non-EKB avito detail coords on ingest (audit #1871 P2) 2026-06-23 14:33:10 +05:00
test_avito_ekb_geo_filter.py feat(tradein/avito): per-card ЕКБ гео-фильтр (отсечь padding по России) + сплит комнат 4/5+ 2026-06-20 16:59:12 +03:00
test_avito_houses_dedup.py fix(scrapers/backend): socks5 health-probe (httpx[socks]) + status Literal whitelist + #1820 ext_id=0 dedup-гард 2026-06-20 10:17:37 +03:00
test_avito_houses_parse.py fix(scrapers): avito pipeline — новостройки house graceful (без housePage), AvitoBlockedError per-item не крашит прогон (#1820) 2026-06-20 09:53:46 +03:00
test_avito_imv_parse.py fix(tradein-imv): harden Avito IMV anti-bot path + offline contract tests (#565) 2026-05-28 16:29:05 +05:00
test_avito_newbuilding_sweep.py feat(avito): dedicated newbuilding (novostroyka) citywide sweep 2026-06-18 09:45:54 +03:00
test_avito_relative_date.py fix(tradein): Avito listing_date extraction (3 формата) (#601) 2026-05-27 12:55:27 +00:00
test_avito_serp_date.py feat(avito): capture newbuilding ЖК id/url from SERP card; persist newbuilding_id/url 2026-06-17 23:15:35 +03:00
test_backfill_house_coords.py feat(tradein): Phase 2-3 of #582 — Yandex backfill + canonical audit (#591) 2026-05-27 06:30:54 +00:00
test_backfill_wave2.py fix(tradein): починить 3 теста-регрессии из #1543 (sber rollback mock, matching tier0, cian price history) — deploy gate green 2026-06-16 09:03:27 +03:00
test_backtest_estimator.py feat(tradein/backtest): full-spine prediction + range-coverage/calibration/segment metrics (#1966 PR 2/3) 2026-06-27 11:21:57 +00:00
test_backtest_fixture_roundtrip.py fix(tradein/backtest): order-based callable replay (platform-robust) + gzip fixture loading (#1966 PR 3/3) 2026-06-27 15:39:34 +03:00
test_backtest_regression_gate.py feat(tradein/backtest): frozen fixture + baseline + hermetic CI regression gate (#1966 PR 3/3) 2026-06-27 15:49:58 +03:00
test_ban_rotation_1790.py fix(scrapers): avito ban-triggered IP rotation (#1790) — changeip on block, bounded 2026-06-20 21:24:12 +03:00
test_base_save_listings.py feat(tradein/scrapers): full_load пропускает листинги обновлённые сегодня при повторном прогоне (skip_seen_today) 2026-06-20 12:13:32 +03:00
test_cian_city_sweep.py feat(tradein): schedule cian_full_load (exhaustive secondary) + anchor sweep NB-only 2026-06-18 13:25:23 +03:00
test_cian_detail.py fix(scrapers): cian_detail — ceiling/repair актуальные пути state (#1791) 2026-06-19 19:57:18 +03:00
test_cian_newbuilding.py feat(browser): per-source proxy pool behind FEATURE_BROWSER_POOL_ENABLED (Phase 1) 2026-06-18 09:01:50 +03:00
test_cian_serp_scraper.py fix(cian): recover new-build house via cadastral anchor + listings (source,source_id) dedup (#1773) (#1912) 2026-06-26 07:45:22 +00:00
test_cian_session.py fix(cian): verify_session на curl_cffi impersonate — ban != cookies expired (Refs #768) (#785) 2026-05-30 16:40:54 +00:00
test_cian_state_parser.py fix(tradein): cian _cianConfig concat-формат + auth из header-frontend (#639) (#819) 2026-05-30 19:08:01 +00:00
test_cian_valuation.py fix(tradein): Mera-audit fix-1 — Cian valuation price sanity bounds 2026-06-21 09:02:32 +03:00
test_city_sweep.py test(tradein): cover avito/cian + mark_failed total_seen/new_count persistence (#1926) 2026-06-27 05:16:14 +05:00
test_config_avito_rotations.py fix(avito): proactive IP rotate at sweep start + raise max_rotations 2->4 (Datadome ban recovery) 2026-06-17 23:35:24 +03:00
test_deactivate_stale_avito.py feat(scrapers): segment-aware generic deactivate_stale for yandex/cian (#1558) 2026-06-16 16:09:19 +00:00
test_deactivate_stale_listings.py feat(scrapers): segment-aware generic deactivate_stale for yandex/cian (#1558) 2026-06-16 16:09:19 +00:00
test_deals_sanitize.py fix(tradein): Mera-audit fix-2 — _is_plausible_deal floor edge + area/price guards 2026-06-21 09:04:54 +03:00
test_domclick_sweep.py fix(tradein/domclick): rewrite dead scraper to BFF JSON API + honest status (#1846, #1968) 2026-06-27 13:57:07 +03:00
test_ekb_geoportal_ingest.py feat(tradein): EKB geoportal building ingest + geocoder tier (complete city buildings) 2026-06-19 17:51:07 +03:00
test_estimate_idor.py fix(tradein): rehydrate POST-only fields on GET /estimate/{id} (#696) (#710) 2026-05-30 11:05:52 +00:00
test_estimator_audit_fixes.py test(estimator): unit tests для audit fixes #audit-1..5 + empty-series guard 2026-06-20 15:06:59 +03:00
test_estimator_cian_budget.py fix(tradein): budget Cian valuation call to stop 25s estimate stalls 2026-06-19 12:43:28 +03:00
test_estimator_cian_integration.py feat(tradein): estimator additive expected_sold price (#648 S3) (#661) 2026-05-29 13:37:33 +00:00
test_estimator_client_coords.py feat(tradein): estimate accepts client-provided coords, skips geocode (Variant A) 2026-06-19 14:15:02 +03:00
test_estimator_cohort.py fix(tradein-estimator): extend cohort filter to Tier S + Tier H, fix late_soviet overlap (#522) 2026-05-24 13:14:59 +00:00
test_estimator_enrich.py refactor(tradein): unify kadastr_num -> cadastral_number (#732) 2026-05-31 15:41:52 +03:00
test_estimator_expected_sold.py feat(tradein): same-building anchor safe-guard (#755) 2026-05-31 12:19:50 +03:00
test_estimator_expected_sold_clamp.py fix(estimator): clamp expected_sold <= asking (ratio cap 1.0) -- smoke 3к exp_sold>asking 2026-06-21 00:35:23 +03:00
test_estimator_floor_optional.py feat(tradein): этаж/этажность optional + best test presets по deal count (#558) 2026-05-24 21:44:44 +00:00
test_estimator_ghost_anchor_1871.py fix(estimator): запрет confidence=high при n_analogs=0 (#1871 ghost-anchor) 2026-06-26 18:50:19 +03:00
test_estimator_ghost_anchor_radius_empty_1871.py fix(estimator): ghost-anchor — confidence='low' when radius analogs empty (#1871) (#1920) 2026-06-26 16:07:12 +00:00
test_estimator_imv_blend.py fix(estimator): DKP corridor uses P10/P90 not min/max (#1520) 2026-06-17 20:50:15 +03:00
test_estimator_imv_integration.py feat(tradein): integrate Avito IMV as 5th evaluation source (on-demand cached) (#452) 2026-05-23 13:08:22 +00:00
test_estimator_n_analogs_priced.py fix(estimator): deterministic comp tie-breaker + n_analogs counts priced analogs 2026-06-27 05:57:04 +05:00
test_estimator_null_floor_timeout.py fix(tradein): time-budget estimate enrichment + observable errors to stop opaque 502 (#654) (#673) 2026-05-29 17:22:02 +00:00
test_estimator_price_spine.py refactor(tradein/estimator): extract deterministic pricing into pure _price_from_inputs (#1966 foundation) 2026-06-27 13:00:21 +03:00
test_estimator_price_trend_dedup.py fix(tradein): Mera-audit fix-3 — cross-source dedup в _fetch_price_trend 2026-06-21 09:05:57 +03:00
test_estimator_pure_units.py fix(tradein/estimator): clamp premium headline к коридору сделок + робастный anchor (#1795) 2026-06-19 20:34:48 +03:00
test_estimator_quarter_index.py fix(estimator): sanity-clamp quarter-index factor (#859) (#863) 2026-05-31 07:20:59 +00:00
test_estimator_radius_dedup_1871.py fix(estimator): dedup radius-аналогов — не раздувать n_analogs (#1871) 2026-06-26 18:52:11 +03:00
test_estimator_radius_floor.py fix(estimator): radius-path нижний floor от DKP-коридора (анти-undershoot) 2026-06-21 00:25:05 +03:00
test_estimator_ratio_tier_fix.py fix(estimator): asking_to_sold ratio tier по финальному headline 2026-06-21 00:24:02 +03:00
test_estimator_repair_coef.py feat(tradein): estimator additive expected_sold price (#648 S3) (#661) 2026-05-29 13:37:33 +00:00
test_estimator_sber_time_adjust.py test(tradein): fix #794 test regressions on main (broken by #919 early squash-merge) (#921) 2026-05-31 19:05:10 +00:00
test_estimator_source_quota.py feat(tradein): estimator additive expected_sold price (#648 S3) (#661) 2026-05-29 13:37:33 +00:00
test_estimator_split_corridor_1871.py fix(estimator): enable split-home disclosure at validated threshold 1.2 (audit #1871) 2026-06-24 01:54:58 +05:00
test_estimator_yandex_integration.py test(tradein): align yandex history tests с batch-executemany (unblock deploy) (#851) 2026-05-31 06:16:45 +00:00
test_extract_short_addr.py feat(tradein-estimator): tiered house-match S→H→W (#507) 2026-05-24 12:41:12 +00:00
test_geo_precision.py feat(estimator): exclude city-centroid listings from radius analogs (Refs #769 Part E) 2026-05-30 21:22:21 +03:00
test_geocode_reverse_api.py feat(tradein): MapPicker snap marker — Phase 5 of #582 (#594) 2026-05-27 09:30:17 +00:00
test_geocoder_bbox.py fix(tradein): drop non-EKB avito detail coords on ingest (audit #1871 P2) 2026-06-23 14:33:10 +05:00
test_geocoder_cadastral_matcher.py feat(tradein): EKB geoportal building ingest + geocoder tier (complete city buildings) 2026-06-19 17:51:07 +03:00
test_history_scope.py chore(tradein): close pre-commit ruff gap + add CI pytest gate (#666) (#675) 2026-05-29 19:18:48 +00:00
test_house_dedup_merge.py feat(tradein): recurring house-dedup merge (schedule dormant) (#1772) (#1933) 2026-06-26 21:39:30 +00:00
test_house_imv_backfill_browser_flag.py feat(tradein-imv): route IMV backfill через BrowserFetcher.fetch_json за dormant-флагом (#915 Stage 3) (#1916) 2026-06-26 09:54:28 +00:00
test_house_imv_backfill_scheduler.py feat(scheduler): wire house_imv_backfill as scheduled source (#854) (#1910) 2026-06-26 07:45:08 +00:00
test_houses_rating_filter_entries_1789.py fix(scrapers): avito ban-triggered IP rotation (#1790) — changeip on block, bounded 2026-06-20 21:24:12 +03:00
test_insufficient_data_flag.py feat(tradein): insufficient_data flag on AggregatedEstimate (#697) (#734) 2026-05-30 14:40:04 +00:00
test_listing_source_snapshot.py feat(tradein): per-source listing price history — schema + daily snapshot (#570) (#646) 2026-05-29 12:18:04 +00:00
test_matching.py fix(tradein): починить 3 теста-регрессии из #1543 (sber rollback mock, matching tier0, cian price history) — deploy gate green 2026-06-16 09:03:27 +03:00
test_me_brand.py fix(tradein): remove «Практика» white-label brand (DB row + account mapping + assets) 2026-06-19 12:53:37 +03:00
test_pdf_security.py fix(pdf): brand-spoof + median=0 empty-state + SSRF + дисклеймер + sources (Refs #772) (#789) 2026-05-30 16:55:56 +00:00
test_pipeline_browser_routing.py feat(tradein): route avito pipeline SERP+detail+houses through BrowserFetcher (#915) (#916) 2026-05-31 18:10:38 +00:00
test_provider_rotation_1848.py fix(scrapers): avito changeip-resilience (retry короткими попытками) + честный статус когда SERP отработал (#1950) 2026-06-27 11:24:54 +03:00
test_ratelimit.py fix(tradein): bypass rate-limit for authenticated pilots + configurable limit (#655) (#669) 2026-05-29 15:56:30 +00:00
test_rbac.py feat(rbac): pilot scope → только /trade-in/** (#587) 2026-05-26 07:40:44 +00:00
test_repair_state_normalizer.py fix(scrapers): cian_detail — ceiling/repair актуальные пути state (#1791) 2026-06-19 19:57:18 +03:00
test_rosreestr_dedup_key.py fix(tradein): plain natural-key dedup_hash for rosreestr deals (#576) (#638) 2026-05-29 06:56:35 +00:00
test_rosreestr_poll.py feat(tradein): scheduled monthly Rosreestr new-quarter poll → ingest alert (#888) (#894) 2026-05-31 13:13:55 +00:00
test_sales_vs_listings.py feat(tradein): sales-vs-listings endpoint (PR K, foundation #564) (#597) 2026-05-27 11:55:44 +00:00
test_same_building_anchor.py feat(tradein): same-building anchor safe-guard (#755) 2026-05-31 12:19:50 +03:00
test_same_building_match.py feat(tradein): same-building матчинг аналогов по house_id (#6) 2026-05-28 13:55:51 +05:00
test_save_listings_upsert_reconcile.py fix(scrapers): save_listings — UPDATE by (source,source_id) при dedup_hash-дрейфе (avito_full_load краш) 2026-06-26 19:10:12 +03:00
test_sber_index.py fix(tradein): correct SberIndex hedonic/asking dataset-paths + 404 warning (#902) 2026-06-17 22:50:52 +03:00
test_scheduler.py feat(scheduler): per-source interval_days cadence (weekly exhaustive avito) 2026-06-18 23:10:18 +03:00
test_scheduler_main.py test(tradein): убрать мёртвый monkeypatch в test_scheduler_main (review fixup) 2026-06-12 10:56:27 +03:00
test_scrape_pipeline.py fix(scrapers): avito pipeline — новостройки house graceful (без housePage), AvitoBlockedError per-item не крашит прогон (#1820) 2026-06-20 09:53:46 +03:00
test_scrape_run_alert.py feat(observability): sentry alert on N consecutive scraper failures (Refs #827) (#833) 2026-05-30 20:10:29 +00:00
test_scraper_admin_apis.py feat(scrapers): live pacing-регулятор (GET/PUT /scraper/pacing) + data-quality coverage endpoint 2026-06-20 12:47:03 +03:00
test_scraper_proxy.py feat(browser): per-source proxy pool behind FEATURE_BROWSER_POOL_ENABLED (Phase 1) 2026-06-18 09:01:50 +03:00
test_scraper_resilience_1949_1950.py fix(scrapers): cian full_load anti-zombie — per-fetch wait_for + heartbeat внутри бакета (#1949) 2026-06-27 11:32:42 +03:00
test_scraper_settings.py chore(tradein): деактивировать N1.ru scraper — источник переехал в Cian 2026-06-16 14:50:51 +03:00
test_search_api.py feat(tradein): segment=vtorichka|novostroyki|all query-param on listings (#1188) 2026-06-17 21:43:01 +03:00
test_segment_guard_1186.py fix(estimator): #1774 Tier A admits same-building novostroyki resales when secondary-dominant 2026-06-19 14:00:13 +05:00
test_sentry_scrub.py feat(tradein): enrich GlitchTip SDK init — integrations + PII scrub (#396) (#643) 2026-05-29 09:23:17 +00:00
test_snapshot_writer.py fix(tradein): implement listings_snapshots + offer_price_history writers (#567) (#624) 2026-05-28 13:49:52 +00:00
test_street_deals_endpoint.py fix(tradein): word-boundary street match + cian unescape robustness (Refs #769 A1+D) (#798) 2026-05-30 17:18:33 +00:00
test_sweep_imv_phase.py fix(avito): scale per-anchor timeout for detail-enrich + durable SERP counters (#1661) 2026-06-17 06:07:50 +00:00
test_tier_a_primary_1774.py fix(estimator): #1774 Tier A admits same-building novostroyki resales when secondary-dominant 2026-06-19 14:00:13 +05:00
test_yandex_city_sweep.py fix(tradein/yandex): инкрементальный per-combo save + bounded gate-timeout (анти-зомби city_sweep) 2026-06-20 20:57:41 +03:00
test_yandex_detail.py refactor(tradein): drop dead schema — sale_type_text column + audit_log (#731) (#893) 2026-05-31 13:13:43 +00:00
test_yandex_detail_structural.py fix(scrapers): yandex_detail — area/ceiling из структурного блока, покрытие area 63%->~95% (#1792) 2026-06-19 19:37:51 +03:00
test_yandex_helpers.py fix(tradein): Yandex listing_date — keyword + absolute-no-year (#602) 2026-05-27 13:11:22 +00:00
test_yandex_history_area_filter.py fix(scrapers): yandex history skip area<=0 items 2026-06-21 00:25:43 +03:00
test_yandex_newbuilding.py fix(tradein): yandex newbuilding rating drift — "4.3из 5" без пробела (#974) 2026-06-15 21:29:43 +03:00
test_yandex_price_history.py feat(tradein): populate offer_price_history for yandex from gate price.previous/trend 2026-06-18 14:23:23 +03:00
test_yandex_realty_serp.py fix(tradein/yandex): инкрементальный per-combo save + bounded gate-timeout (анти-зомби city_sweep) 2026-06-20 20:57:41 +03:00
test_yandex_scrapers_delay_wiring.py feat(tradein): scraper_settings live-config + Yandex admin trigger endpoints (#484) 2026-05-23 15:28:34 +00:00
test_yandex_valuation.py fix(yandex-valuation): off-by-one cell index in _parse_row_cells (#552) 2026-05-24 19:57:17 +00:00
test_yandex_valuation_save.py perf(estimator): executemany batch insert in _save_yandex_history_items (Refs #826) (#832) 2026-05-30 20:07:06 +00:00