Merge lp:~xnox/music-app/better-tune into lp:music-app/trusty

Proposed by Dimitri John Ledkov
Status: Merged
Merge reported by: Victor Thompson
Merged at revision: not available
Proposed branch: lp:~xnox/music-app/better-tune
Merge into: lp:music-app/trusty
Diff against target: 319 lines (+49/-65)
1 file modified
tests/autopilot/music_app/tests/test_music.py (+49/-65)
To merge this branch: bzr merge lp:~xnox/music-app/better-tune
Reviewer Review Type Date Requested Status
Victor Thompson Needs Fixing
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Review via email: mp+210024@code.launchpad.net

Commit message

* Replace screeching, choppy digitalised song with a neutral guitar tune.
* Do not hardcode the name of test song/artist, instead use testclass properties.

Description of the change

* Replace screeching, choppy digitalised song with a neutral guitar tune.
* Do not hardcode the name of test song/artist, instead use testclass properties.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

The original test song is not easy-listening enough, especially when one is re-running music-app test-suite over and over and over again.

Revision history for this message
Victor Thompson (vthompson) wrote :

I doubt this will work as you will need to modify the canned mediascanner library that the tests use.

review: Disapprove
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

On 7 March 2014 21:23, Victor Thompson <email address hidden> wrote:
> Review: Disapprove
>
> I doubt this will work as you will need to modify the canned mediascanner library that the tests use.

Yeah I did wonder about that, since the tests do work on touch.
Instructions must be included on how to generate that cache, ideally
via a script, as otherwise it's non-free blobs.

How do i rebuild the test mediascanner cache?

--
Regards,

Dimitri.

Revision history for this message
Victor Thompson (vthompson) wrote :

You could probably 1) remove your ~/.cache/mediascanner directory, 2) store the music files from tests/autopilot/music_app/content/ and ONLY those files in /home/autopilot-music-app/Music/ and rerun mediascanner with that directory as input. Feel free to inspect the non-free blobs to ensure the data locations are correct, etc.

You should note that this version of the mediascanner will not be used by the app for very much longer (hopefully under 1-2 months)--so your efforts might be for naught.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

On 7 March 2014 22:07, Victor Thompson <email address hidden> wrote:
> You could probably 1) remove your ~/.cache/mediascanner directory, 2) store the music files from tests/autopilot/music_app/content/ and ONLY those files in /home/autopilot-music-app/Music/ and rerun mediascanner with that directory as input. Feel free to inspect the non-free blobs to ensure the data locations are correct, etc.
>
> You should note that this version of the mediascanner will not be used by the app for very much longer (hopefully under 1-2 months)--so your efforts might be for naught.

Yeah, i've noticed that there are _two_ media scanners running with
different caches. I'll regenerate the caches.

--
Regards,

Dimitri.

Revision history for this message
Victor Thompson (vthompson) wrote :

Also, we intentionally used small files. The ogg you are including is over 3MB, whereas the previous one was 500K.

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

Can we just re-encode the new audio files at a lower bitrate and make them mono to make them smaller?

Revision history for this message
Victor Thompson (vthompson) wrote :

We could do something like that. I think we've decided that mostly the size doesn't matter *so* much, however. I think the more important thing is to try to build up a realistic structure of a few Artists and Albums comprising of multiple genres of music. The song Dimitri's proposing here will be included when we move the test suite over to mediascanner2.0's db.

I'm going to change this to Needs Fixing, since we decided size doesn't matter as much. But trying to fit another test track into the old mediascanner library might not be worth anyone's time.

review: Needs Fixing
Revision history for this message
David Planella (dpm) wrote :

