Decompose: End-to-end pipeline tests (SVG/DST, PES, raster, multi-stitch, pull compensation, machine constraints) #41
Labels
No labels
blocked:children
blocked:depends-101
blocked:depends-103
blocked:depends-104
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:preflight
bug
chore
feature-request
in-progress
lint-cleanup
needs-decompose
performance
quality
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/easystitch#41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tests for the actual EmbroideryPipeline.process() path
Context
The pytest suite (
tests/test_main.py) has 3 import-time smoke tests.None exercise
EmbroideryPipeline.process()end-to-end. This meansthe 5-stage pipeline, the new PES/EXP/JEF generators, the underlay
generator, the pull compensation, the path optimizer, and the thread
manager are all untested at the integration level.
Goal
Add
tests/test_pipeline_e2e.pywith a focused set of end-to-end teststhat lock the pipeline's externally-observable behavior. Each test is
a single, shippable unit of work that catches a real regression.
Decomposition
Six test scenarios, each a distinct phase. They can be developed and
shipped in any order, but the order below is the natural dependency
order (simpler tests first, machine constraints last).
P1: SVG → DST round trip
The core happy path. The original MVP that issue #2 (DST fallback
produces corrupt files) regressed. This test would have caught it.
Files:
tests/test_pipeline_e2e.py(test file)data/test_fixtures/simple_square.svg(a known SVG)Acceptance:
process(simple_square.svg, output_format="dst")produces a validDST file (header check: starts with the correct DST magic; stitch
count in the expected range; no truncated bytes).
Why first: if this fails, the basic pipeline is broken and all
other tests are noise. Land this first to establish the test infra
works.
P2: SVG → PES round trip
Issue #11 ("PES/EXP/JEF advertised but not implemented") was closed
as fixed. This test locks the fix.
Files:
tests/test_pipeline_e2e.pydata/test_fixtures/pes_header_check.py(helper for PES magicbyte validation)
Acceptance:
process(simple_square.svg, output_format="pes")produces a validPES file.
expected number of color changes.
Depends on: P1 (test infra).
P3: Raster → DST round trip
Tests the raster converter path (not the SVG path). The HTTP service
ingests rasters (PNG/JPG), so this is the path ThreadCraft exercises
most often.
Files:
tests/test_pipeline_e2e.pydata/test_fixtures/simple_square.png(a known raster)Acceptance:
process(simple_square.png, output_format="dst")produces a validDST.
the pipeline stages were exercised, per issue #35).
Depends on: P1, P2.
P4: Multi-stitch-type classification
A more complex SVG with multiple shape types should produce a stitch
run with the expected mix of satin, fill, and running stitches.
Files:
tests/test_pipeline_e2e.pydata/test_fixtures/mixed_stitches.svg(an SVG with at leastone satin shape, one fill region, and one running outline)
Acceptance:
satin,fill, andrunning(in any order, but each must be present).rectangle → satin, a large filled circle → fill, a thin line →
running).
Depends on: P1, P2, P3 (full pipeline exercise).
P5: Pull compensation toggle
Pull compensation (
src/post_processing/pull_compensation.py) is a2.1 KB module that adjusts stitch positions to account for fabric
pull. It's on by default and should produce different output when
toggled.
Files:
tests/test_pipeline_e2e.pyAcceptance:
two DST files that differ in at least one stitch position
(asserted by byte-comparing the stitch sections, not the headers).
Depends on: P1 (test infra).
P6: Machine profile constraint (PR-10)
End-to-end test that machine constraints are actually enforced. Uses
the PR-10 profile from issue #36.
Files:
tests/test_pipeline_e2e.pydata/test_fixtures/oversized.svg(a design that exceeds thePR-10 hoop)
Acceptance:
process(oversized.svg, machine_profile="brother_pr10")either:(a) rejects with a clear error, or (b) scales to fit, depending on
the pipeline's policy. The test asserts on whichever behavior the
pipeline implements; whichever it is, the test exists and pins the
behavior so it doesn't silently change.
PR-10 profile (10 threads), produces output with ≤ 10 distinct
colors.
Depends on: P1, issue #36 (PR-10 profile exists).
Cross-cutting
(raster output is sensitive to numpy/scipy version pins; the
pipeline is deterministic in shape but the bytes can shift).
pytest -m "not e2e"for fast iteration.exceeds that, the slowest test gets a
pytest.mark.slowand CIruns it in a separate job.
Tests don't exercise the actual EmbroideryPipeline.process() pathto Decompose: End-to-end pipeline tests (SVG/DST, PES, raster, multi-stitch, pull compensation, machine constraints)This issue has been decomposed into the following sub-issues:
src/post_processing/pull_compensation.py) is a 2.1 KB modulEach sub-issue has been labeled with
triage-approvedand is ready for queue routing.