Prepare wanted-search tests and CI for normalization work#3383
Conversation
Align requests floor with vendored runtime
Add shared wanted-search fixture layer Cover wanted-search fixtures with focused tests
| done | ||
|
|
||
| exit ${exitcode} No newline at end of file | ||
| echo "UI is responsive." |
There was a problem hiding this comment.
functionality of this script should be the same, it was just not very robust before.
| @@ -1,102 +1,199 @@ | |||
| name: CI | |||
| # Touch this file to keep GitHub Actions registered on the default branch. | |||
There was a problem hiding this comment.
the CI overhaul is removable but it seemed prudent to be able to trigger the tests on CI so I gave the CI a full poke.
Caching, hardening against the recent GitHub actions exploits, etc.
it might be worth checking if the build tools should be replaced with faster ones, to save on CI compute time.
and I'd recommend requiring maintainer intervention before allowing CI to run on a PR
| @@ -1,57 +0,0 @@ | |||
| name: test_bazarr_execution | |||
There was a problem hiding this comment.
this was originally just renamed but I guess they diverged too far and git forgot
| @@ -0,0 +1,45 @@ | |||
| from sqlalchemy import select | |||
|
|
|||
| def test_movie_row_factory_inserts_rows( | |||
There was a problem hiding this comment.
we do not need to actually test these if we don't want to. but I needed an example to verify everything works in this pr.
| import subtitles.language_utils as language_utils | ||
|
|
||
|
|
||
| def test_parse_language_token_canonicalizes_case_and_flag_order(): |
There was a problem hiding this comment.
this and the language_utils.py are part of tests and bug fixes in the follow-on PRs. I pulled language utils out because it was a good self-contained example of a unit test to verify it runs etc.
also the follow-ons are kinda long and I'm trying not to have too-giant PRs.
The code that this replaces in the follow-on PRs was buggy enough to warrant this kind of "pull it out and refactor it" anyway, but if doing that made it harder to review I'm happy to help clean up however is convenient.
| requests>=2.33.0 | ||
| PyYAML>=6.0.3 | ||
| whichcraft>=0.6.1 | ||
| dogpile.cache>=1.5.0 |
There was a problem hiding this comment.
all of these were not specified but are used in the code, so I found my first bug directly in the harness I guess
There was a problem hiding this comment.
Those requirements are vendored in libs directory and listed in libs/version.txt
There was a problem hiding this comment.
I'm not super familiar with the current state of python tooling (sqlalchemy was pretty new when I last did high-perf python), but basically everything I tried didn't notice that.
I can back that out if you'd rather.
out of curiosity why is any of it vendored at all? feels like an unusual category of app to care about supply chain resistance that much.
|
noticing I have more stuff to pull into this branch from my other branches so it's draft for now |
(cherry picked from commit faa01ff) test: add mass-download fixture support test: complete mass-download fixture support test: add shared wanted database binder test: simplify wanted kind inference test: register wanted fixtures at top level test: drop unused transactional tmp fixture test: bind profile lookup to wanted test database test: bind profile list lookup to wanted fixtures
c22ff12 to
4de4f95
Compare
4de4f95 to
a012bd2
Compare
|
perf work is still coming, just haven't had time to get it into shape yet. mjc#1 if you want an early look. |
|
I moved a few more shared test/setup pieces into this PR so the follow-up wanted-search work can keep building on the same fixture layer. This adds:
The wanted-search behavior coverage that depends on this fixture layer now lives in the follow-up wanted/adaptive PR. |
1493a84 to
735e9cf
Compare
Summary
This PR adds the backend test foundation needed to safely change wanted-search behavior in follow-up PRs.
The main goal is to make wanted movie/episode searches, language parsing, profile handling, and database interactions testable with realistic rows instead of broad monkeypatching. Later PRs in this stack use this harness to harden existing paths and then move wanted-search state out of serialized columns.
What changed
Why this is separate
The wanted-search normalization work is easier to review if the reusable fixtures and baseline behavior tests land first. This PR intentionally keeps the storage model unchanged and focuses on testability, shared helpers, and CI reliability.
Follow-up PRs build on this layer for wanted search, mass download, provider/subtitles API paths, manual upload/download paths, sync/profile parsing, upgrade paths, and finally normalized wanted-search storage.
Tests
The added tests cover the shared language helper behavior, malformed wanted-language input, profile flag normalization, missing scene-name handling, transactional rollback isolation, and the wanted-search fixture layer itself. CI changes also exercise the backend test suite, frontend checks, and app smoke startup path from the consolidated workflow.