Merge lp:~asac/unity8/fix-system-integration-test-type-error into lp:unity8

Proposed by Alexander Sack
Status: Merged
Approved by: Michał Sawicz
Approved revision: 822
Merged at revision: 829
Proposed branch: lp:~asac/unity8/fix-system-integration-test-type-error
Merge into: lp:unity8
Diff against target: 10 lines (+1/-1)
1 file modified
tests/autopilot/unity8/shell/tests/test_system_integration.py (+1/-1)
To merge this branch: bzr merge lp:~asac/unity8/fix-system-integration-test-type-error
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Albert Astals Cid (community) Approve
Review via email: mp+214458@code.launchpad.net

Commit message

Fix TypeError: issue seen in system_integration autopilot test on image 279.

Description of the change

Fix TypeError: issue seen during image autopilot test on image 279.

http://ci.ubuntu.com/smokeng/trusty/touch/mako/279:20140406:20140331/7580/unity8/985487/

Traceback (most recent call last):
  File "/home/phablet/autopilot/unity8/shell/tests/test_system_integration.py", line 41, in test_networkmanager_integration
    subprocess.check_call("pkcheck --action-id org.freedesktop.NetworkManager.enable-disable-network --process " + pid, shell=True)
TypeError: Can't convert 'bytes' object to str implicitly

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:822
http://jenkins.qa.ubuntu.com/job/unity8-ci/2738/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/45
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4540
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1608
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1259
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1263
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1263/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1259
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/51
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4145
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4145/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5665
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3921
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4655
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4655/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2738/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

I've tried the proposed patch, when run under autopilot the test still works as it did, when run under autopilot3 it no longer fails in the way it did but still does not suceed.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/unity8/shell/tests/test_system_integration.py", line 41, in test_networkmanager_integration
    subprocess.check_call("pkcheck --action-id org.freedesktop.NetworkManager.enable-disable-network --process " + str(pid), shell=True)
  File "/usr/lib/python3.4/subprocess.py", line 557, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'pkcheck --action-id org.freedesktop.NetworkManager.enable-disable-network --process b'5058\n'' returned non-zero exit status 126

review: Needs Fixing
Revision history for this message
Alexander Sack (asac) wrote :

repushed branch with str (pid, 'utf-8').

Revision history for this message
Albert Astals Cid (aacid) wrote :

* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, test now passes in autopilot and autopilot3

* Did CI run pass? If not, please explain why.
No, unrelated failure.

review: Approve
Revision history for this message
Alexander Sack (asac) wrote :

Saciq pointed out that this is not compatible with python2 ... i repushed another variant using .decode...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:822
http://jenkins.qa.ubuntu.com/job/unity8-ci/2741/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/66
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4572
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1611
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1262
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1266
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1266/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1262
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/68
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4173
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4173/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5699
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3939
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4690
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4690/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2741/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Colin Watson (cjwatson) wrote :

I would suggest instead using this idiom in the previous line:

  pid = subprocess.check_output(["pidof", "-s", "unity8"], universal_newlines=True)

This returns text (i.e. an object of type str which is +-compatible with "...") in both Python 2 and 3, and then you won't need either str() or the .decode() call.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:822
http://jenkins.qa.ubuntu.com/job/unity8-ci/2747/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/81
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4595
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1617
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1268
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1272
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1272/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1268
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/81
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4190
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4190/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5727
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3957
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4719
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4719/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2747/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Alexander Sack (asac) wrote :

updated using colins approach; tested the pattern manually on python2 and python3 and seems it works. yay!

Revision history for this message
Michał Sawicz (saviq) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/unity8/shell/tests/test_system_integration.py'
2--- tests/autopilot/unity8/shell/tests/test_system_integration.py 2014-03-21 15:17:22 +0000
3+++ tests/autopilot/unity8/shell/tests/test_system_integration.py 2014-04-09 17:31:42 +0000
4@@ -37,5 +37,5 @@
5 self.launch_unity()
6
7 # invoke policykit to check permissions
8- pid = subprocess.check_output("pidof -s unity8", shell=True)
9+ pid = subprocess.check_output(["pidof", "-s", "unity8"], universal_newlines=True)
10 subprocess.check_call("pkcheck --action-id org.freedesktop.NetworkManager.enable-disable-network --process " + pid, shell=True)

Subscribers

People subscribed via source and target branches