You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
End-to-end integration tests that exercise the real flapi binary in
both filesystem and bundled modes — the same nine behaviours the
spike's roundtrip.sh proves.
Scope
New test/integration/test_self_packaging.py (pytest, not tavern —
needs cross-process exec and per-test cwd manipulation). Reuses the
existing test/integration/conftest.py fixtures for server lifecycle.
The nine behaviours
Filesystem mode serves endpoints. Baseline.
flapi pack produces a new binary.
Bundled binary, run from a clean cwd, serves the same
endpoints (no source tree present).
flapi info reports the EOCD offset + entry list.
Self-hosting: the bundled binary can pack a new bundled
binary.
Re-pack idempotence: binary size stable across N packs.
Truncate trailing 1 KiB of bundle → server starts in
filesystem mode without crashing (the fallback safety net).
flapi unpack dumps the archive.
DuckDB read_csv('embed://...') in a real endpoint template
returns expected rows end-to-end.
Red criteria
The test file lands first, expected to FAIL on the current main
(no pack subcommand exists yet). It turns green only once #1–#5
land.
Green criteria
All nine pass on Linux x86_64 (the developer machine).
Test runtime under 60 seconds for the full file.
No flakiness across 10 consecutive runs.
Existing tavern tests untouched.
Files
New: test/integration/test_self_packaging.py
Possibly new: a small fixture config tree under test/integration/fixtures/self_packaging/ (or reuse examples/).
Activity
test: end-to-end integration tests for self-packaging round-trip