-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor lyrics tests, do not search for empty metadata #5452
base: master
Are you sure you want to change the base?
Commits on Oct 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 75cf42c - Browse repository at this point
Copy the full SHA 75cf42cView commit details -
Address failing google sources tests
Two google sources failed to return the expected output. I looked into each case why parsing failed: - lyrics on musica.com contain <aside> Google Ads - each lyrics line on lacoccinelle.net is wrapped within alternating <em> and <strong> tags Thus remove these tags as part of the HTML cleanup logic.
Configuration menu - View commit details
-
Copy full SHA for 480012a - Browse repository at this point
Copy the full SHA 480012aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5000c59 - Browse repository at this point
Copy the full SHA 5000c59View commit details
Commits on Oct 18, 2024
-
lyrics: isolate test configuration
Create 'helpers.ConfigMixin' which sets up testing configuration. This is helpful for tests (e.g. test_lyrics.py) that only need the configuration and do not require temp dir. (#5102) Refactor lyrics tests to fix the issue global beets config issue. Additionally, add 'integration_test' mark that can be used to mark tests that should only run once a week.
Configuration menu - View commit details
-
Copy full SHA for a339556 - Browse repository at this point
Copy the full SHA a339556View commit details -
Refactor lyrics backend tests to use pytest fixtures
- Replaced unittest.mock with pytest fixtures for better test isolation and readability. - Simplified test cases by using parameterized tests. - Added `requests-mock` dependency to `pyproject.toml` and `poetry.lock`. - Removed redundant helper functions and classes.
Configuration menu - View commit details
-
Copy full SHA for 7e6bc32 - Browse repository at this point
Copy the full SHA 7e6bc32View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2af9a8c - Browse repository at this point
Copy the full SHA 2af9a8cView commit details -
Remove outdated GeniusLyrics test
The test for GeniusLyrics was heavily patched and no longer provided useful coverage. It has been removed to clean up the test suite.
Configuration menu - View commit details
-
Copy full SHA for 62348d6 - Browse repository at this point
Copy the full SHA 62348d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for f124440 - Browse repository at this point
Copy the full SHA f124440View commit details -
Refactor search_pairs tests to use pytest parametrize
- Consolidated multiple test cases into parameterized tests for better readability and maintainability. - Simplified assertions by comparing lists of actual and expected artists/titles. - Added `unexpected_empty_artist` marker to handle cases which unexpectedly return an empty artist. This seems to be happen when `artist_sort` field is empty.
Configuration menu - View commit details
-
Copy full SHA for ffcb62f - Browse repository at this point
Copy the full SHA ffcb62fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 954c369 - Browse repository at this point
Copy the full SHA 954c369View commit details -
Do not attempt to fetch lyrics with empty data
Modified `search_pairs` function in `lyrics.py` to: * Firstly strip each of `artist`, `artist_sort` and `title` fields * Only generate alternatives if both `artist` and `title` are not empty * Ensure that `artist_sort` is not empty and not equal to artist (ignoring case) before appending it to the artists Extended tests to cover the changes.
Configuration menu - View commit details
-
Copy full SHA for 41d6cec - Browse repository at this point
Copy the full SHA 41d6cecView commit details -
Configuration menu - View commit details
-
Copy full SHA for a81024e - Browse repository at this point
Copy the full SHA a81024eView commit details -
Make album, duration required for LyricsPlugin.fetch
Since at least one Backend requires album` and `duration` arguments (`LRCLib`), the caller (`LyricsPlugin.fetch_item_lyrics`) must always provide them. Since they need to provided, we need to enforce this by defining them as positional arguments. Why is this important? I found that integrated `LRCLib` tests have been passing, but they called `LRCLib.fetch` with values for `artist` and `title` fields only, while the actual functionality *always* provides values for `album` and `duration` fields too. When I adjusted the test to provide values for the missing fields, I found that it failed. This makes sense: Lib `album` and `duration` filters are strict on LRCLib, so I was not surprised the lyrics could not be found. Thus I adjusted `LRCLib` backend implementation to only filter by each of these fields when their values are truthy.
Configuration menu - View commit details
-
Copy full SHA for 9f7c1ef - Browse repository at this point
Copy the full SHA 9f7c1efView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3026a35 - Browse repository at this point
Copy the full SHA 3026a35View commit details
Commits on Oct 19, 2024
-
Add explicit checks for lyrics texts fetched from the tested sources. - Introduced `LyricsPage` class to represent lyrics pages for integrated tests. - Configured expected lyrics for each of the URLs that are being fetched. - Consolidated integrated tests in a new `TestLyricsSources` class. - Mocked Google Search API to return the lyrics page under test.
Configuration menu - View commit details
-
Copy full SHA for e70f61b - Browse repository at this point
Copy the full SHA e70f61bView commit details