mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #209] [MERGED] test: check test data against the API schema instead of golden files #207
Labels
No labels
api-drift
bug
ci
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Glitchy-Sheep/boosty-downloader#207
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/209
Author: @Glitchy-Sheep
Created: 9/23/2026
Status: ✅ Merged
Merged: 9/23/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:test/schema-instead-of-goldens📝 Commits (4)
dc2647dtest: build the test post in code instead of a captured fixturec784b02test: check the synthetic post against the observed API schema6281862test: check the page and console views by their lines, drop the golden filesbc4b594docs: describe test data without golden files📊 Changes
29 files changed (+946 additions, -974 deletions)
View changed files
📝
docs/development/02-testing.md(+7 -7)📝
pyproject.toml(+3 -1)📝
test/ABOUT_TESTING.md(+1 -1)📝
test/e2e/download_flow_test.py(+17 -12)➖
test/fixtures/rendered_post.html(+0 -355)➖
test/fixtures/single_post.json(+0 -275)➖
test/fixtures/single_post_domain.json(+0 -96)➖
test/fixtures/views/blog_overview_empty.txt(+0 -3)➖
test/fixtures/views/blog_overview_locked.txt(+0 -18)➖
test/fixtures/views/blog_overview_own.txt(+0 -15)➖
test/fixtures/views/blog_overview_posts.txt(+0 -29)➖
test/fixtures/views/download_plan_full.txt(+0 -17)➖
test/fixtures/views/download_plan_nothing.txt(+0 -10)➖
test/fixtures/views/run_statistics_full.txt(+0 -13)➖
test/fixtures/views/run_statistics_nothing.txt(+0 -4)➕
test/support/__init__.py(+0 -0)➕
test/support/synthetic_post.py(+196 -0)📝
test/unit/boosty_api/post_url_test.py(+1 -1)📝
test/unit/cli/views/blog_overview_test.py(+57 -9)📝
test/unit/cli/views/conftest.py(+19 -16)...and 9 more files
📄 Description
📝 Summary
The test tree no longer stores data captured from the live API or golden files. Test data is built in code and checked against the observed API schema from #203.
🔧 What changes
test/support/synthetic_post.pybuilds a post with every chunk kind in code. It replaces the capturedsingle_post.json; the e2e run and the mapper test use it.single_post_domain.jsonsnapshot.test/unit/synthetic_data/synthetic_post_schema_test.pyvalidates the synthetic post againstdocs/api/boosty-api.yaml: every key must exist in the schema with the observed type and values. Keys the schema calls required may be missing, the post carries only what the client reads. The unknown chunk must stay unknown to the schema.rendered_post.htmlbyte by byte.test/fixtures/views/are gone.UPDATE_GOLDENis gone. pytest getstest/on its path, sosupportimports work when one folder runs alone.jsonschema.💡 Why
A captured post can leak real data and freezes whatever Boosty sent on one day. Golden files break on every harmless layout change and get regenerated without a real review. The schema gives one source of truth for what Boosty sends: when it changes, the schema is regenerated and the synthetic post must follow.
🧪 Tests
task checkis clean: ruff, pyright strict, import-linter.⏭️ Next
✅ Checklist
--helpand README if neededdocs/if the download flow or dev process changed## Unreleasedin CHANGELOG.md (or theci/skip-changeloglabel if not user-facing)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.