CI: test PRs; fix midnight-flaky forecastLabel test - #15
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
static.ymlnow runs lint + tests onpull_requestagainstmain, not just onpush. PR Next-generation architecture: TypeScript, Vite, modes, and the redesigned UI #14 merged with zero checks (mergeStateStatus: CLEAN, emptystatusCheckRollup) because nothing was wired to run against the branch — the break only surfaced in the post-merge deploy job. Split into atestjob (push + pull_request) and adeployjob (needs: test, push-only), so a red test run blocks merge instead of blocking deploy after the fact.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 andforecastLabelcorrectly 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 wholedescribe('forecastLabel')block to noon UTC viavi.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.testjob is the live check that the fix works.