mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-11-20 13:07:57 +09:00
## Summary - `BaseLyricsProvider.MAX_LYRICS_LENGTH` (3000) was measured on raw text. Genius RapidAPI emits `\n\n` per line, so a normal ~4 min song (job 258ba59b, 4,256 chars) was truncated after verse 2. Lrclib/Musixmatch hit the same cap (2,975 byte files). - Blank lines no longer count toward the cap; cap raised to 15000 (screenplays/articles are 50k+). ## Testing - New regressions: double-spaced 70-line song and ~8k-char rap song keep every line; screenplay tests still truncate. - `tests/unit/test_base_lyrics_provider.py` 17 pass. 9 failures in test_lyrics.py / test_agentic_gemini_provider.py are pre-existing on main (env). 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Lyrics can now contain up to 15,000 characters before truncation, up from 3,000. * Blank lines no longer count toward the lyrics character limit, helping preserve longer lyrics with extra spacing. * **Documentation** * Added guidance about the updated lyrics limit and a caution for rerunning lyrics actions on in-progress jobs, where existing working data may be replaced. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Sonnet 5.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.