Skip to content

Add end-to-end pipeline tests; fix compaction in manage.py#8

Merged
FANNG1 merged 3 commits into
mainfrom
pipeline-e2e-tests
Jul 6, 2026
Merged

Add end-to-end pipeline tests; fix compaction in manage.py#8
FANNG1 merged 3 commits into
mainfrom
pipeline-e2e-tests

Conversation

@FANNG1

@FANNG1 FANNG1 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds automated end-to-end regression for the pipeline (previously only verified manually against MinIO), plus quick-win unit tests. All tests run fully local — no MinIO required (daft.functions.download handles local paths, failures → null).

28 → 55 test cases, line coverage 39% → 55%.

New tests

  • tests/image/test_pipeline_e2e.py — the real Stage 1→2→3→4→5 chain in a temp dir: synthetic sharp/blurred portraits + no-face image + corrupt bytes + missing manifest path. Asserts one row per manifest entry, status breakdown (ok×3 / decode_failed / download_failed), verdicts (null for failed rows, not false), blob v2 validation, blob presence matching status, ZONEMAP index, scalar/SQL queries on the real pipeline output, and date-range deletion. Skipped when the SCRFD model pack is absent (CI-safe).
  • tests/workflow/test_index_manage.py — media-agnostic stages on a 300-row local table: IVF_FLAT index (small-table params), missing-embedding-column error, ZONEMAP, delete_by_date before/after/window/no-bound.
  • tests/storage/, tests/audio/test_prompt.pyread_manifest (parquet/jsonl/csv/unsupported), lance_storage_options, validate_blob_v2 failure path, prompt builder enums.

Bugs found and fixed (workflow/manage.py)

The e2e tests immediately exposed that Stage 5 compaction had never actually worked:

  1. lance_ray.compact_files crashes unless compaction_options is an explicit dict — lance_ray 0.4.x passes its None default straight into Compaction.plan(), which rejects it.
  2. Compaction of blob v2 tables (i.e. both asset tables) fails inside lance's decoder with current versions, regardless of engine (reproduced with plain pylance too). Compaction is now best-effort with a [warn] so deletion still succeeds; documented in README's known limitations.

Coverage notes

Pipeline glue went from 0–39% to: image/workflow/analyze 81%, image/workflow/ingest 80%, workflow/manage 78%, workflow/index 54%, storage/io 93%, storage/blob 100%, audio/prompt 100%. image/udfs.py still reports 26% because @daft.cls UDF bodies execute in Daft worker processes that coverage doesn't instrument — the e2e chain does execute them. Audio ASR/embedding (model-download-dependent) remain out of scope, to be covered when the audio side next changes.

New tests (28 → 55 cases, coverage 39% → 55%), all local, no MinIO:

- tests/image/test_pipeline_e2e.py: real Stage 1→2→3→4→5 chain on a
  temp dir — synthetic face/blurred/no-face images plus corrupt bytes
  and a missing path; asserts statuses, verdicts (null for failures),
  blob v2 storage, time index, queries, and delete. Skipped when the
  SCRFD model pack is absent.
- tests/workflow/test_index_manage.py: ZONEMAP + IVF_FLAT index
  creation, missing-column error, delete_by_date bounds/window.
- tests/storage/, tests/audio/test_prompt.py: read_manifest formats,
  lance_storage_options, validate_blob_v2 failure path, prompt builder.

The e2e tests exposed two real defects in workflow/manage.py, fixed
here:

- lance_ray 0.4.x compact_files crashes unless compaction_options is
  an explicit dict (its None default is rejected downstream).
- Compaction of blob v2 tables fails inside lance's decoder with
  current versions regardless of engine; compaction is now best-effort
  with a warning so deletion still succeeds. Documented in README.
fanng added 2 commits July 6, 2026 16:02
uv-based setup with dependency caching; SCRFD-dependent tests skip
automatically when the model pack is absent, so CI needs no model
download.
Review found test_build_embedding_index_small_table failing in
environments with a pre-existing Ray cluster: Ray's default init joins
it, and the foreign workers cannot deserialize this venv's lance_ray
functions. Two-layer fix:

- local_ray fixture forces a fresh local cluster from this venv
  (clears RAY_ADDRESS, shuts down any existing context).
- The test is marked `ray` and excluded from the default run via
  pyproject addopts; run explicitly with `pytest -m ray`. The
  delete_by_date tests stay in the default suite — compaction is
  best-effort, so they pass even where Ray is unusable.

The CI workflow (cherry-picked from PR #9) runs the default suite as a
blocking step and `-m ray` as a non-blocking one.
@FANNG1 FANNG1 merged commit 0c3a6f2 into main Jul 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant