Skip to content

Commit

Permalink
try out integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Oct 1, 2024
1 parent 9399f66 commit 16cfd91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:

- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
name: Test with coverage
env:
INTEGRATION_TEST: 1
uses: liskin/gh-problem-matcher-wrap@v3
with:
linters: pytest
Expand Down
21 changes: 10 additions & 11 deletions test/plugins/test_lyrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from http import HTTPStatus

import pytest
import requests

from beets.library import Item
from beets.test.helper import PluginMixin
Expand All @@ -34,12 +35,6 @@
_p = pytest.param


skip_ci = pytest.mark.skipif(
os.environ.get("GITHUB_ACTIONS") == "true",
reason="GitHub actions is on some form of Cloudflare blacklist",
)


class TestLyricsUtils:
def test_search_artist(self):
item = Item(artist="Alice ft. Bob", title="song")
Expand Down Expand Up @@ -276,13 +271,9 @@ def file_name(self):
"https://sweetslyrics.com/the-beatles/lady-madonna-lyrics",
"https://www.musica.com/letras.asp?letra=59862",
"https://www.lacoccinelle.net/259956-the-beatles-lady-madonna.html",
"https://www.azlyrics.com/lyrics/beatles/ladymadonna.html",
)
),
pytest.param(
"Lady Madonna",
"https://www.azlyrics.com/lyrics/beatles/ladymadonna.html",
marks=skip_ci,
),
(
"Jazz'n'blues",
"https://www.lyricsontop.com/amy-winehouse-songs/jazz-n-blues-lyrics.html", # noqa: E501
Expand Down Expand Up @@ -350,6 +341,14 @@ class TestGeniusLyrics(LyricsPluginBackendMixin):
def backend_name(self):
return "genius"

@pytest.mark.xfail(
bool(os.environ.get("GITHUB_ACTIONS")),
reason="Genius returns 403 FORBIDDEN in CI",
raises=requests.HTTPError,
)
def test_backend_source(self, backend):
super().test_backend_source(backend)

@pytest.mark.parametrize(
"file_name, expected_line_count",
[
Expand Down

0 comments on commit 16cfd91

Please sign in to comment.