fix(scrapers): renumber migration 114->115 (114 taken by disable_n1_sweep)
All checks were successful
CI / changes (pull_request) Successful in 6s
CI / changes (push) Successful in 8s
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
CI / backend-tests (push) Has been skipped
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Has been skipped
All checks were successful
CI / changes (pull_request) Successful in 6s
CI / changes (push) Successful in 8s
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
CI / backend-tests (push) Has been skipped
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Has been skipped
114_disable_n1_sweep.sql landed on main from #1556 — avoid duplicate prefix. No logic change; rename + test reference update only.
This commit is contained in:
parent
ddd31dce82
commit
0267d51731
2 changed files with 20 additions and 20 deletions
|
|
@ -1,4 +1,4 @@
|
|||
-- 114_scrape_schedules_seed_deactivate_stale_yandex_cian.sql
|
||||
-- 115_scrape_schedules_seed_deactivate_stale_yandex_cian.sql
|
||||
-- Seed scrape_schedules rows for nightly segment-aware stale-listing deactivation
|
||||
-- of yandex and cian vtorichka (#759 generalisation).
|
||||
--
|
||||
|
|
@ -14,7 +14,7 @@ from app.services import scheduler
|
|||
from app.tasks import deactivate_stale_avito as task_mod
|
||||
|
||||
_SQL_DIR = Path(__file__).resolve().parents[1] / "data" / "sql"
|
||||
_MIGRATION_114 = _SQL_DIR / "114_scrape_schedules_seed_deactivate_stale_yandex_cian.sql"
|
||||
_MIGRATION_115 = _SQL_DIR / "115_scrape_schedules_seed_deactivate_stale_yandex_cian.sql"
|
||||
|
||||
_GENERIC_FN_SRC = inspect.getsource(task_mod.deactivate_stale_listings)
|
||||
_COMPAT_FN_SRC = inspect.getsource(task_mod.deactivate_stale_avito_listings)
|
||||
|
|
@ -258,48 +258,48 @@ def test_failure_path_rollback_and_mark_failed(monkeypatch: pytest.MonkeyPatch)
|
|||
assert failed["run_id"] == 8
|
||||
|
||||
|
||||
def test_migration_114_exists() -> None:
|
||||
assert _MIGRATION_114.is_file(), f"missing migration: {_MIGRATION_114}"
|
||||
def test_migration_115_exists() -> None:
|
||||
assert _MIGRATION_115.is_file(), f"missing migration: {_MIGRATION_115}"
|
||||
|
||||
|
||||
def test_migration_114_seeds_yandex_and_cian() -> None:
|
||||
sql = _MIGRATION_114.read_text("utf-8")
|
||||
def test_migration_115_seeds_yandex_and_cian() -> None:
|
||||
sql = _MIGRATION_115.read_text("utf-8")
|
||||
assert "'deactivate_stale_yandex'" in sql
|
||||
assert "'deactivate_stale_cian'" in sql
|
||||
|
||||
|
||||
def test_migration_114_is_idempotent() -> None:
|
||||
sql = _MIGRATION_114.read_text("utf-8")
|
||||
def test_migration_115_is_idempotent() -> None:
|
||||
sql = _MIGRATION_115.read_text("utf-8")
|
||||
assert "ON CONFLICT (source) DO NOTHING" in sql
|
||||
|
||||
|
||||
def test_migration_114_enabled_true() -> None:
|
||||
sql = _MIGRATION_114.read_text("utf-8")
|
||||
def test_migration_115_enabled_true() -> None:
|
||||
sql = _MIGRATION_115.read_text("utf-8")
|
||||
assert "true" in sql
|
||||
|
||||
|
||||
def test_migration_114_is_transactional() -> None:
|
||||
sql = _MIGRATION_114.read_text("utf-8")
|
||||
def test_migration_115_is_transactional() -> None:
|
||||
sql = _MIGRATION_115.read_text("utf-8")
|
||||
assert "BEGIN;" in sql
|
||||
assert "COMMIT;" in sql
|
||||
|
||||
|
||||
def test_migration_114_window_7_to_8_utc() -> None:
|
||||
sql = _MIGRATION_114.read_text("utf-8")
|
||||
def test_migration_115_window_7_to_8_utc() -> None:
|
||||
sql = _MIGRATION_115.read_text("utf-8")
|
||||
assert re.search(r"\b7\b", sql), "window_start_hour 7 missing"
|
||||
assert re.search(r"\b8\b", sql), "window_end_hour 8 missing"
|
||||
|
||||
|
||||
def test_migration_114_segments_vtorichka_in_default_params() -> None:
|
||||
sql = _MIGRATION_114.read_text("utf-8")
|
||||
def test_migration_115_segments_vtorichka_in_default_params() -> None:
|
||||
sql = _MIGRATION_115.read_text("utf-8")
|
||||
assert "vtorichka" in sql
|
||||
|
||||
|
||||
def test_migration_114_ttl_30_days() -> None:
|
||||
sql = _MIGRATION_114.read_text("utf-8")
|
||||
def test_migration_115_ttl_30_days() -> None:
|
||||
sql = _MIGRATION_115.read_text("utf-8")
|
||||
assert "30" in sql
|
||||
|
||||
|
||||
def test_migration_114_no_psycopg_trap() -> None:
|
||||
sql = _MIGRATION_114.read_text("utf-8")
|
||||
def test_migration_115_no_psycopg_trap() -> None:
|
||||
sql = _MIGRATION_115.read_text("utf-8")
|
||||
assert not re.search(r":\w+::", sql)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue