Add test suite (box rules, Python, QML against a fake Jellyfin server) and local preview jobs
- freebox-jellyfin test: box-only rules (ES5, QtQuick 2.5, qmldir, singletons), tooling unit tests, qmltestrunner on tests/qml against fake_server.py - freebox-jellyfin fake-server and preview --fake-server - package enforces the box rules; CI runs the tests - JetBrains run configs: Local Preview, Local Preview (faux serveur), Tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d0d019ac1e
commit
1b2acae316
19 files changed
+2097
-17
No files matched your search
@@ -9,24 +9,27 @@ A Jellyfin client for the Freebox Player (Revolution), written in pure QML (no C
|
||||
## Layout
|
||||
|
||||
- `app/` — the application itself, the only directory served to / packaged for the Player (`manifest.json`, `Jellyfin.qml`, `icon.png`, `Components/`, `Core/`, `Shared/`, `Views/`, plus the QtCreator project `Jellyfin.fbxproject`). Paths in the Architecture section are relative to `app/`.
|
||||
- `src/freebox_jellyfin/` — Python dev tooling; `tools/preview.qml` — desktop preview wrapper; `dist/`, `deploy.log` — generated at the repo root.
|
||||
- `src/freebox_jellyfin/` — Python dev tooling; `tests/` — QML tests (`tests/qml/`) and tooling tests (`tests/python/`), never packaged; `tools/preview.qml` — desktop preview wrapper; `dist/`, `deploy.log` — generated at the repo root.
|
||||
|
||||
## Build / run
|
||||
|
||||
There is no build system and no test suite: `freebox-jellyfin check` is the only automated guard; beyond that, verify on the box with `deploy`.
|
||||
There is no build system. Automated guards: `freebox-jellyfin test` and `check` (both in CI); what they can't cover (real playback, the box's Qt 5.5 runtime, persistence) is verified on the box with `deploy`.
|
||||
|
||||
**Local preview on the PC** (no Freebox needed): `fbx.application` from [libfbxqml](https://github.com/fbx/libfbxqml) is pure QML (a fullscreen `Window` scaled to a 720p virtual height), so the app runs with Qt 5's `qmlscene`.
|
||||
|
||||
- Prerequisites: `sudo apt install qmlscene qml-module-qtmultimedia qtdeclarative5-dev-tools`, and libfbxqml cloned next to the repo (`../libfbxqml`, override with `LIBFBXQML=`).
|
||||
- Dev tooling is the Python package `freebox_jellyfin` (`src/freebox_jellyfin/`, uv project, Python 3.14, stdlib only): `uv sync`, then `uv run freebox-jellyfin <preview|check|package|deploy>` (also `python -m freebox_jellyfin`).
|
||||
- `uv run freebox-jellyfin preview` — 1280×720 window via `tools/preview.qml`; `--fullscreen` runs `app/Jellyfin.qml` as the box would.
|
||||
- Prerequisites: `sudo apt install qmlscene qml-module-qtmultimedia qtdeclarative5-dev-tools qml-module-qttest`, and libfbxqml cloned next to the repo (`../libfbxqml`, override with `LIBFBXQML=`).
|
||||
- Dev tooling is the Python package `freebox_jellyfin` (`src/freebox_jellyfin/`, uv project, Python 3.14, stdlib only): `uv sync`, then `uv run freebox-jellyfin <preview|check|test|fake-server|package|deploy>` (also `python -m freebox_jellyfin`).
|
||||
- `uv run freebox-jellyfin preview` — 1280×720 window via `tools/preview.qml`; `--fullscreen` runs `app/Jellyfin.qml` as the box would; `--fake-server` also starts the fake Jellyfin below on `127.0.0.1:8096` for the session. JetBrains run configs in `.run/`: Local Preview, Local Preview (faux serveur), Tests, Local Deploy.
|
||||
- `QT_QPA_PLATFORM=offscreen uv run freebox-jellyfin preview` — headless run, useful to catch QML warnings.
|
||||
- HTTPS on the PC works with the system `qmlscene` (Qt 5.15 + OpenSSL 3). PyQt5 wheels from pip bundle a Qt built for OpenSSL 1.x and cannot do TLS here.
|
||||
- Lint: `cd app && qmllint Jellyfin.qml Components/*.qml Core/*.qml Shared/*.qml Views/*.qml`
|
||||
- `uv run freebox-jellyfin test` — three stages, stops at the first failure: (1) `boxrules.py`, the box-only rules the desktop doesn't catch (ES5 syntax, QtQuick ≤ 2.5, no QtQuick.Controls, `qmldir` completeness, singleton cycles, no `import "."`; also enforced by `package`); (2) `tests/python/` (unittest); (3) `qmltestrunner` on `tests/qml/tst_*.qml`, offscreen, against `fake_server.py`. Single file: `--qml tst_session.qml`; single function: `freebox-jellyfin test Session::test_logout` (TestCase `name` + function).
|
||||
- **QML tests**: `tst_helpers` (Format/Remote/DeviceProfile), `tst_session` (Session API against the fake server: probing, auth header, catalog, PlaybackInfo, Quick Connect, `cancel()`, errors/timeouts), `tst_player` (PlayerView reporting rules, with a fake session and `VideoSurface` driven by hand), `tst_flow` (remote-control journeys through Navigator + real views + real Session). Extend `JellyfinTestCase.qml` (helpers: `waitCallback`, `requests`, `mock`, `resetServer`, `findChild`); the fake server's URL comes from the generated `TestEnv` module (`Env.baseUrl/host/port`). Tests run on Qt 5.15, so `tests/` is exempt from the ES5 rule. **A `TestCase` is invisible and `KeyNavigation` skips invisible items**: put UI under a visible root `Item` next to the `TestCase`, not inside it. Set state in the order `VideoSurface._poll()` does (position, then `playerState`).
|
||||
- `uv run freebox-jellyfin fake-server [--port 8096]` — the same fake Jellyfin (`fake_server.py`: users alice/secret and bob without password, Films with 25 movies incl. direct/transcode/unplayable ones, a series with 2 seasons, Quick Connect code 123456) for working in `preview` without a real server: add server `127.0.0.1`, port `8096`. Control endpoints for tests: `/__reset`, `/__requests`, `/__mock`, `/__quickconnect/authorize`.
|
||||
- `uv run freebox-jellyfin check` — serves `app/` over HTTP and loads it with `qmlscene` (offscreen, software renderer) like the box does; fails on any Qt warning not coming from libfbxqml. This reproduces the box's HTTP loading mode, which behaves differently from local files (see constraints below): run it after touching imports, `qmldir` files or singletons.
|
||||
- The desktop has Qt 5.15 while the box targets QtQuick 2.5: code that runs locally can still use APIs too new for the box.
|
||||
|
||||
**CI** (`.gitea/workflows/ci.yml`, Gitea Actions on the `ubuntu-latest` runner image): installs uv (pinned 0.12.9, which fetches Python 3.14) and on every push/PR runs `uv run --locked freebox-jellyfin package` (manifest + qmllint + archive) and `… check`; package uploaded as artifact (`upload-artifact@v3`/`download-artifact@v3`: v4 only works on recent Gitea versions). On tag `vX.Y.Z` matching `manifest.json` `version`, creates a Gitea release with the package attached (API calls with the job's `GITHUB_TOKEN`).
|
||||
**CI** (`.gitea/workflows/ci.yml`, Gitea Actions on the `ubuntu-latest` runner image): installs uv (pinned 0.12.9, which fetches Python 3.14) and on every push/PR runs `uv run --locked freebox-jellyfin test`, `… package` (manifest + box rules + qmllint + archive) and `… check`; package uploaded as artifact (`upload-artifact@v3`/`download-artifact@v3`: v4 only works on recent Gitea versions). On tag `vX.Y.Z` matching `manifest.json` `version`, creates a Gitea release with the package attached (API calls with the job's `GITHUB_TOKEN`).
|
||||
|
||||
**Releasing**: bump `version` in `app/manifest.json` **and** `clientVersion` in `app/Core/Session.qml` (`package` refuses to build if they differ), then push a `vX.Y.Z` tag.
|
||||
|
||||
|
||||
Reference in new issue
Block a user