Skip to content

fix(e2e): sweep stale 2026-06-07 dates + hardcoded solver windows - #230

Merged
tomqwu merged 3 commits into
mainfrom
sprint-4-followup-e2e-stale-dates-sweep
Jul 13, 2026
Merged

tomqwu merged 3 commits into
mainfrom
sprint-4-followup-e2e-stale-dates-sweep

Conversation

@tomqwu

@tomqwu tomqwu commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Why

Follow-up from #227. That PR bumped 2026-06-07 in the four e2e files that watch /v/open (which filters out past events), but explicitly deferred the remaining seven because their tests also seed a hardcoded solver window (from=2026-05-19, to=2026-06-30) that has to move in lockstep with the seed event date — bumping just one would push the seed outside the window and drop the assignment.

Today (2026-07-13) is already ~5 weeks past 2026-06-07. The seven files continue to compile and run, but any downstream assertion that depends on a solve-and-publish producing a real assignment (/v/schedule seeing "Sunday 10am Service", /v/inbox seeing the auto notification, the ICS feed containing the shift, the onboarding wizard hitting 2 of 4 done) is at real risk of quietly going empty as the seed date recedes and the fixed window falls out of relevance.

This PR closes the sweep in one commit.

What changed

  • tests/e2e/_helpers.py — new solver_window_around(seed_iso) helper that returns a (from_date, to_date) pair three weeks either side of the seed. Same rot-prevention pattern as the existing next_sunday_iso().
  • Inlined seed + window in single-test files (each was already calling page.fill("#ev_date", ...) and page.fill("#from_date"|"#to_date", ...) inside a single test function):
    • test_smoke_full_loop.py
    • test_availability_solver.py — same seed date used for /v/availability time-off entries as well
    • test_bulk_notify.py
    • test_calendar_subscription.py
    • test_onboarding_wizard.py
  • Module-level constants for two files whose seed + window are shared across multiple test functions via helpers (_new_event, _solve_and_publish):
    • test_notif_assign_unpublish.py
    • test_analytics_recurring_swapreview.py
    • Chose EV_DATE / FROM_DATE / TO_DATE at import time so the helpers stay parameterless. next_sunday_iso() is pure w.r.t. date.today(), so a single test run sees one consistent triple.
  • tests/unit/test_e2e_helpers.py — new: 3 invariants for the two helpers (Sunday-in-future, seed strictly inside window, deterministic given the same seed).

Validation

  • poetry run pytest tests/unit/test_e2e_helpers.py tests/unit/test_e2e_lane.py → 5 passed
  • make test-unit-fast → 341 passed, 21 skipped
  • poetry run pytest tests/api tests/contract tests/web → 550 passed
  • poetry run black --check api tests → clean
  • poetry run ruff check api tests → clean

E2E lane could not be exercised locally (Playwright browser channel mismatch, same limitation noted in #227); CI is the source of truth for the e2e job. Contract snapshot untouched — no endpoints changed.

Follow-ups

  • 2026-07-05 in test_analytics_recurring_swapreview.py (#rs_sd, a recurring-series start date on a different code path) is not on any solve-and-publish flow and is still ~2 weeks in the future. Left alone to keep this sweep narrow; worth bumping alongside the next rot fix.

Generated by Claude Code

claude added 3 commits July 13, 2026 13:17
Summary:
Follow-up from PR #227. That PR bumped `2026-06-07` in four e2e files
that watch `/v/open` (which filters out past events), but explicitly
left the remaining seven for a separate sweep because their tests also
seed a hardcoded solver window (`from=2026-05-19, to=2026-06-30`) that
had to move in lockstep with the seed event date. Today (2026-07-13) is
already past `2026-06-07`, so a solve-and-publish flow can produce
an empty solution and drop /v/schedule assertions.

Adds `solver_window_around(seed_iso)` to `tests/e2e/_helpers.py`
returning a (from, to) 3-week bracket, then replaces the literal seed
date with `next_sunday_iso()` and the literal window with
`solver_window_around()` across all seven files.

Changed files:
- tests/e2e/_helpers.py — new `solver_window_around()` helper (docstring
  documents the rot pattern it prevents).
- tests/e2e/test_smoke_full_loop.py,
  tests/e2e/test_availability_solver.py,
  tests/e2e/test_bulk_notify.py,
  tests/e2e/test_calendar_subscription.py,
  tests/e2e/test_onboarding_wizard.py — inline seed/window inside the
  single test function.
- tests/e2e/test_notif_assign_unpublish.py,
  tests/e2e/test_analytics_recurring_swapreview.py — module-level
  `EV_DATE` / `FROM_DATE` / `TO_DATE` so the shared `_new_event` /
  `_solve_and_publish` helpers stay parameterless.
- tests/unit/test_e2e_helpers.py — new: 3 invariants for the helpers
  (Sunday-in-future, seed strictly inside window, deterministic).

Validation:
- `poetry run pytest tests/unit/test_e2e_helpers.py tests/unit/test_e2e_lane.py` → 5 passed
- `make test-unit-fast` → 341 passed, 21 skipped
- `poetry run pytest tests/api tests/contract tests/web` → 550 passed
- `poetry run black --check api tests` → clean
- `poetry run ruff check api tests` → clean
- `python -m py_compile` on all touched files → clean

Follow-ups:
- `2026-07-05` in test_analytics_recurring_swapreview.py (recurring-series
  start date, `#rs_sd`) is not on the same solve-and-publish path and is
  still ~2 weeks in the future — leaving alone to keep this sweep narrow.
  Worth bumping alongside a future rot fix.
The prior run's "Lint, type-check, and test" job failed at step 1
(Set up job) with "Failed to resolve action download info. Error:
Service Unavailable" — a GitHub Actions runner-provisioning outage,
not a real test failure. The e2e job on the same commit passed.
@tomqwu
tomqwu marked this pull request as ready for review July 13, 2026 13:48
@tomqwu
tomqwu merged commit 287e8a2 into main Jul 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants