Merge lp://staging/~ethan.chang/savilerow/add-welcome-background into lp://staging/savilerow

Proposed by Ethan Chang
Status: Merged
Merged at revision: 17
Proposed branch: lp://staging/~ethan.chang/savilerow/add-welcome-background
Merge into: lp://staging/savilerow
Diff against target: 127 lines (+71/-5)
5 files modified
doc/api.rst (+14/-0)
src/system/custom/xdg/config/upstart/welcome-background.conf (+21/-0)
tests/api/test_custom_upstartjobs.py (+28/-0)
tests/api/test_scopes.py (+7/-5)
tests/core/test_upstartjobs.py (+1/-0)
To merge this branch: bzr merge lp://staging/~ethan.chang/savilerow/add-welcome-background
Reviewer Review Type Date Requested Status
Chris Wayne (community) Approve
Review via email: mp+225429@code.staging.launchpad.net

Commit message

Create the custom/xdg/config/upstart and move welcome-background.conf to this directory.

Description of the change

Create the custom/xdg/config/upstart and move welcome-background.conf to this directory.
The welcome-background.conf works after move to this folder.

To post a comment you must log in.
Revision history for this message
Chris Wayne (cwayne) wrote :

Did you build this tarball and deploy it to a device to test?

Revision history for this message
Ethan Chang (ethan.chang) wrote :

Yes, I did make a tarball and flash to a N4 and it creates custom folder and all the files are correct.

Revision history for this message
Chris Wayne (cwayne) wrote :

As per discussion on IRC, waiting for more tests to be added before approving.

13. By Ethan Chang

Modified tests/core/test_upstartjobs.py to add /custom/xdg/config
Add tests/api/test_custom_upstartjobs.py to check custom upstart jobs work as expected

Revision history for this message
Ethan Chang (ethan.chang) wrote :

@Chirs
I have added test_custom_upstartjobs.py to check jobs in /custom/xdg/config that can run correctly
Please to check again, thank!

Revision history for this message
Chris Wayne (cwayne) wrote :

Hm, I get failures when I test this:

ERROR: custom.api.test_custom_upstartjobs.CustomjobsVerificationTests.test_custom_upstartjobs_running_process
----------------------------------------------------------------------
Empty attachments:
/var/log/syslog

Traceback (most recent call last):
File "/home/phablet/autopilot/custom/api/test_custom_upstartjobs.py", line 37, in test_custom_upstartjobs_running_process
proc_info = ' '.join(proc.cmdline)
TypeError: can only join an iterable
======================================================================
FAIL: custom.api.test_custom_upstartjobs.CustomjobsVerificationTests.test_custom_upstartjobs_directory_exists
----------------------------------------------------------------------
Empty attachments:
/var/log/syslog

Traceback (most recent call last):
File "/home/phablet/autopilot/custom/api/test_custom_upstartjobs.py", line 27, in test_custom_upstartjobs_directory_exists
self.assertTrue(os.path.isfile(os.path.join(path, job)))
File "/usr/lib/python3.4/unittest/case.py", line 654, in assertTrue
raise self.failureException(msg)
AssertionError: False is not true

Ran 20 tests in 1.185s
FAILED (failures=3)

review: Needs Fixing
14. By Ethan Chang

Modified both test_custom_upstartjobs.py and test_scopes.py to fix the error

Revision history for this message
Ethan Chang (ethan.chang) wrote :

@Chris,
After discussed with Alextu and Rex, I have modified both test_custom_upstartjobs.py and test_scopes.py, so if phone has correct scope and upstart job installed then the result should be pass. Please help to check again, thanks

Revision history for this message
Chris Wayne (cwayne) wrote :

Still seeing failures:
cwayne@starbuck:~/Projects/add-welcome-background/tests$ phablet-test-run customLoading tests from: /home/phablet/autopilot

Tests running...
======================================================================
FAIL: custom.api.test_custom_upstartjobs.CustomjobsVerificationTests.test_custom_upstartjobs_running_process
----------------------------------------------------------------------
/var/log/syslog: {{{Jul 23 13:53:55 ubuntu-phablet kernel: [ 103.130645] input: autopilot-finger as /devices/virtual/input/input6}}}

Traceback (most recent call last):
File "/home/phablet/autopilot/custom/api/test_custom_upstartjobs.py", line 38, in test_custom_upstartjobs_running_process
self.assertTrue(any(job in proc for proc in proc_cmd_list))
File "/usr/lib/python3.4/unittest/case.py", line 654, in assertTrue
raise self.failureException(msg)
AssertionError: False is not true
======================================================================
FAIL: custom.api.test_scopes.ScopeVerificationTest.test_scope_customization_running_process
----------------------------------------------------------------------
Empty attachments:
/var/log/syslog

