Merge lp:~dinko-metalac/sudoku-app/usermetrics into lp:sudoku-app

Proposed by Dinko Osmankovic
Status: Merged
Approved by: Dinko Osmankovic
Approved revision: 150
Merged at revision: 152
Proposed branch: lp:~dinko-metalac/sudoku-app/usermetrics
Merge into: lp:sudoku-app
Diff against target: 110 lines (+28/-5)
6 files modified
apparmor/sudoku.json (+2/-2)
components/SudokuBlocksGrid.qml (+1/-0)
debian/control (+1/-0)
sudoku-app.qml (+8/-0)
tests/autopilot/sudoku_app/emulators.py (+1/-1)
tests/autopilot/sudoku_app/tests/test_sudoku.py (+15/-2)
To merge this branch: bzr merge lp:~dinko-metalac/sudoku-app/usermetrics
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Victor Thompson (community) Abstain
Dinko Osmankovic Approve
Review via email: mp+195038@code.launchpad.net

Commit message

UserMetrics added

Description of the change

UserMetrics added

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
145. By Dinko Osmankovic

AppArmor json changes

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
Victor Thompson (vthompson) wrote :

You should 1) revert the manifest changes and 2) consider stating "No sudoku games played today" since there will probably be other games that will use metrics on the Welcome screen.

review: Needs Fixing
146. By Dinko Osmankovic

Manifest revert. Victors advice on usermetrics

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
147. By Dinko Osmankovic

Added AP test fixes from Victors branch.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
148. By Dinko Osmankovic

Forgot fixes in emulators.py

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

David P had asked that the music-app update the translatable string for the format [1]. Maybe you could do the same? Add both the TRANSLATORS comment and the string to not include %1?

[1] http://bazaar.launchpad.net/~vthompson/music-app/update-translations/view/head:/music-app.qml#L171

Revision history for this message
Dinko Osmankovic (dinko-metalac) wrote :

OK. Will fix that. Thanks
On 9 Jan 2014 13:50, "Victor Thompson" <email address hidden> wrote:

> David P had asked that the music-app update the translatable string for
> the format [1]. Maybe you could do the same? Add both the TRANSLATORS
> comment and the string to not include %1?
>
> [1]
> http://bazaar.launchpad.net/~vthompson/music-app/update-translations/view/head:/music-app.qml#L171
> --
>
> https://code.launchpad.net/~dinko-metalac/sudoku-app/usermetrics/+merge/195038
> You are the owner of lp:~dinko-metalac/sudoku-app/usermetrics.
>

149. By Dinko Osmankovic

Translation fix

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
150. By Dinko Osmankovic

Translation fix, take 2

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Dinko Osmankovic (dinko-metalac) :
review: Approve
Revision history for this message
Victor Thompson (vthompson) wrote :

I tried to run this on a device, but it didn't look like the app was adding text to the welcome screen. Have you verified that the metric works?

Revision history for this message
Dinko Osmankovic (dinko-metalac) wrote :

No, unfortunately. I followed Nekhelesh's tutorial.

Do you have an idea why it is not working?
On 10 Jan 2014 19:44, "Victor Thompson" <email address hidden> wrote:

> I tried to run this on a device, but it didn't look like the app was
> adding text to the welcome screen. Have you verified that the metric works?
> --
>
> https://code.launchpad.net/~dinko-metalac/sudoku-app/usermetrics/+merge/195038
> You are the owner of lp:~dinko-metalac/sudoku-app/usermetrics.
>

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

Either it's not hitting the increment line of code or maybe there's an apparmor issue. I'll try to investigate a bit later on. The music-app made use of it fairly easily--but it has an unconfined apparmor profile.

Revision history for this message
Dinko Osmankovic (dinko-metalac) wrote :

Ah yes, manifest doesnt include usermetrics. I reverted it and forgot about
it. My bad...
On 10 Jan 2014 19:51, "Victor Thompson" <email address hidden> wrote:

> Either it's not hitting the increment line of code or maybe there's an
> apparmor issue. I'll try to investigate a bit later on. The music-app made
> use of it fairly easily--but it has an unconfined apparmor profile.
> --
>
> https://code.launchpad.net/~dinko-metalac/sudoku-app/usermetrics/+merge/195038
> You are the owner of lp:~dinko-metalac/sudoku-app/usermetrics.
>

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

