Add integration tests verifying photo-to-embroidery with max_colors #105

Closed
opened 2026-07-29 16:41:54 +00:00 by Mark · 1 comment
Owner

Goal

Add integration tests that verify photo-to-embroidery works correctly with the max_colors setting, testing the full pipeline from API request through quantization to stitch output.

Approach

  1. Add a test photo fixture (or generate one programmatically) with many colors.
  2. Write tests that:
    • Submit the photo with max_colors=4 and verify ≤4 distinct colors in output
    • Submit the photo with max_colors=8 and verify ≤8 distinct colors
    • Verify the output PES is valid and stitch count is reasonable
    • Test that existing geometric/graphic inputs still work (no regression)

Acceptance Criteria

  • test_photo_max_colors_4 — photo with max_colors=4 produces ≤4 colors
  • test_photo_max_colors_8 — photo with max_colors=8 produces ≤8 colors
  • test_geometric_max_colors_still_works — graphic inputs unaffected
  • All existing tests pass
  • Test photo fixture is committed (or generated in test setup)

Files touched

  • tests/test_settings_threading.py (extend)

Decomposed from Mark/easystitch#101

## Goal Add integration tests that verify photo-to-embroidery works correctly with the `max_colors` setting, testing the full pipeline from API request through quantization to stitch output. ## Approach 1. Add a test photo fixture (or generate one programmatically) with many colors. 2. Write tests that: - Submit the photo with `max_colors=4` and verify ≤4 distinct colors in output - Submit the photo with `max_colors=8` and verify ≤8 distinct colors - Verify the output PES is valid and stitch count is reasonable - Test that existing geometric/graphic inputs still work (no regression) ## Acceptance Criteria - [ ] `test_photo_max_colors_4` — photo with max_colors=4 produces ≤4 colors - [ ] `test_photo_max_colors_8` — photo with max_colors=8 produces ≤8 colors - [ ] `test_geometric_max_colors_still_works` — graphic inputs unaffected - [ ] All existing tests pass - [ ] Test photo fixture is committed (or generated in test setup) ## Files touched - `tests/test_settings_threading.py` (extend) --- _Decomposed from [Mark/easystitch#101](https://forgejo.tail018ac4.ts.net/Mark/easystitch/issues/101)_
Author
Owner

Audit-trail backfill (kanban card t_1024e2b0, fixit board):

This issue was closed at 04:42:20Z while the fix commit b6426a2 sat only on branch lint-cleanup/easystitch-111 (open PR #113) — no audit trail recorded where the tests lived. That gap is now closed:

  • PR #113 was merged to origin/main on 2026-07-30 (merge commit 5baf0e5).
  • b6426a2 ("test(#105): cover photo max_colors pipeline") is now an ancestor of origin/main.
  • Verified on a main checkout: pytest -k "photo_max_colors or geometric_max_colors" collects 3 tests — test_photo_max_colors_4, test_photo_max_colors_8, test_geometric_max_colors_still_works — and all 3 pass (tests/test_settings_threading.py).

Acceptance criterion (integration tests for photo-to-embroidery with max_colors on main) is met.

Audit-trail backfill (kanban card t_1024e2b0, fixit board): This issue was closed at 04:42:20Z while the fix commit `b6426a2` sat only on branch `lint-cleanup/easystitch-111` (open PR #113) — no audit trail recorded where the tests lived. That gap is now closed: - PR #113 was merged to `origin/main` on 2026-07-30 (merge commit `5baf0e5`). - `b6426a2` ("test(#105): cover photo max_colors pipeline") is now an ancestor of `origin/main`. - Verified on a main checkout: `pytest -k "photo_max_colors or geometric_max_colors"` collects 3 tests — `test_photo_max_colors_4`, `test_photo_max_colors_8`, `test_geometric_max_colors_still_works` — and all 3 pass (tests/test_settings_threading.py). Acceptance criterion (integration tests for photo-to-embroidery with max_colors on main) is met.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/easystitch#105
No description provided.