Skip to content

test: generate_alphas/organize_clips/scan_clips coverage, opencv guard, DeepWiki link#118

Closed
shezmic wants to merge 2 commits intonikopueringer:mainfrom
shezmic:test/batch-e
Closed

test: generate_alphas/organize_clips/scan_clips coverage, opencv guard, DeepWiki link#118
shezmic wants to merge 2 commits intonikopueringer:mainfrom
shezmic:test/batch-e

Conversation

@shezmic
Copy link
Contributor

@shezmic shezmic commented Mar 10, 2026

What changed

  • tests/test_clip_manager.py — adds 13 new tests across three new classes (closes Testing: Add coverage for run_videomama, generate_alphas, organize_clips, scan_clips #19):
    • TestGenerateAlphas (4 tests): verifies GVM is skipped when alpha already exists, triggers process_sequence for missing-alpha clips, handles ImportError gracefully, and confirms generated files are renamed to match input stems.
    • TestOrganizeClips (5 tests): missing-dir warning, loose-video move + hint-dir creation, IgnoredClips/Output skip, and subdir dispatch.
    • TestScanClips (4 tests): CLIPS_DIR auto-creation, valid clip discovery, frame-count mismatch exclusion, and hidden/underscore dir filtering.
  • pyproject.toml — adds [tool.uv] constraint-dependencies guard so any future transitive dep that pulls in opencv-python-headless fails resolution explicitly instead of silently corrupting the environment (closes Add uv override to prevent opencv-python / opencv-python-headless conflict #17).
  • README.md — adds DeepWiki link in the Advanced Usage section (closes Add DeepWiki link in Readme #85).

Why

How to verify

uv sync --group dev
uv run pytest tests/test_clip_manager.py -v   # 50 passed
uv run pytest -q                               # 208 passed, 2 skipped
uv run ruff check tests/test_clip_manager.py pyproject.toml

🤖 Generated with Claude Code

shezmic and others added 2 commits March 10, 2026 08:10
…pWiki link and opencv conflict guard

- tests/test_clip_manager.py: add TestGenerateAlphas (4 tests), TestOrganizeClips (5 tests),
  TestScanClips (4 tests) — closes nikopueringer#19.  All 208 tests pass.
- pyproject.toml: add [tool.uv] constraint-dependencies to prevent future transitive
  deps from silently pulling in opencv-python-headless — closes nikopueringer#17.
- README.md: add DeepWiki link in Advanced Usage section — closes nikopueringer#85.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adding [tool.uv] constraint-dependencies to pyproject.toml invalidated
the lock file hash. Only the [manifest] constraints line changes —
no package resolutions are affected (opencv-python-headless is not
currently pulled in by any dep).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Mogi83
Copy link
Contributor

Mogi83 commented Mar 10, 2026

Hey! I see you've bundled #19, #17, and #85 here. I actually have a focused PR for Issue #19, being PR #111 but will look over the tests made for #19 coverage. To keep the git history clean and simplify debugging if a regression occurs, let's keep these changes in individual, atomic PRs ideally.

As far as #17 goes an attempt has already been made in PR #62 if you can explain the AI code it will be considered!

@shezmic
Copy link
Contributor Author

shezmic commented Mar 10, 2026

Thanks for the detailed feedback @Mogi83 — completely agree on atomic PRs. I'll close this and open separate ones.

On #19: I see PR #111 already provides comprehensive coverage (32 tests, 51% clip_manager.py coverage). Happy to defer fully — if any of the 13 tests here are useful to pull in, feel free; otherwise I'll drop them.

On #17 vs PR #62: The difference between the two approaches:

  • PR Fix #17: Override opencv-python-headless #62 uses override-dependencies with extra == 'never' — a clever marker trick that makes the package conditional on an extra that's never activated, effectively silencing it from the resolver without surfacing an error.

  • This PR uses constraint-dependencies = ["opencv-python-headless==99999"] — adds a hard constraint at resolution time. If any current or future transitive dep requests opencv-python-headless, uv fails explicitly with a conflict message rather than silently ignoring it. Version 99999 is a sentinel that doesn't exist on PyPI, so resolution always fails loudly.

The practical distinction: constraint-dependencies is uv's documented mechanism for "this package must never be installed" and produces an actionable error. The extra == 'never' trick is semantically opaque to future maintainers and silently swallows the conflict instead of surfacing it.

I'll open a standalone atomic PR for #17 only so it can be evaluated on its own merits alongside PR #62.

@shezmic
Copy link
Contributor Author

shezmic commented Mar 10, 2026

Closing in favour of atomic PRs. Will open separate PRs for #85 and #17 individually.

@shezmic shezmic closed this Mar 10, 2026
Mogi83 added a commit to Mogi83/CorridorKey that referenced this pull request Mar 16, 2026
refactored fixtures to prevent memory leakage
nikopueringer pushed a commit that referenced this pull request Mar 16, 2026
* test: add unit tests for organize_clips logic

* test: add unit tests for scan_clips orchestrator

* test: add unit tests for generate_alphas

* test: refactor test suite for global sandboxing. Added run_videomama testing

* ruff fixes

* chore: trigger PR refresh

* ruff formating

* fix:test_videomama_cleanup_on_failure

* ruff formating

* fix:test_videomama_cleanup_on_failure

* test: fix env on toml, update .gitignore for hypothesis testing

* test: added relevant tests mentioned in #118

refactored fixtures to prevent memory leakage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants