Skip to content

ci(app): run the Dart suite under two far-east timezones - #14440

Merged
Git-on-my-level merged 3 commits into
mainfrom
task/msd-ci-tz-far-east
Sep 18, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
task/msd-ci-tz-far-east

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

What changed and why

Runs the Dart suite a second time under two far-east timezones — Pacific/Kiritimati (UTC+14)
and Pacific/Pago_Pago (UTC−11) — so a date-dependent test cannot pass only because CI happens
to run in UTC.

This closes the remaining half of package Z1's acceptance, which asks that
mobile-verify fast --all pass "with no flags on a UTC+7 host and under a forced far-east
TZ in CI
". The first half merged as #14313; this half was written at the same time, never
opened as a PR, and was found tonight by an audit for unpushed work. It is rescued here as a
single commit cherry-picked onto current main rather than as its original branch, whose other
two commits are #14330's already-merged content.

The class it guards against is not hypothetical in this repository: a host-timezone failure in
search_rank_grouping_test.dart is exactly why TZ=UTC is pinned on the local owner command in
the first place. Pinning UTC makes local runs reproducible; it also means nothing ever exercises
the boundaries where a UTC+14 or UTC−11 host puts a date on the other side of midnight.

Product invariants affected

none

How it was verified

actionlint clean on the edited workflow. backend/tests/unit/test_workflow_contracts.py
passes 30 tests, including the assertions this commit adds for the new matrix entries.
app/AGENTS.md is 11411 bytes, at budget and not over it.

Not claimed: that the second pass currently finds a defect. It is a guard, and if it goes red on
its first real run that is the point of it rather than a fault in it.

Tests

The workflow contract tests assert the added timezone entries, so the second pass cannot be
silently dropped from the matrix later.

Failure class (fixes)

Failure-Class: none

🤖 Generated with Claude Code

Review in cubic

Harness Z1 named these two TZ=... bash app/test.sh commands. The job
stays off the critical path and is expected red until PR #14313 merges.

Co-authored-by: Cursor <[email protected]>
Comment on lines +503 to +554
name: Dart Tests (Pacific/Kiritimati)
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.has_app_dart == 'true'
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.44.5
cache: true

- name: Cache build_runner state
uses: actions/cache@v6
with:
path: app/.dart_tool/build
key: ${{ runner.os }}-flutter-buildrunner-${{ hashFiles('app/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-flutter-buildrunner-${{ hashFiles('app/pubspec.lock') }}-
${{ runner.os }}-flutter-buildrunner-

- name: Resolve Flutter dependencies
working-directory: app
run: flutter pub get

- name: Prepare Flutter dev compile inputs
working-directory: app
run: |
cp lib/firebase_options_local.dart lib/firebase_options_dev.dart
cp lib/firebase_options_local.dart lib/firebase_options_prod.dart
{
echo "API_BASE_URL="
echo "USE_WEB_AUTH=true"
echo "USE_AUTH_CUSTOM_TOKEN=true"
echo "STAGING_API_URL="
} > .dev.env
: > .env

- name: Generate Flutter code
working-directory: app
run: dart run build_runner build --delete-conflicting-outputs

- name: Run Flutter tests under Pacific/Kiritimati
run: TZ=Pacific/Kiritimati bash app/test.sh

- name: Run Flutter tests under Pacific/Pago_Pago
if: always()
run: TZ=Pacific/Pago_Pago bash app/test.sh
# Conflicts:
#	.github/workflows/mobile-app-checks.yml
#	backend/tests/unit/test_workflow_contracts.py
#	scripts/dev-harness/MOBILE_VERIFY.md
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Merge origin/main completed — union resolutions in scripts/dev-harness/MOBILE_VERIFY.md, .github/workflows/mobile-app-checks.yml (main's ios-compile-check + branch's dart-tests-kiritimati, YAML validated), and backend/tests/unit/test_workflow_contracts.py. New head: 5186ea31428f3b1b2fe31509a875d7a9d70b4c78. CI re-running.

ConversationDetailProvider.conversationOrNull() validates
conversationLocalDayKey(startedAt ?? createdAt) against
conversationLocalDayKey(selectedDate), which defaults to the clock at
construction. The pinned DateTime(2026, 9, 18, 9) only matched when the
runner's calendar day agreed with UTC, so the ActionItemDetailWidget test
threw StateError('No valid conversation found') under UTC+14/UTC-13 and
UTC-11 runners.

Derive createdAt from DateTime.now() minus two hours and set
selectedDate from the same instant via conversationLocalDayKey, mirroring
what ConversationDetailPage.initState does; the day-key comparison is
now tautological under any timezone and wall-clock time. Use DateTime.now()
for the MemoriesPage fixture too.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Fixed the timezone-dependent test in bdcfc78: surface_timer_after_dispose_test.dart now derives the conversation's createdAt from DateTime.now() and sets ConversationDetailProvider.selectedDate from the same instant via conversationLocalDayKey (mirroring what ConversationDetailPage.initState does), so the day-key validation in conversationOrNull() holds under any timezone and wall-clock time instead of only when the runner's calendar day matches UTC — verified locally with TZ=Pacific/Kiritimati, TZ=Pacific/Pago_Pago, and the default TZ (all 6 tests pass).

@Git-on-my-level
Git-on-my-level merged commit 0784c82 into main Sep 18, 2026
57 checks passed
@Git-on-my-level
Git-on-my-level deleted the task/msd-ci-tz-far-east branch September 18, 2026 13:22
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