-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor lyrics tests, do not search for empty metadata (#5452)
## Description Fixes #2635 Fixes #5133 I realised that #5406 has gotten too big, thus I'm splitting it into several smaller PRs. This PR refactors lyrics plugin tests and fixes an empty metadata issue in the lyrics logic. #### CI - Added `--extras=lyrics` to the Poetry install command to include the lyrics plugin dependencies. - In the main task which measures coverage, set `LYRICS_UPDATED` environment variable based on changes detected in the lyrics files. #### Test setup - Introduced `ConfigMixin` to centralize configuration setup for tests, reducing redundancy. This can be used by tests based on `pytest`. #### Lyrics logic - Trimmed whitespace from `item.title`, `item.artist`, and `item.artist_sort` in `search_pairs` function. - Added checks to avoid searching for lyrics if either the artist or title is missing. - Improved `_scrape_strip_cruft` function to remove Google Ads tags and unnecessary HTML tags. #### Lyrics tests overhaul - Migrated lyrics tests to use `pytest` for better isolation and configuration management. - Deleted redundant lyrics text files and some unused utils. - Marked tests that should only run when lyrics source code is updated (`LYRICS_UPDATED` is set from the CI) using the `on_lyrics_update` marker. #### Documentation and Dependencies - Added `requests-mock` version `1.12.1` to `pyproject.toml` and `poetry.lock` for mocking HTTP requests in tests. - Updated `setup.cfg` to include a new marker `on_lyrics_update`.
- Loading branch information
Showing
13 changed files
with
1,005 additions
and
3,081 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.