Your apparmor profile seems right. But looking at the manifest maybe you need the following line:

"architecture": "armhf",

like the music-app [1] and others have.

[1] http://bazaar.launchpad.net/~music-app-dev/music-app/trunk/view/head:/manifest.json

Revision history for this message
Dinko Osmankovic (dinko-metalac) wrote :

Hmmm, but in apparmor profile it says unconfined :/

Maybe that's why it works for music-app...
On 10 Jan 2014 20:02, "Victor Thompson" <email address hidden> wrote:

> Your apparmor profile seems right. But looking at the manifest maybe you
> need the following line:
>
> "architecture": "armhf",
>
> like the music-app [1] and others have.
>
> [1]
> http://bazaar.launchpad.net/~music-app-dev/music-app/trunk/view/head:/manifest.json
> --
>
> https://code.launchpad.net/~dinko-metalac/sudoku-app/usermetrics/+merge/195038
> You are the owner of lp:~dinko-metalac/sudoku-app/usermetrics.
>

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

I must be doing something wrong, I still can't get it to work. I do see this in the logs:

Failed to register user metric: "sudoku-metrics" " "%1 sudoku games played today
" ": An AppArmor policy prevents this sender from sending this message to this
recipient, 0 matched rules; type="method_call", sender=":1.47" (uid=32011 pid=30
29 comm="/usr/lib/arm-linux-gnueabihf/qt5/bin/qmlscene sudo") interface="com.can
onical.UserMetrics" member="createDataSource" error name="(unset)" requested_rep
ly="0" destination="com.canonical.UserMetrics" (uid=102 pid=1939 comm="/usr/lib/
arm-linux-gnueabihf/libusermetrics/userme")

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

I'm trying to recruit someone from IRC to test this. I'll abstain from review in the meantime.

review: Abstain
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

> Your apparmor profile seems right. But looking at the manifest maybe you need
> the following line:
>
> "architecture": "armhf",

This shouldn't be needed

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'apparmor/sudoku.json'
--- apparmor/sudoku.json 2013-10-09 19:39:38 +0000
+++ apparmor/sudoku.json 2014-01-09 14:57:42 +0000
@@ -1,4 +1,4 @@
1{1{
2 "policy_groups": [], 2 "policy_groups": ["networking", "usermetrics"],
3 "policy_version": 1.03 "policy_version": 1.0
4}
5\ No newline at end of file4\ No newline at end of file
5}
66
=== modified file 'components/SudokuBlocksGrid.qml'
--- components/SudokuBlocksGrid.qml 2013-10-16 21:08:52 +0000
+++ components/SudokuBlocksGrid.qml 2014-01-09 14:57:42 +0000
@@ -413,6 +413,7 @@
413 //print (sudokuBlocksGrid.numberOfHints)413 //print (sudokuBlocksGrid.numberOfHints)
414 //print (sudokuBlocksGrid.gameSeconds)414 //print (sudokuBlocksGrid.gameSeconds)
415 //print (sudokuBlocksGrid.gameDifficulty)415 //print (sudokuBlocksGrid.gameDifficulty)
416 gamesPlayedMetric.increment(1);
416417
417 winTimer.restart();418 winTimer.restart();
418 }419 }
419420
=== modified file 'debian/control'
--- debian/control 2013-09-26 18:51:49 +0000
+++ debian/control 2014-01-09 14:57:42 +0000
@@ -19,6 +19,7 @@
19 qtdeclarative5-particles-plugin,19 qtdeclarative5-particles-plugin,
20 qtdeclarative5-window-plugin,20 qtdeclarative5-window-plugin,
21 qtdeclarative5-xmllistmodel-plugin,21 qtdeclarative5-xmllistmodel-plugin,
22 qtdeclarative5-usermetrics0.1,
22Description: Sudoku game for Ubuntu devices23Description: Sudoku game for Ubuntu devices
23 Simple Sudoku Touch game written in QML2/JS using Ubuntu SDK24 Simple Sudoku Touch game written in QML2/JS using Ubuntu SDK
2425
2526
=== modified file 'sudoku-app.qml'
--- sudoku-app.qml 2013-10-16 21:08:52 +0000
+++ sudoku-app.qml 2014-01-09 14:57:42 +0000
@@ -7,6 +7,7 @@
7import "components"7import "components"
8//import Ubuntu.HUD 1.0 as HUD8//import Ubuntu.HUD 1.0 as HUD
9import Ubuntu.Unity.Action 1.0 as UnityActions9import Ubuntu.Unity.Action 1.0 as UnityActions
10import UserMetrics 0.1
1011
11MainView {12MainView {
12 id: mainView13 id: mainView
@@ -300,6 +301,13 @@
300 //buttonsGridPublic.update();301 //buttonsGridPublic.update();
301 }302 }
302303
304 Metric {
305 id: gamesPlayedMetric
306 name: "sudoku-metrics"
307 format: "<b>%1</b> " + i18n.tr("Sudoku games played today")
308 emptyFormat: i18n.tr("No Sudoku games played today")
309 domain: "com.ubuntu.sudoku"
310 }
303311
304 Component {312 Component {
305 id: alertDialog313 id: alertDialog
306314
=== modified file 'tests/autopilot/sudoku_app/emulators.py'
--- tests/autopilot/sudoku_app/emulators.py 2013-09-26 22:30:52 +0000
+++ tests/autopilot/sudoku_app/emulators.py 2014-01-09 14:57:42 +0000
@@ -28,7 +28,7 @@
28 return button28 return button
2929
30 def get_number_dialog(self):30 def get_number_dialog(self):
31 return self.select_single("Dialog", objectName="picknumberscreen")31 return self.wait_select_single("Dialog", objectName="picknumberscreen")
3232
33 def get_hints_switch(self):33 def get_hints_switch(self):
34 return self.select_single("CheckBox", objectName="hintsSwitch")34 return self.select_single("CheckBox", objectName="hintsSwitch")
3535
=== modified file 'tests/autopilot/sudoku_app/tests/test_sudoku.py'
--- tests/autopilot/sudoku_app/tests/test_sudoku.py 2013-10-14 10:45:44 +0000
+++ tests/autopilot/sudoku_app/tests/test_sudoku.py 2014-01-09 14:57:42 +0000
@@ -129,8 +129,21 @@
129 self.assertThat(buttonValue, Eventually(Equals("4")))129 self.assertThat(buttonValue, Eventually(Equals("4")))
130130
131 def test_new_game_button(self):131 def test_new_game_button(self):
132 #open settings tab
133 self.main_view.switch_to_tab("settingsTab")
134
132 #testing new game with moderate mode135 #testing new game with moderate mode
133 self._set_difficulty(3, "Moderate")136 #click on difficulty selector
137 self.assertThat(self.main_view.get_difficulty_selector, Eventually(Not(Is(None))))
138 difficultySelector = self.main_view.get_difficulty_selector()
139 self.assertThat(difficultySelector.text, Eventually(Equals("Default Difficulty")))
140 self.pointing_device.click_object(difficultySelector)
141
142 #select "Moderate" choice of difficulty selector
143 difficultyChoices = self.main_view.get_difficulty_selector_labelvisual()
144 difficultyChoice = filter(lambda choice: choice.text == 'Moderate', difficultyChoices)[0]
145 self.pointing_device.click_object(difficultyChoice)
146 self.assertThat(lambda: self.main_view.get_difficulty_selector_labelvisual()[0].text, Eventually(Equals("Moderate")))
134 self._verify_game_start()147 self._verify_game_start()
135148
136 #testing new game with always ask149 #testing new game with always ask
@@ -225,7 +238,7 @@
225 difficultyChoices = self.main_view.get_difficulty_selector_labelvisual()238 difficultyChoices = self.main_view.get_difficulty_selector_labelvisual()
226 difficultyChoice = filter(lambda choice: choice.text == 'Moderate', difficultyChoices)[0]239 difficultyChoice = filter(lambda choice: choice.text == 'Moderate', difficultyChoices)[0]
227 self.pointing_device.click_object(difficultyChoice)240 self.pointing_device.click_object(difficultyChoice)
228 self.assertThat(lambda: self.main_view.get_difficulty_selector_labelvisual()[1].text, Eventually(Equals("Moderate")))241 self.assertThat(lambda: self.main_view.get_difficulty_selector_labelvisual()[0].text, Eventually(Equals("Moderate")))
229242
230 #********check theme selector ********243 #********check theme selector ********
231 #click on theme selector244 #click on theme selector

Subscribers

People subscribed via source and target branches