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

Issue 2143123004: Access environment variables through Host object instead of directly. (Closed)

Created:
4 years, 5 months ago by qyearsley
Modified:
4 years, 5 months ago
Reviewers:
Dirk Pranke, mithro
CC:
blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Access environment variables through Host object instead of directly. This makes it easier to test interactions with os.environ without affecting or using actual environment variables in tests. This CL doesn't change places where os.environ is used where there is no Host object. BUG=627887 Committed: https://crrev.com/dfec6156c3e17e698acff95a6558dcecaddef761 Cr-Commit-Position: refs/heads/master@{#405680}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Make environ a member of host. #

Patch Set 3 : Rebased and updated after change for dummy home dir on linux. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -121 lines) Patch
M third_party/WebKit/Tools/Scripts/webkitpy/common/host.py View 1 2 chunks +4 lines, -5 lines 0 comments Download
D third_party/WebKit/Tools/Scripts/webkitpy/common/system/environment.py View 1 chunk +0 lines, -36 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py View 1 2 chunks +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost_mock.py View 1 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/breakpad/dump_reader_win.py View 1 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android.py View 1 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py View 1 5 chunks +6 lines, -15 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py View 1 2 4 chunks +5 lines, -7 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py View 1 2 3 chunks +4 lines, -14 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py View 1 2 chunks +8 lines, -16 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/win.py View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py View 1 2 chunks +3 lines, -6 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py View 1 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py View 1 2 2 chunks +1 line, -2 lines 0 comments Download

Messages

Total messages: 19 (8 generated)
qyearsley
4 years, 5 months ago (2016-07-13 18:24:41 UTC) #2
Dirk Pranke
Good idea, but this can be even simpler, see my suggestion below. https://codereview.chromium.org/2143123004/diff/1/third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py File third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py ...
4 years, 5 months ago (2016-07-14 19:28:13 UTC) #3
qyearsley
https://codereview.chromium.org/2143123004/diff/1/third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py File third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py (right): https://codereview.chromium.org/2143123004/diff/1/third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py#newcode47 third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py:47: self.stderr = sys.stderr On 2016/07/14 at 19:28:13, Dirk Pranke ...
4 years, 5 months ago (2016-07-14 19:52:58 UTC) #5
Dirk Pranke
On 2016/07/14 19:52:58, qyearsley wrote: > https://codereview.chromium.org/2143123004/diff/1/third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py > File third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py > (right): > > https://codereview.chromium.org/2143123004/diff/1/third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py#newcode47 ...
4 years, 5 months ago (2016-07-14 20:00:53 UTC) #7
qyearsley
On 2016/07/14 at 20:00:53, dpranke wrote: > On 2016/07/14 19:52:58, qyearsley wrote: > > https://codereview.chromium.org/2143123004/diff/1/third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost.py ...
4 years, 5 months ago (2016-07-14 22:42:59 UTC) #10
Dirk Pranke
lgtm
4 years, 5 months ago (2016-07-14 23:05:31 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2143123004/40001
4 years, 5 months ago (2016-07-14 23:51:26 UTC) #13
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 5 months ago (2016-07-15 02:25:47 UTC) #14
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-15 02:26:02 UTC) #15
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/dfec6156c3e17e698acff95a6558dcecaddef761 Cr-Commit-Position: refs/heads/master@{#405680}
4 years, 5 months ago (2016-07-15 02:27:50 UTC) #17
mithro
4 years, 5 months ago (2016-07-18 01:24:16 UTC) #19
Message was sent while issue was closed.
On 2016/07/15 02:27:50, commit-bot: I haz the power wrote:
> Patchset 3 (id:??) landed as
> https://crrev.com/dfec6156c3e17e698acff95a6558dcecaddef761
> Cr-Commit-Position: refs/heads/master@{#405680}

Generally LGTM.

My one concern here is that os.environ object is "dictionary like" rather than
being a normal dictionary. There are a couple of things which *should* work
using os.environ that don't :( - Not really sure how to fix that though.

Powered by Google App Engine
This is Rietveld 408576698