Traceback (most recent call last):
File "/home/phablet/autopilot/custom/api/test_scopes.py", line 41, in test_scope_customization_running_process
self.assertTrue(any(scope in proc for proc in proc_cmd_list))
File "/usr/lib/python3.4/unittest/case.py", line 654, in assertTrue
raise self.failureException(msg)
AssertionError: False is not true

Ran 20 tests in 1.401s
FAILED (failures=2)
cwayne@starbuck:~/Projects/add-welcome-background/tests$ phablet-test-run customLoading tests from: /home/phablet/autopilot

Tests running...
======================================================================
FAIL: custom.api.test_scopes.ScopeVerificationTest.test_scope_customization_running_process
----------------------------------------------------------------------
Empty attachments:
/var/log/syslog

Traceback (most recent call last):
File "/home/phablet/autopilot/custom/api/test_scopes.py", line 41, in test_scope_customization_running_process
self.assertTrue(any(scope in proc for proc in proc_cmd_list))
File "/usr/lib/python3.4/unittest/case.py", line 654, in assertTrue
raise self.failureException(msg)
AssertionError: False is not true
======================================================================
FAIL: custom.api.test_custom_upstartjobs.CustomjobsVerificationTests.test_custom_upstartjobs_running_process
----------------------------------------------------------------------
Empty attachments:
/var/log/syslog

Traceback (most recent call last):
File "/home/phablet/autopilot/custom/api/test_custom_upstartjobs.py", line 38, in test_custom_upstartjobs_running_process
self.assertTrue(any(job in proc for proc in proc_cmd_list))
File "/usr/lib/python3.4/unittest/case.py", line 654, in assertTrue
raise self.failureException(msg)
AssertionError: False is not true

Ran 20 tests in 1.406s
FAILED (failures=2)

15. By Ethan Chang

*Modify test_custom_upstartjobs.py that to check if custom upstart jobs installed correctly
*Modify test_scopes.py that to check if scopes are installed and can be running

Revision history for this message
Ethan Chang (ethan.chang) wrote :

I have fixed the error of both test_custom_upstartjobs.py and test_scope.py.
I tested on a N4 and didn't see any error.
1. Test_custom_upstartjobs.py will check whether custom upstart jobs are running or not.
2. Test_scope,py will check whether scopes are running or not.

Revision history for this message
Chris Wayne (cwayne) wrote :

Loading tests from: /home/phablet/autopilot

Tests running...
The custom upstart job not running under background
The scopes installed but not running

Ran 20 tests in 1.923s
OK

Looking a lot better, but we shouldn't be printing anything to stdout while testing, so please remove the prints that have been added. Also some of the tests added have commented out code which should be removed

review: Needs Fixing
16. By Ethan Chang

*Remove comments and printing stdout from both test_scope.py and test custom_upstartjobs.py

Revision history for this message
Ethan Chang (ethan.chang) wrote :

As Chris mentioned, I have removed the printing stout code and several comments.
Please help to review again, thanks!

Revision history for this message
Chris Wayne (cwayne) wrote :

There's not a running process started by welcome-background is there?

Revision history for this message
Chris Wayne (cwayne) wrote :

One more thing that occurred to me is that we would want this documented as well, could you add some documentation to this MP? Alex Tu can help you get started if needed, he just went through this with the search provider :)

Revision history for this message
Ethan Chang (ethan.chang) wrote :

Hi Chris,
Sorry, I am not very sure what you mean?
My understand is that welcome-background will start a process and then close after set welcome.png.
Please point me if something I missed.

BTw I have modify the document and will update it after this fixed. Thanks

Revision history for this message
Chris Wayne (cwayne) wrote :

So basically lines 61-73 of the diff (the test_custom_upstart_running_process) isn't really testing anything here, because the process is gone well before this test is run, so won't show up in the process list. This test would be better for some daemon or something started by upstart (which we don't have at the moment), so I'd say for now that test should be removed. Once that's done + the documentation is pushed, we should be good to go

17. By Ethan Chang

*Remove test_custom_upstart_running_process off the test_custom_upstartjobs.py
*Updated api.rst document

Revision history for this message
Ethan Chang (ethan.chang) wrote :

Chris,
Thank you for your suggestion.
I have removed the code and update the document.
Please help to check again, thanks!

Revision history for this message
Chris Wayne (cwayne) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches