test(automation): cover BiometricsSignalReader and #664 codecov gaps#666
test(automation): cover BiometricsSignalReader and #664 codecov gaps#666ng wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 13 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Why
The #664 release report flagged 93.04% patch coverage with 72 missing lines. The dominant gap was
src/automation/signals.biometrics.tsat 10.20% —BiometricsSignalReader.read()(lines 45–115) had no tests at all; the existing test file only coveredreduceCap.What
Test-only changes, no production code touched:
signals.biometrics.test.ts— newBiometricsSignalReadersuite using the project's hoisted drizzle-chain mock pattern (same asambientSensor.test.ts). Covers: fresh vitals/movement per side with null-column omission, bed-surface zone mean/spread/gradient (full vs single-zone side), centidegree→°F and centipercent→% conversion, water temp, ambient light, cap matrix reducers for both capSense2 array and Pod 3 scalar shapes, per-source staleness windows (5 min vitals, 15 min env, 30 s cap), and the warn-and-degrade path when the DB throws. 10.20% → 100% lines.signals.test.ts—CompositeSignalReadermerge/override semantics (was uncovered, lines 107–112) and thebinaryexpression case incollectWindowKeysFromExpr.scheduleTime.test.ts— flagged branch partials: NaN clock / unparseable window bounds inisInWindow, end-side NaN incalcDuration, missing-minute and NaN-hour fallbacks informatTime12h, and the ≥4 am same-day branch ofgetCurrentDayForTimezone.Coverage after (files touched by this PR):
signals.biometrics.tssignals.tsscheduleTime.tsNot addressed: the report's remaining 1–4-line partials in
backtest.ts,engine.ts,builderModel.ts,instance.ts,dacTransport.ts,ThermalTrendChart.tsx, anddb/schema.ts— each is a single guard or JSX branch; diminishing returns versus the 50+ lines closed here. Remaining partials inscheduleTime.tsare the?? '0'Intl fallbacks, unreachable with realformatToPartsoutput.Test plan
vitest runon the three test files: 36 tests, all passing.--coverage.includeon the three source files (table above).🛏️ Beam this PR onto a sleepypod ✨
Pick the snippet that matches your pod. Already-installed pods can't use the curl bootstraps below — sleepypod's egress firewall DROPs github.com, and the script that knows how to unblock WAN is the very file curl is trying to fetch. Use
sp-updateinstead; it's on disk and opens WAN as its first step.🔄 Already on a sleepypod (most common — review a PR on a running pod):
🚀 Fresh pod / first install — bootstraps from GitHub, rebuilds every push:
curl -fsSL https://raw.githubusercontent.com/sleepypod/core/test/664-codecov-followup/scripts/install \ | sudo bash -s -- --branch test/664-codecov-followup🎯 Pin to this exact build (run 29175257915 ·
407a04c) — fresh-pod path, locked to one CI artifact for reproducible review:🧊 Artifact:
sleepypod-core· self-destructs in 30 days 💥