Skip to content

Self-packaging #6: Integration tests — round-trip parity (spike behaviours 1-9) #46

Closed

Description

@jrosskopf

Part of epic #40. Depends on #1–#5.

Goal

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

  1. Filesystem mode serves endpoints. Baseline.
  2. flapi pack produces a new binary.
  3. Bundled binary, run from a clean cwd, serves the same
    endpoints (no source tree present).
  4. flapi info reports the EOCD offset + entry list.
  5. Self-hosting: the bundled binary can pack a new bundled
    binary.
  6. Re-pack idempotence: binary size stable across N packs.
  7. Truncate trailing 1 KiB of bundle → server starts in
    filesystem mode without crashing (the fallback safety net).
  8. flapi unpack dumps the archive.
  9. 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/).

Notes

Activity

  1. added
    enhancement
    on May 21, 2026
  2. added a commit that references this issue on May 22, 2026
    d8f5ca1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions