From 385e9ac4211807ee93aa24c7921972558926026d Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 30 Mar 2015 22:18:29 +0200 Subject: [PATCH 1/3] travis: Use new faster build infrastructure --- .travis.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2058fcc7..41fc3c31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,18 @@ +sudo: false + language: python python: - "2.7_with_system_site_packages" +addons: + apt: + sources: + - mopidy + packages: + - graphviz-dev + - mopidy + env: - TOX_ENV=py27 - TOX_ENV=py27-tornado23 @@ -11,10 +21,6 @@ env: - TOX_ENV=flake8 install: - - "wget -O - http://apt.mopidy.com/mopidy.gpg | sudo apt-key add -" - - "sudo wget -O /etc/apt/sources.list.d/mopidy.list http://apt.mopidy.com/mopidy.list" - - "sudo apt-get update || true" - - "sudo apt-get install mopidy graphviz-dev" - "pip install tox" script: From 860ea7cb81fdc9340b154b155c70e47fdf0fcc9c Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 30 Mar 2015 22:39:56 +0200 Subject: [PATCH 2/3] travis: Use correct APT source name Ref APT source addition in travis-ci/apt-source-whitelist@af532b06aac870e428905bb2cdba0d47c1bf38c7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 41fc3c31..5f01f223 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ python: addons: apt: sources: - - mopidy + - mopidy-stable packages: - graphviz-dev - mopidy From 2bc63ec0279e4031486993ede899e9689509fa16 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Thu, 2 Apr 2015 20:53:29 +0200 Subject: [PATCH 3/3] audio: Skip MP3 tests if missing plugin --- tests/audio/test_scan.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/audio/test_scan.py b/tests/audio/test_scan.py index b2937a3f..c3fb4c47 100644 --- a/tests/audio/test_scan.py +++ b/tests/audio/test_scan.py @@ -41,17 +41,26 @@ class ScannerTest(unittest.TestCase): name = path_to_data_dir(name) self.assertEqual(self.tags[name][key], value) + def check_if_missing_plugin(self): + if any(['missing a plug-in' in str(e) for e in self.errors.values()]): + raise unittest.SkipTest('Missing MP3 support?') + def test_tags_is_set(self): self.scan(self.find('scanner/simple')) self.assert_(self.tags) def test_errors_is_not_set(self): self.scan(self.find('scanner/simple')) + + self.check_if_missing_plugin() + self.assert_(not self.errors) def test_duration_is_set(self): self.scan(self.find('scanner/simple')) + self.check_if_missing_plugin() + self.assertEqual( self.durations[path_to_data_dir('scanner/simple/song1.mp3')], 4680) self.assertEqual( @@ -59,16 +68,25 @@ class ScannerTest(unittest.TestCase): def test_artist_is_set(self): self.scan(self.find('scanner/simple')) + + self.check_if_missing_plugin() + self.check('scanner/simple/song1.mp3', 'artist', ['name']) self.check('scanner/simple/song1.ogg', 'artist', ['name']) def test_album_is_set(self): self.scan(self.find('scanner/simple')) + + self.check_if_missing_plugin() + self.check('scanner/simple/song1.mp3', 'album', ['albumname']) self.check('scanner/simple/song1.ogg', 'album', ['albumname']) def test_track_is_set(self): self.scan(self.find('scanner/simple')) + + self.check_if_missing_plugin() + self.check('scanner/simple/song1.mp3', 'title', ['trackname']) self.check('scanner/simple/song1.ogg', 'title', ['trackname']) @@ -82,6 +100,9 @@ class ScannerTest(unittest.TestCase): def test_log_file_that_gst_thinks_is_mpeg_1_is_ignored(self): self.scan([path_to_data_dir('scanner/example.log')]) + + self.check_if_missing_plugin() + self.assertLess( self.durations[path_to_data_dir('scanner/example.log')], 100)