mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-12-04 00:56:43 +09:00
## Summary - Fix `--no-video` flag to properly skip all video rendering throughout the pipeline - Previously the flag only affected finalisation; now it skips title/end screens in prep and preview video in review UI - When `--no-video` is set, artist/title are extracted from directory name instead of video filename - Skip video file requirements in finalisation when flag is set ## Changes - `gen_cli.py`: Pass `render_video=not args.no_video` to KaraokePrep - `karaoke_gen.py`: Check `self.render_video` before creating title/end screen videos - `lyrics_processor.py`: Set `allow_preview_video=self.render_video` in OutputConfig - `config.py`: Add `allow_preview_video` field to OutputConfig - `server.py`: Check `allow_preview_video` before generating preview video - `karaoke_finalise.py`: Extract artist/title from directory name when no_video=True, skip video file requirements ## Test plan - [x] Added unit tests for --no-video flag in `tests/unit/test_karaoke_finalise_no_video.py` - [x] Added assertion in `test_gen_cli.py` for render_video passthrough - [x] Updated existing tests to match new behavior - [x] All 1593 tests pass <!-- @coderabbitai ignore --> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Unit Tests for KaraokePrep
This directory contains unit tests for the KaraokePrep class.
Test Files
The tests are organized into the following files:
test_initialization.py: Tests for initialization and basic functionalitytest_file_operations.py: Tests for file operations (copy, download, convert)test_metadata.py: Tests for metadata extraction and parsingtest_lyrics.py: Tests for lyrics processingtest_audio.py: Tests for audio processing and separationtest_video.py: Tests for video creation and processingtest_async.py: Tests for async methods
Running the Tests
To run the tests, you need to have the test dependencies installed:
pip install -r requirements-test.txt
Then you can run the tests with:
python run_tests.py
This will run all the tests and generate a coverage report.
Checking Test Files
If you want to check if the test files are valid Python code without running the tests, you can use:
python check_tests.py
This will check if all the test files can be imported without errors.
Test Coverage
The tests aim to cover all the functionality of the KaraokePrep class. The coverage report will show you which parts of the code are covered by the tests.