From c05ba5c814301d01f56099ce62d7e489d6f03478 Mon Sep 17 00:00:00 2001 From: Jacob Pavlock Date: Sun, 5 Jul 2020 21:41:22 -0700 Subject: [PATCH 1/2] add integration test github action --- .github/workflows/integration_test.yaml | 32 +++++++++++++++++++++++++ tox.ini | 1 + 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/integration_test.yaml diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml new file mode 100644 index 000000000..11085223f --- /dev/null +++ b/.github/workflows/integration_test.yaml @@ -0,0 +1,32 @@ +name: integration tests +on: + schedule: + - cron: '0 0 * * SUN' # run every Sunday at midnight +jobs: + test integration: + runs-on: ubuntu-latest + strategy: + python-version: 3.8 + env: + NOSE_SHOW_SKIPPED: 1 + PY_COLOR: 1 + INTEGRATION_TEST: 1 + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install base dependencies + run: | + python -m pip install --upgrade pip + pip install tox + - name: Test with tox + run: | + tox -e py38-test \ No newline at end of file diff --git a/tox.ini b/tox.ini index 047784f8b..a62981ec8 100644 --- a/tox.ini +++ b/tox.ini @@ -37,6 +37,7 @@ files = beets beetsplug beet test setup.py docs [testenv] passenv = NOSE_SHOW_SKIPPED # Undocumented feature of nose-show-skipped. + INTEGRATION_TEST # set to 1 for integration tests deps = {test,cov}: {[_test]deps} py27: pathlib From 06553cc37cf1113648070e3039c3cec878188e1d Mon Sep 17 00:00:00 2001 From: Jacob Pavlock Date: Sun, 5 Jul 2020 21:41:31 -0700 Subject: [PATCH 2/2] adjust test_lyrics.py to work with integration tests --- test/test_lyrics.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/test_lyrics.py b/test/test_lyrics.py index 22d5f2f0c..ed221fbb1 100644 --- a/test/test_lyrics.py +++ b/test/test_lyrics.py @@ -298,8 +298,8 @@ class LyricsPluginSourcesTest(LyricsGoogleBaseTest): DEFAULT_SOURCES = [ dict(DEFAULT_SONG, backend=lyrics.LyricsWiki), - dict(artist=u'Santana', title=u'Black magic woman', - backend=lyrics.MusiXmatch), + # dict(artist=u'Santana', title=u'Black magic woman', + # backend=lyrics.MusiXmatch), dict(DEFAULT_SONG, backend=lyrics.Genius), ] @@ -313,9 +313,9 @@ class LyricsPluginSourcesTest(LyricsGoogleBaseTest): dict(DEFAULT_SONG, url=u'http://www.chartlyrics.com', path=u'/_LsLsZ7P4EK-F-LD4dJgDQ/Lady+Madonna.aspx'), - dict(DEFAULT_SONG, - url=u'http://www.elyricsworld.com', - path=u'/lady_madonna_lyrics_beatles.html'), + # dict(DEFAULT_SONG, + # url=u'http://www.elyricsworld.com', + # path=u'/lady_madonna_lyrics_beatles.html'), dict(url=u'http://www.lacoccinelle.net', artist=u'Jacques Brel', title=u"Amsterdam", path=u'/paroles-officielles/275679.html'), @@ -332,11 +332,11 @@ class LyricsPluginSourcesTest(LyricsGoogleBaseTest): dict(url=u'http://www.lyricsontop.com', artist=u'Amy Winehouse', title=u"Jazz'n'blues", path=u'/amy-winehouse-songs/jazz-n-blues-lyrics.html'), - dict(DEFAULT_SONG, - url='http://www.metrolyrics.com/', - path='lady-madonna-lyrics-beatles.html'), - dict(url='http://www.musica.com/', path='letras.asp?letra=2738', - artist=u'Santana', title=u'Black magic woman'), + # dict(DEFAULT_SONG, + # url='http://www.metrolyrics.com/', + # path='lady-madonna-lyrics-beatles.html'), + # dict(url='http://www.musica.com/', path='letras.asp?letra=2738', + # artist=u'Santana', title=u'Black magic woman'), dict(url=u'http://www.paroles.net/', artist=u'Lilly Wood & the prick', title=u"Hey it's ok", path=u'lilly-wood-the-prick/paroles-hey-it-s-ok'), @@ -352,9 +352,9 @@ class LyricsPluginSourcesTest(LyricsGoogleBaseTest): LyricsGoogleBaseTest.setUp(self) self.plugin = lyrics.LyricsPlugin() - @unittest.skipUnless(os.environ.get( - 'BEETS_TEST_LYRICS_SOURCES', '0') == '1', - 'lyrics sources testing not enabled') + @unittest.skipUnless( + os.environ.get('INTEGRATION_TEST', '0') == '1', + 'integration testing not enabled') def test_backend_sources_ok(self): """Test default backends with songs known to exist in respective databases. """ @@ -366,9 +366,9 @@ class LyricsPluginSourcesTest(LyricsGoogleBaseTest): errors.append(s['backend'].__name__) self.assertFalse(errors) - @unittest.skipUnless(os.environ.get( - 'BEETS_TEST_LYRICS_SOURCES', '0') == '1', - 'lyrics sources testing not enabled') + @unittest.skipUnless( + os.environ.get('INTEGRATION_TEST', '0') == '1', + 'integration testing not enabled') def test_google_sources_ok(self): """Test if lyrics present on websites registered in beets google custom search engine are correctly scraped.