Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Issue 659533002: New run shell implementation for DeviceUtils (Closed)

Created:
6 years, 2 months ago by perezju
Modified:
6 years, 2 months ago
Reviewers:
jbudorick
CC:
chromium-reviews, klundberg+watch_chromium.org, yfriedman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

New run shell implementation for DeviceUtils The main differences are: - it uses AdbWrapper.Shell to actually execute the command. - when the cmd is supplied as a list of a command and its arguments, the arguments are quoted to prevent them from being (mis)interpreted by the shell. - a new single_line option to check that the output produces contains a single line, and return the value of that line. BUG=267773 Committed: https://crrev.com/ab18bcca0cc1475cf381211e595e75c1146c9115 Cr-Commit-Position: refs/heads/master@{#300237}

Patch Set 1 #

Total comments: 12

Patch Set 2 : Restored timeout/retry wrapper, better shell exception #

Patch Set 3 : Rebase and fix conflicts #

Patch Set 4 : single implementation of RunShellCommand, added assertShellCall #

Patch Set 5 : fixed RunShellCommand call in instrumentation runner #

Total comments: 37

Patch Set 6 : some more fixes, replaced want_lines with want_value #

Patch Set 7 : forgot to add pylib/cmd_helper_test.py #

Total comments: 9

Patch Set 8 : fixed nit, and TODO to make cmd_helper_test run on bots #

Unified diffs Side-by-side diffs Delta from patch set Stats (+468 lines, -185 lines) Patch
M build/android/pylib/cmd_helper.py View 1 2 3 4 5 3 chunks +48 lines, -1 line 0 comments Download
A build/android/pylib/cmd_helper_test.py View 1 2 3 4 5 6 7 1 chunk +53 lines, -0 lines 0 comments Download
M build/android/pylib/device/adb_wrapper.py View 1 1 chunk +4 lines, -6 lines 0 comments Download
M build/android/pylib/device/adb_wrapper_test.py View 1 1 chunk +2 lines, -2 lines 0 comments Download
M build/android/pylib/device/device_errors.py View 1 2 3 4 5 1 chunk +14 lines, -1 line 0 comments Download
M build/android/pylib/device/device_utils.py View 1 2 3 4 5 6 7 13 chunks +104 lines, -52 lines 0 comments Download
M build/android/pylib/device/device_utils_test.py View 1 2 3 4 5 6 7 10 chunks +239 lines, -119 lines 0 comments Download
M build/android/pylib/instrumentation/test_runner.py View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M build/android/pylib/instrumentation/test_runner_test.py View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 14 (2 generated)
perezju
The tests also show some example usage, and I also included a sample implementation of ...
6 years, 2 months ago (2014-10-14 16:07:00 UTC) #2
jbudorick
This is definitely on the right track. Still thinking about doing this separately from _RunShellCommandImpl. ...
6 years, 2 months ago (2014-10-14 16:55:19 UTC) #3
perezju
Also added some notes on the DeviceUtils implementation doc. https://codereview.chromium.org/659533002/diff/1/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/659533002/diff/1/build/android/pylib/device/device_utils.py#newcode170 build/android/pylib/device/device_utils.py:170: ...
6 years, 2 months ago (2014-10-15 09:22:54 UTC) #4
jbudorick
https://codereview.chromium.org/659533002/diff/80001/build/android/pylib/cmd_helper.py File build/android/pylib/cmd_helper.py (right): https://codereview.chromium.org/659533002/diff/80001/build/android/pylib/cmd_helper.py#newcode25 build/android/pylib/cmd_helper.py:25: quote = pipes.quote I don't think I like this. ...
6 years, 2 months ago (2014-10-17 09:04:54 UTC) #5
perezju
Replying to comments. Will upload a new CL soon... https://codereview.chromium.org/659533002/diff/80001/build/android/pylib/cmd_helper.py File build/android/pylib/cmd_helper.py (right): https://codereview.chromium.org/659533002/diff/80001/build/android/pylib/cmd_helper.py#newcode27 build/android/pylib/cmd_helper.py:27: ...
6 years, 2 months ago (2014-10-17 11:17:09 UTC) #6
jbudorick
lgtm w/nit w.r.t. the name of "want_value" https://codereview.chromium.org/659533002/diff/80001/build/android/pylib/device/device_errors.py File build/android/pylib/device/device_errors.py (right): https://codereview.chromium.org/659533002/diff/80001/build/android/pylib/device/device_errors.py#newcode36 build/android/pylib/device/device_errors.py:36: 'adb shell ...
6 years, 2 months ago (2014-10-17 15:48:01 UTC) #7
perezju
https://codereview.chromium.org/659533002/diff/120001/build/android/pylib/device/device_errors.py File build/android/pylib/device/device_errors.py (right): https://codereview.chromium.org/659533002/diff/120001/build/android/pylib/device/device_errors.py#newcode37 build/android/pylib/device/device_errors.py:37: 'command %r on device failed with return code %d ...
6 years, 2 months ago (2014-10-17 16:11:12 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/659533002/140001
6 years, 2 months ago (2014-10-20 08:16:08 UTC) #10
commit-bot: I haz the power
Committed patchset #8 (id:140001)
6 years, 2 months ago (2014-10-20 09:35:55 UTC) #11
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/ab18bcca0cc1475cf381211e595e75c1146c9115 Cr-Commit-Position: refs/heads/master@{#300237}
6 years, 2 months ago (2014-10-20 09:36:34 UTC) #12
perezju
A revert of this CL (patchset #8 id:140001) has been created in https://codereview.chromium.org/666943002/ by perezju@chromium.org. ...
6 years, 2 months ago (2014-10-20 13:15:38 UTC) #13
jochen (gone - plz use gerrit)
6 years, 2 months ago (2014-10-20 13:20:43 UTC) #14
Message was sent while issue was closed.
A revert of this CL (patchset #8 id:140001) has been created in
https://codereview.chromium.org/670463002/ by jochen@chromium.org.

The reason for reverting is: Appears to break telemetry_perf_unittests.

Powered by Google App Engine
This is Rietveld 408576698