Skip to content

Seed test reports on today's local date, not two hours back - #322

Merged
parawanderer merged 1 commit into
mainfrom
test/seed-reports-from-local-midnight
Nov 24, 2026
Merged

parawanderer merged 1 commit into
mainfrom
test/seed-reports-from-local-midnight

Conversation

@parawanderer

Copy link
Copy Markdown
Owner

AMapWithTagsOnIt seeded every tag's location at now − 2h, and its comment claimed that was comfortably inside today. It is between 02:00 and 22:00. Between 00:00 and 02:00 that report belongs to yesterday, the history screen asks for one local day at a time, and it shows nothing: DebugModeReachesEveryScreenTest failed at 00:14 UTC with "no history row was built at all" while the other 858 tests passed. Same failure on main at the same hour.

TimesToday.at(i) anchors a seeded time to local midnight instead, a minute per item, clamped to now for the first minutes of the day. Both fixtures that seeded offsets use it now; TheWholeAppJourneyTest had already been fixed this way by hand and loses its copy of the arithmetic.

Verified:

  • TimesTodayTest: 6 JVM tests with the clock and zone passed in, covering midday, 00:30, 23:59:59, the first minute of the day, item spacing and a non-UTC zone.
  • Negative control: with now − 2h put back in TimesToday.at, 5 of the 6 fail. The end-of-day case is the one that still passes, which is the point of it.
  • :app:testEmulatorDebugAndroidTest: 884 tests, 0 failures, 16m.
  • :app:testDebugUnitTest, :app:compileDebugAndroidTestJavaWithJavac and scripts/check_java_imports.py.

Not verified: that run happened at 14:53 UTC, outside the window that failed, so it exercises the new seed times against every fixture-based test but not the midnight case itself. That one is pinned by TimesTodayTest with an injected clock rather than by a real clock.

TimesToday lives in the app's source set because the JVM suite cannot compile against androidTest. It is 40 lines and nothing in the app calls it.

🤖 Generated with Claude Code

AMapWithTagsOnIt put every tag's seeded location at now - 2h. The history screen asks for one
local day at a time, so between 00:00 and 02:00 UTC that report belongs to yesterday and the
screen has nothing to show: DebugModeReachesEveryScreenTest failed with "no history row was
built at all" at 00:14 UTC on #320, and at the same hour on main before it.

TimesToday.at(i) anchors the seeded time to local midnight instead, clamped to now for the first
minute of the day. Both fixtures use it, and TheWholeAppJourneyTest loses its copy of the
arithmetic.

TimesTodayTest pins midnight, end of day, the first minute and a foreign zone with an injected
clock; 5 of its 6 tests go red when the old offset is put back.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@parawanderer
parawanderer merged commit 81881d0 into main Nov 24, 2026
4 checks passed

This branch was previously deployed

1 inactive deployment
Android Build — a9e8608c Deployed Nov 24, 2026 by parawanderer via Instrumented tests (emulator) #431
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.

1 participant