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
1=== modified file 'apparmor/sudoku.json'
2--- apparmor/sudoku.json 2013-10-09 19:39:38 +0000
3+++ apparmor/sudoku.json 2014-01-09 14:57:42 +0000
4@@ -1,4 +1,4 @@
5 {
6- "policy_groups": [],
7+ "policy_groups": ["networking", "usermetrics"],
8 "policy_version": 1.0
9-}
10\ No newline at end of file
11+}
12
13=== modified file 'components/SudokuBlocksGrid.qml'
14--- components/SudokuBlocksGrid.qml 2013-10-16 21:08:52 +0000
15+++ components/SudokuBlocksGrid.qml 2014-01-09 14:57:42 +0000
16@@ -413,6 +413,7 @@
17 //print (sudokuBlocksGrid.numberOfHints)
18 //print (sudokuBlocksGrid.gameSeconds)
19 //print (sudokuBlocksGrid.gameDifficulty)
20+ gamesPlayedMetric.increment(1);
21
22 winTimer.restart();
23 }
24
25=== modified file 'debian/control'
26--- debian/control 2013-09-26 18:51:49 +0000
27+++ debian/control 2014-01-09 14:57:42 +0000
28@@ -19,6 +19,7 @@
29 qtdeclarative5-particles-plugin,
30 qtdeclarative5-window-plugin,
31 qtdeclarative5-xmllistmodel-plugin,
32+ qtdeclarative5-usermetrics0.1,
33 Description: Sudoku game for Ubuntu devices
34 Simple Sudoku Touch game written in QML2/JS using Ubuntu SDK
35
36
37=== modified file 'sudoku-app.qml'
38--- sudoku-app.qml 2013-10-16 21:08:52 +0000
39+++ sudoku-app.qml 2014-01-09 14:57:42 +0000
40@@ -7,6 +7,7 @@
41 import "components"
42 //import Ubuntu.HUD 1.0 as HUD
43 import Ubuntu.Unity.Action 1.0 as UnityActions
44+import UserMetrics 0.1
45
46 MainView {
47 id: mainView
48@@ -300,6 +301,13 @@
49 //buttonsGridPublic.update();
50 }
51
52+ Metric {
53+ id: gamesPlayedMetric
54+ name: "sudoku-metrics"
55+ format: "<b>%1</b> " + i18n.tr("Sudoku games played today")
56+ emptyFormat: i18n.tr("No Sudoku games played today")
57+ domain: "com.ubuntu.sudoku"
58+ }
59
60 Component {
61 id: alertDialog
62
63=== modified file 'tests/autopilot/sudoku_app/emulators.py'
64--- tests/autopilot/sudoku_app/emulators.py 2013-09-26 22:30:52 +0000
65+++ tests/autopilot/sudoku_app/emulators.py 2014-01-09 14:57:42 +0000
66@@ -28,7 +28,7 @@
67 return button
68
69 def get_number_dialog(self):
70- return self.select_single("Dialog", objectName="picknumberscreen")
71+ return self.wait_select_single("Dialog", objectName="picknumberscreen")
72
73 def get_hints_switch(self):
74 return self.select_single("CheckBox", objectName="hintsSwitch")
75
76=== modified file 'tests/autopilot/sudoku_app/tests/test_sudoku.py'
77--- tests/autopilot/sudoku_app/tests/test_sudoku.py 2013-10-14 10:45:44 +0000
78+++ tests/autopilot/sudoku_app/tests/test_sudoku.py 2014-01-09 14:57:42 +0000
79@@ -129,8 +129,21 @@
80 self.assertThat(buttonValue, Eventually(Equals("4")))
81
82 def test_new_game_button(self):
83+ #open settings tab
84+ self.main_view.switch_to_tab("settingsTab")
85+
86 #testing new game with moderate mode
87- self._set_difficulty(3, "Moderate")
88+ #click on difficulty selector
89+ self.assertThat(self.main_view.get_difficulty_selector, Eventually(Not(Is(None))))
90+ difficultySelector = self.main_view.get_difficulty_selector()
91+ self.assertThat(difficultySelector.text, Eventually(Equals("Default Difficulty")))
92+ self.pointing_device.click_object(difficultySelector)
93+
94+ #select "Moderate" choice of difficulty selector
95+ difficultyChoices = self.main_view.get_difficulty_selector_labelvisual()
96+ difficultyChoice = filter(lambda choice: choice.text == 'Moderate', difficultyChoices)[0]
97+ self.pointing_device.click_object(difficultyChoice)
98+ self.assertThat(lambda: self.main_view.get_difficulty_selector_labelvisual()[0].text, Eventually(Equals("Moderate")))
99 self._verify_game_start()
100
101 #testing new game with always ask
102@@ -225,7 +238,7 @@
103 difficultyChoices = self.main_view.get_difficulty_selector_labelvisual()
104 difficultyChoice = filter(lambda choice: choice.text == 'Moderate', difficultyChoices)[0]
105 self.pointing_device.click_object(difficultyChoice)
106- self.assertThat(lambda: self.main_view.get_difficulty_selector_labelvisual()[1].text, Eventually(Equals("Moderate")))
107+ self.assertThat(lambda: self.main_view.get_difficulty_selector_labelvisual()[0].text, Eventually(Equals("Moderate")))
108
109 #********check theme selector ********
110 #click on theme selector

Subscribers

People subscribed via source and target branches