Skip to content

test: add a weekly canary against the live feeds - #43

Merged
timmaurice merged 1 commit into
masterfrom
c078/canary
Nov 13, 2026
Merged

timmaurice merged 1 commit into
masterfrom
c078/canary

Conversation

@timmaurice

Copy link
Copy Markdown
Owner

Summary

The suite parses the eight feeds as recorded in tests/data, so a publisher changing its feed (an image that stops arriving, a renamed title, a moved URL that now answers with an HTML page) leaves it green. This adds the check at the real seam, modelled on skyline-webcams and bergfex's live check.

  • scripts/canary.py reads every feed live with the same sensor configuration and fails when no entry is found, or when a field the recording had in every entry (as feedparser reads it and as the sensor exposes it, plus channel keys) is in fewer than half of the live entries. Exit 1 = format changed, 2 = a feed could not be fetched (says nothing about the format).
  • .github/workflows/canary.yml runs it weekly (Mondays 06:23 UTC) and on manual dispatch; the result goes into the job summary. The job fails on 1 and 2.
  • scripts/refresh_fixtures.py [names] [--check] re-records feeds byte for byte (and sets download_date) after the parser has been adjusted. --check only reports.
  • tests/test_canary.py pins the canary's reading on the recordings (a recording is never different from itself; renamed titles/links and an HTML page are detected), so the canary cannot rot.
  • pyproject.toml: scripts added to pytest pythonpath.

The existing recordings were kept as they are (they already are real upstream payloads, with a download script); no fixture was rewritten. No integration code changed.

Tests

  • pytest tests: 346 passed (298 before, 48 new).
  • python scripts/canary.py against the live feeds: all 8 feeds read, exit 0. refresh_fixtures.py --check run as well.
  • ruff (new files) and black clean.

Board card c078.

The suite parses the eight feeds as they were recorded in tests/data, so a
publisher changing its feed (an image that stops arriving, a renamed title,
a moved URL that answers with an HTML page) left it green.

scripts/canary.py now reads every feed live with the same sensor
configuration and fails when no entry is found or when a field the recording
had in every entry (as feedparser reads it and as the sensor exposes it) is
in fewer than half the live entries. Exit 1 means the format changed, 2 that a
feed could not be fetched. .github/workflows/canary.yml runs it on Mondays and
writes the result into the job summary.

scripts/refresh_fixtures.py re-records the feeds byte for byte once the
parser is adjusted (--check only reports). tests/test_canary.py pins the
canary's reading on the recordings so it cannot rot unnoticed.
@timmaurice
timmaurice merged commit 818fd6f into master Nov 13, 2026
8 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