Skip to content

Bound live tests to model data ranges from my-access - #81

Open
sam-watttime wants to merge 1 commit into
mainfrom
tests-bound-to-my-access
Open

sam-watttime wants to merge 1 commit into
mainfrom
tests-bound-to-my-access

Conversation

@sam-watttime

Copy link
Copy Markdown
Contributor

What

Live tests now read each model's data_start and data_end from /v3/my-access and request only windows the serving model covers. Fixed dates such as 2025-01-01 survive only in the offline date-parsing tests and the mocked 403 test.

Why

Two open API changes (WattTime/watttime-apiv3-historical#285, WattTime/watttime-apiv3-forecast#385) return a 400 START_END_OUTSIDE_BOUNDS for a request wholly outside a model's data range. Because the client raises on any failed chunk, a hard-coded date older than a newly promoted default model fails the whole test.

How

A cached helper, model_window, reads my-access once per run and returns a day-aligned UTC window inside every model still serving the endpoint, a set that always includes the API's default. test_multi_model_range now straddles data_start within one 30-day chunk and filters my-access to v3/historical, so no chunk falls wholly before data_start and a forecast model cannot pass for the newest historical one.

🤖 Generated with Claude Code

Live tests used fixed dates (2025-01-01 and similar). The v3 APIs now
reject a window wholly outside the serving model's data_start/data_end
with a 400, and the client raises on any failed chunk. A cached
model_window helper reads /v3/my-access once per run and returns a
window inside every model still serving the endpoint.

test_multi_model_range now straddles data_start within one 30-day chunk
and filters my-access to v3/historical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sam-watttime
sam-watttime requested a review from xginn8 as a code owner November 12, 2026 23:39

@xginn8 xginn8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea to clean this up

This branch has not been deployed

No deployments
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