mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Greptile's point on #592 was right and generalized further than the case it raised. The guard compared property names only, so it passed while the published contract disagreed with the endpoint about what those properties contain. Three wrong types, all pre-existing, all now caught by a test: StatusResponse.downloads was `int` while the handler has always sent the download manager's summary object -- the spec told a generated client to expect a number where it gets a dict. It is now DownloadsSummaryResponse, with the six fields get_summary() actually returns. StatusResponse.wrol_mode was `str`; wrol_mode_enabled() returns a bool. SettingsResponse.log_level was `str` while the handler sends a Python logging integer -- SettingsRequest.log_level already said int, and the frontend converts it numerically through fromApiLogLevel(). settingsFixture was carrying 'info', which that function maps to undefined, so every Settings test has rendered a blank log-level label where production shows "Info". The fixture now carries 20. This came from the same hand-written cypress body as cpu_percent did. statusFixture's nested downloads was also short a field: daily_limit_reached, one the API has always sent. /api/status returns an empty downloads object while the database is down, which it is for much of the suite, so the endpoint cannot vouch for its own nested shape -- get_summary() is the authority and is now compared directly. The type check runs against both endpoints rather than only the one the review named; that is how log_level surfaced. Comparison is limited to properties the spec gives a type for and the handler actually sent, since a null from an optional field says nothing about its declared type. Fixture values are still compared by name only: they are read from JS source rather than executed, so their types are not reliably available. Said plainly in the test rather than left to look like coverage. 1709 pytest, 986 jest, 46 e2e. One unrelated flake in one backend run (the known filename-formatting tests under -nauto), clean across two further full runs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| blobs | ||
| collections | ||
| files | ||
| scripts | ||
| static/extensions | ||
| test | ||
| __init__.py | ||
| api_utils.py | ||
| captions.py | ||
| cmd.py | ||
| common.py | ||
| config_api.py | ||
| config_schema.py | ||
| conftest.py | ||
| contexts.py | ||
| dates.py | ||
| db.py | ||
| db_bootstrap.py | ||
| downloader.py | ||
| errors.py | ||
| events.py | ||
| flags.py | ||
| fts.py | ||
| lang.py | ||
| log_levels.py | ||
| logging_extra.py | ||
| media_path.py | ||
| roland@learningselfreliance.com.gpg | ||
| root_api.py | ||
| schema.py | ||
| schema_ddl.py | ||
| scrape_downloader.py | ||
| switches.py | ||
| tags.py | ||
| test_media_path.py | ||
| upgrade.py | ||
| vars.py | ||
| version.py | ||
| version.txt | ||