Skip to content

fix(stats/integration.test): use rolling TODAY date — prevent CI failure ~2026-06-24#224

Open
erudenko wants to merge 1 commit into
fix/ci-24307096245from
fix/ci-integration-test-rolling-dates
Open

fix(stats/integration.test): use rolling TODAY date — prevent CI failure ~2026-06-24#224
erudenko wants to merge 1 commit into
fix/ci-24307096245from
fix/ci-integration-test-rolling-dates

Conversation

@erudenko

Copy link
Copy Markdown
Member

What this fixes

plugins/stats/tests/integration.test.ts had two deleteOldSessions retention tests using "2026-03-26" as the date for a "recent" session:

  1. "deleteOldSessions removes sessions beyond retention window" — inserts an old session (2024-01-01) and a recent session ("2026-03-26"), expects deletedCount = 1. Once 2026-03-26 crosses 90 days old (~2026-06-24), both sessions will be deleted and deletedCount will be 2 → test fails.

  2. "deleteOldSessions returns 0 when no sessions are old enough" — inserts only the "2026-03-26" session, expects deletedCount = 0. After ~2026-06-24, that session will be deleted → test fails.

As of today (2026-05-23) "2026-03-26" is 58 days old — within the 90-day window, so tests currently pass. They will fail in approximately 32 days.

Fix

Replaced both hardcoded "2026-03-26" occurrences with the TODAY constant already defined at the top of the file — the same pattern applied to db.test.ts by the companion PR #214.

Relationship to other PRs

This PR is stacked directly on PR #180 (fix/ci-24307096245), the comprehensive CI fix with all 13 checks green.

https://claude.ai/code/session_018a2oNcRBTHviPcedKmyroE


Generated by Claude Code

…ons tests

Two deleteOldSessions tests used "2026-03-26" as the "recent" session date.
That date is 58 days old today; the 90-day retention window means both tests
currently pass, but they will fail around 2026-06-24 when the date ages out.

Replaced both occurrences with the TODAY constant already defined in the file,
matching the fix pattern applied to db.test.ts in the companion PR.

https://claude.ai/code/session_018a2oNcRBTHviPcedKmyroE
This was referenced May 23, 2026
This was referenced Jun 6, 2026
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