I'll mark this one as Work In Progress, since it's effectively blocked until we land mediascanner2.0 support

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/music_app/content/1.ogg'
2Binary files tests/autopilot/music_app/content/1.ogg 2013-09-27 15:14:10 +0000 and tests/autopilot/music_app/content/1.ogg 2014-03-07 21:20:35 +0000 differ
3=== modified file 'tests/autopilot/music_app/tests/test_music.py'
4--- tests/autopilot/music_app/tests/test_music.py 2014-03-07 16:40:31 +0000
5+++ tests/autopilot/music_app/tests/test_music.py 2014-03-07 21:20:35 +0000
6@@ -29,6 +29,8 @@
7 #wait for activity indicator to stop spinning
8 spinner = lambda: self.main_view.get_spinner().running
9 self.assertThat(spinner, Eventually(Equals(False)))
10+ self.trackTitle = u"Gran Vals"
11+ self.artistName = u"Francisco Tárrega"
12
13 def test_reads_music_library(self):
14 """ tests if the music library is populated from our
15@@ -37,15 +39,14 @@
16 # populate queue
17 first_genre_item = self.main_view.get_first_genre_item()
18 self.pointing_device.click_object(first_genre_item)
19- trackTitle = "Foss Yeaaaah! (Radio Edit)"
20- song = self.main_view.get_album_sheet_listview_tracktitle(trackTitle)
21+ song = self.main_view.get_album_sheet_listview_tracktitle(
22+ self.trackTitle)
23 self.pointing_device.click_object(song)
24
25 title = lambda: self.player.currentMetaTitle
26 artist = lambda: self.player.currentMetaArtist
27- self.assertThat(title,
28- Eventually(Equals("Foss Yeaaaah! (Radio Edit)")))
29- self.assertThat(artist, Eventually(Equals("Benjamin Kerensa")))
30+ self.assertThat(title, Eventually(Equals(self.trackTitle)))
31+ self.assertThat(artist, Eventually(Equals(self.artistName)))
32
33 def test_play_pause_library(self):
34 """ Test playing and pausing a track (Music Library must exist) """
35@@ -53,8 +54,8 @@
36 # populate queue
37 first_genre_item = self.main_view.get_first_genre_item()
38 self.pointing_device.click_object(first_genre_item)
39- trackTitle = "Foss Yeaaaah! (Radio Edit)"
40- song = self.main_view.get_album_sheet_listview_tracktitle(trackTitle)
41+ song = self.main_view.get_album_sheet_listview_tracktitle(
42+ self.trackTitle)
43 self.pointing_device.click_object(song)
44
45 # click back button
46@@ -85,8 +86,8 @@
47 # populate queue
48 first_genre_item = self.main_view.get_first_genre_item()
49 self.pointing_device.click_object(first_genre_item)
50- trackTitle = "Foss Yeaaaah! (Radio Edit)"
51- song = self.main_view.get_album_sheet_listview_tracktitle(trackTitle)
52+ song = self.main_view.get_album_sheet_listview_tracktitle(
53+ self.trackTitle)
54 self.pointing_device.click_object(song)
55
56 playbutton = self.main_view.get_now_playing_play_button()
57@@ -108,8 +109,8 @@
58 # populate queue
59 first_genre_item = self.main_view.get_first_genre_item()
60 self.pointing_device.click_object(first_genre_item)
61- trackTitle = "Foss Yeaaaah! (Radio Edit)"
62- song = self.main_view.get_album_sheet_listview_tracktitle(trackTitle)
63+ song = self.main_view.get_album_sheet_listview_tracktitle(
64+ self.trackTitle)
65 self.pointing_device.click_object(song)
66
67 playbutton = self.main_view.get_now_playing_play_button()
68@@ -169,8 +170,8 @@
69 # populate queue
70 first_genre_item = self.main_view.get_first_genre_item()
71 self.pointing_device.click_object(first_genre_item)
72- trackTitle = "Foss Yeaaaah! (Radio Edit)"
73- song = self.main_view.get_album_sheet_listview_tracktitle(trackTitle)
74+ song = self.main_view.get_album_sheet_listview_tracktitle(
75+ self.trackTitle)
76 self.pointing_device.click_object(song)
77
78 playbutton = self.main_view.get_now_playing_play_button()
79@@ -226,8 +227,8 @@
80 # populate queue
81 first_genre_item = self.main_view.get_first_genre_item()
82 self.pointing_device.click_object(first_genre_item)
83- trackTitle = "Foss Yeaaaah! (Radio Edit)"
84- song = self.main_view.get_album_sheet_listview_tracktitle(trackTitle)
85+ song = self.main_view.get_album_sheet_listview_tracktitle(
86+ self.trackTitle)
87 self.pointing_device.click_object(song)
88
89 """ Track is playing, shuffle is turned on"""
90@@ -310,18 +311,16 @@
91 def test_show_albums_sheet(self):
92 """tests navigating to the Albums tab and displaying the album sheet"""
93
94- artistName = "Benjamin Kerensa"
95-
96 # switch to albums tab
97 self.main_view.switch_to_tab("albumstab")
98
99 #select album
100- albumartist = self.main_view.get_albums_albumartist(artistName)
101+ albumartist = self.main_view.get_albums_albumartist(self.artistName)
102 self.pointing_device.click_object(albumartist)
103
104 #get album sheet album artist
105 sheet_albumartist = self.main_view.get_album_sheet_artist()
106- self.assertThat(sheet_albumartist.text, Equals(artistName))
107+ self.assertThat(sheet_albumartist.text, Equals(self.artistName))
108
109 # click on close button to close album sheet
110 closebutton = self.main_view.get_album_sheet_close_button()
111@@ -331,9 +330,6 @@
112 def test_add_song_to_queue_from_albums_sheet(self):
113 """tests navigating to the Albums tab and adding a song to queue"""
114
115- trackTitle = "Foss Yeaaaah! (Radio Edit)"
116- artistName = "Benjamin Kerensa"
117-
118 # get number of tracks in queue before queuing a track
119 initialtracksCount = self.main_view.get_queue_track_count()
120
121@@ -341,16 +337,16 @@
122 self.main_view.switch_to_tab("albumstab")
123
124 #select album
125- albumartist = self.main_view.get_albums_albumartist(artistName)
126+ albumartist = self.main_view.get_albums_albumartist(self.artistName)
127 self.pointing_device.click_object(albumartist)
128
129 #get album sheet album artist
130 sheet_albumartist = self.main_view.get_album_sheet_artist()
131- self.assertThat(sheet_albumartist.text, Equals(artistName))
132+ self.assertThat(sheet_albumartist.text, Equals(self.artistName))
133
134 #get track item to add to queue
135 trackicon = self.main_view.get_album_sheet_listview_trackicon(
136- trackTitle)
137+ self.trackTitle)
138 self.pointing_device.click_object(trackicon)
139
140 #click on Add to queue
141@@ -368,11 +364,11 @@
142
143 #verify song's metadata matches the item added to the Now Playing view
144 queueArtistName = self.main_view.get_queue_now_playing_artist(
145- artistName)
146- self.assertThat(str(queueArtistName.text), Equals(artistName))
147+ self.artistName)
148+ self.assertThat(str(queueArtistName.text), Equals(self.artistName))
149 queueTrackTitle = self.main_view.get_queue_now_playing_title(
150- trackTitle)
151- self.assertThat(str(queueTrackTitle.text), Equals(trackTitle))
152+ self.trackTitle)
153+ self.assertThat(str(queueTrackTitle.text), Equals(self.trackTitle))
154
155 # click on close button to close album sheet
156 closebutton = self.main_view.get_album_sheet_close_button()
157@@ -383,9 +379,6 @@
158 """tests navigating to the Songs tab and adding the library to the
159 queue with the selected item being played. """
160
161- trackTitle = "Foss Yeaaaah! (Radio Edit)"
162- artistName = "Benjamin Kerensa"
163-
164 # get number of tracks in queue before queuing a track
165 initialtracksCount = self.main_view.get_queue_track_count()
166
167@@ -393,7 +386,7 @@
168 self.main_view.switch_to_tab("trackstab")
169
170 # get track item to add to queue
171- trackitem = self.main_view.get_songs_tab_tracktitle(trackTitle)
172+ trackitem = self.main_view.get_songs_tab_tracktitle(self.trackTitle)
173 self.pointing_device.click_object(trackitem)
174
175 # verify track queue has added all songs to initial value
176@@ -407,19 +400,16 @@
177
178 # verify song's metadata matches the item added to the Now Playing view
179 queueArtistName = self.main_view.get_queue_now_playing_artist(
180- artistName)
181- self.assertThat(str(queueArtistName.text), Equals(artistName))
182+ self.artistName)
183+ self.assertThat(str(queueArtistName.text), Equals(self.artistName))
184 queueTrackTitle = self.main_view.get_queue_now_playing_title(
185- trackTitle)
186- self.assertThat(str(queueTrackTitle.text), Equals(trackTitle))
187+ self.trackTitle)
188+ self.assertThat(str(queueTrackTitle.text), Equals(self.trackTitle))
189
190 def test_add_song_to_queue_from_songs_tab(self):
191 """tests navigating to the Songs tab and adding a song from the library
192 to the queue via the expandable list view item. """
193
194- trackTitle = "Foss Yeaaaah! (Radio Edit)"
195- artistName = "Benjamin Kerensa"
196-
197 # get number of tracks in queue before queuing a track
198 initialtracksCount = self.main_view.get_queue_track_count()
199
200@@ -427,7 +417,7 @@
201 self.main_view.switch_to_tab("trackstab")
202
203 # get track item to add to queue
204- trackitem = self.main_view.get_songs_tab_trackimage(trackTitle)
205+ trackitem = self.main_view.get_songs_tab_trackimage(self.trackTitle)
206 self.pointing_device.click_object(trackitem)
207 addtoqueueLabel = self.main_view.get_songs_tab_add_to_queue_label()
208 self.pointing_device.click_object(addtoqueueLabel)
209@@ -443,23 +433,21 @@
210
211 # verify song's metadata matches the item added to the Now Playing view
212 queueArtistName = self.main_view.get_queue_now_playing_artist(
213- artistName)
214- self.assertThat(str(queueArtistName.text), Equals(artistName))
215+ self.artistName)
216+ self.assertThat(str(queueArtistName.text), Equals(self.artistName))
217 queueTrackTitle = self.main_view.get_queue_now_playing_title(
218- trackTitle)
219- self.assertThat(str(queueTrackTitle.text), Equals(trackTitle))
220+ self.trackTitle)
221+ self.assertThat(str(queueTrackTitle.text), Equals(self.trackTitle))
222
223 def test_create_playlist_from_songs_tab(self):
224 """tests navigating to the Songs tab and creating a playlist by
225 selecting a song to add it to a new playlist. """
226
227- trackTitle = "Foss Yeaaaah! (Radio Edit)"
228-
229 # switch to songs tab
230 self.main_view.switch_to_tab("trackstab")
231
232 # get track item to add to queue
233- trackitem = self.main_view.get_songs_tab_trackimage(trackTitle)
234+ trackitem = self.main_view.get_songs_tab_trackimage(self.trackTitle)
235 self.pointing_device.click_object(trackitem)
236 addtoplaylistLbl = self.main_view.get_songs_tab_add_to_playlist_label()
237 self.pointing_device.click_object(addtoplaylistLbl)
238@@ -497,9 +485,6 @@
239 def test_artists_tab_album(self):
240 """tests navigating to the Artists tab and playing an album"""
241
242- artistName = "Benjamin Kerensa"
243- trackTitle = "Foss Yeaaaah! (Radio Edit)"
244-
245 # get number of tracks in queue before queuing a track
246 initialtracksCount = self.main_view.get_queue_track_count()
247
248@@ -507,26 +492,27 @@
249 self.main_view.switch_to_tab("artiststab")
250
251 #select artist
252- artist = self.main_view.get_artists_artist(artistName)
253+ artist = self.main_view.get_artists_artist(self.artistName)
254 self.pointing_device.click_object(artist)
255
256 #get album sheet album artist
257 sheet_albumartist = self.main_view.get_artist_sheet_artist()
258- self.assertThat(sheet_albumartist.text, Equals(artistName))
259+ self.assertThat(sheet_albumartist.text, Equals(self.artistName))
260
261 #select artist
262- artist = self.main_view.get_artists_artist(artistName)
263+ artist = self.main_view.get_artists_artist(self.artistName)
264 self.pointing_device.click_object(artist)
265
266 #get song sheet album artist
267 sheet_albumartist = self.main_view.get_album_sheet_artist()
268- self.assertThat(sheet_albumartist.text, Equals(artistName))
269+ self.assertThat(sheet_albumartist.text, Equals(self.artistName))
270
271 # click on song to populate queue and start playing
272 self.pointing_device.click_object(sheet_albumartist)
273
274 #select artist
275- track = self.main_view.get_album_sheet_listview_tracktitle(trackTitle)
276+ track = self.main_view.get_album_sheet_listview_tracktitle(
277+ self.trackTitle)
278 self.pointing_device.click_object(track)
279
280 # verify track queue has added all songs to initial value
281@@ -540,23 +526,21 @@
282
283 # verify song's metadata matches the item added to the Now Playing view
284 queueArtistName = self.main_view.get_queue_now_playing_artist(
285- artistName)
286- self.assertThat(str(queueArtistName.text), Equals(artistName))
287+ self.artistName)
288+ self.assertThat(str(queueArtistName.text), Equals(self.artistName))
289 queueTrackTitle = self.main_view.get_queue_now_playing_title(
290- trackTitle)
291- self.assertThat(str(queueTrackTitle.text), Equals(trackTitle))
292+ self.trackTitle)
293+ self.assertThat(str(queueTrackTitle.text), Equals(self.trackTitle))
294
295 def test_swipe_to_delete_song(self):
296 """tests navigating to the Now Playing queue, swiping to delete a
297 track, and confirming the delete action. """
298
299- artistName = "Benjamin Kerensa"
300-
301 # populate queue
302 first_genre_item = self.main_view.get_first_genre_item()
303 self.pointing_device.click_object(first_genre_item)
304- trackTitle = "Foss Yeaaaah! (Radio Edit)"
305- song = self.main_view.get_album_sheet_listview_tracktitle(trackTitle)
306+ song = self.main_view.get_album_sheet_listview_tracktitle(
307+ self.trackTitle)
308 self.pointing_device.click_object(song)
309
310 # get initial queue count
311@@ -564,7 +548,7 @@
312
313 # get song to delete
314 artistToDelete = self.main_view.get_queue_now_playing_artist(
315- artistName)
316+ self.artistName)
317 musicnowplayingpage = self.main_view.get_MusicNowPlaying_page()
318
319 # get coordinates to delete song

Subscribers

People subscribed via source and target branches

to status/vote changes: