Skip to content

CI: test PRs; fix midnight-flaky forecastLabel test - #15

Merged
bgrozev merged 2 commits into
mainfrom
fix/pr-ci-and-flaky-test-time
Aug 15, 2026
Merged

CI: test PRs; fix midnight-flaky forecastLabel test#15
bgrozev merged 2 commits into
mainfrom
fix/pr-ci-and-flaky-test-time

Conversation

@bgrozev

@bgrozev bgrozev commented Aug 15, 2026

Copy link
Copy Markdown
Owner

What

  • static.yml now runs lint + tests on pull_request against main, not just on push. PR Next-generation architecture: TypeScript, Vite, modes, and the redesigned UI #14 merged with zero checks (mergeStateStatus: CLEAN, empty statusCheckRollup) because nothing was wired to run against the branch — the break only surfaced in the post-merge deploy job. Split into a test job (push + pull_request) and a deploy job (needs: test, push-only), so a red test run blocks merge instead of blocking deploy after the fact.
  • Pinned every action in the file to its commit SHA (tag as comment), per repo convention — the ones already in the file were still on version tags.
  • Fixes the actual break: forecastLabel's test fixtures (hoursFromNow(1), hoursFromNow(3)) used the real wall clock with no guard against crossing midnight. Near UTC midnight the "still today" fixtures rolled into tomorrow and forecastLabel correctly added a weekday the assertions didn't expect. Reproduced exactly by pinning system time to 23:30 UTC (matches the CI failure); fixed by pinning the whole describe('forecastLabel') block to noon UTC via vi.useFakeTimers(), so it can't roll over regardless of when/where the suite runs.

Testing

  • TZ=UTC npx vitest run — 2655/2655 pass.
  • npx eslint src/components/WindsComponent.test.tsx — clean.
  • This PR's own test job is the live check that the fix works.

hoursFromNow(1)/(3) used the real wall clock, so the "still today"
cases intermittently rolled into the next calendar day (UTC, as on the
GH Actions runner) and forecastLabel correctly added a weekday the
assertions didn't expect. Failed the post-merge deploy on flip.

Reproduced by pinning system time to 23:30 UTC (matches the CI failure
exactly), fixed by pinning it to noon UTC instead so the fixtures can't
cross midnight regardless of when or where the suite runs.
PR #14 merged with mergeStateStatus CLEAN and zero checks: static.yml
only triggered on push to main, so nothing ran against the PR branch
itself. The break it introduced (forecastLabel test fixtures crossing
a UTC midnight) was caught by the post-merge deploy job instead,
after landing on main.

Split into a test job (push + pull_request, no deploy secrets needed)
and a deploy job (needs: test, push-only) so a PR can't merge past a
red test run again. Pinned every action in the file to its commit SHA
while touching it, per repo convention.
@bgrozev
bgrozev merged commit 8382797 into main Aug 15, 2026
2 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.

1 participant