-
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 Nov 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 67e6432 - Browse repository at this point
Copy the full SHA 67e6432View 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 9a97bb0 - Browse repository at this point
Copy the full SHA 9a97bb0View commit details -
Configuration menu - View commit details
-
Copy full SHA for c783b54 - Browse repository at this point
Copy the full SHA c783b54View commit details -
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 b63dded - Browse repository at this point
Copy the full SHA b63ddedView 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 5475c69 - Browse repository at this point
Copy the full SHA 5475c69View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d00541 - Browse repository at this point
Copy the full SHA 2d00541View 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 f510e77 - Browse repository at this point
Copy the full SHA f510e77View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae44207 - Browse repository at this point
Copy the full SHA ae44207View 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 f32b034 - Browse repository at this point
Copy the full SHA f32b034View commit details -
Configuration menu - View commit details
-
Copy full SHA for cbcf980 - Browse repository at this point
Copy the full SHA cbcf980View 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 d0c8ff1 - Browse repository at this point
Copy the full SHA d0c8ff1View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd6ee95 - Browse repository at this point
Copy the full SHA dd6ee95View 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 0572213 - Browse repository at this point
Copy the full SHA 0572213View commit details -
Configuration menu - View commit details
-
Copy full SHA for 94e16e6 - Browse repository at this point
Copy the full SHA 94e16e6View commit details -
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 4970dda - Browse repository at this point
Copy the full SHA 4970ddaView commit details