From cdefe67b38c4ae7210fe2829fb8f5a1ad7f3e95d Mon Sep 17 00:00:00 2001 From: Ben Segall Date: Wed, 17 May 2023 13:44:04 +0000 Subject: [PATCH] Add exe suffix to reclient commands Bug: b/250643500 Change-Id: I5da88a0a1c8d3797a2c553c4ab06f713c2853607 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4539481 Reviewed-by: Ramy Medhat Commit-Queue: Ben Segall --- reclient_helper.py | 8 +++++--- tests/ninja_reclient_test.py | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/reclient_helper.py b/reclient_helper.py index 1570d4953..cbe8623c0 100644 --- a/reclient_helper.py +++ b/reclient_helper.py @@ -45,15 +45,17 @@ def run(cmd_args): def start_reproxy(reclient_cfg, reclient_bin_dir): return run([ - os.path.join(reclient_bin_dir, 'bootstrap'), - '--re_proxy=' + os.path.join(reclient_bin_dir, 'reproxy'), + os.path.join(reclient_bin_dir, + 'bootstrap' + gclient_paths.GetExeSuffix()), '--re_proxy=' + + os.path.join(reclient_bin_dir, 'reproxy' + gclient_paths.GetExeSuffix()), '--cfg=' + reclient_cfg ]) def stop_reproxy(reclient_cfg, reclient_bin_dir): return run([ - os.path.join(reclient_bin_dir, 'bootstrap'), '--shutdown', + os.path.join(reclient_bin_dir, + 'bootstrap' + gclient_paths.GetExeSuffix()), '--shutdown', '--cfg=' + reclient_cfg ]) diff --git a/tests/ninja_reclient_test.py b/tests/ninja_reclient_test.py index 1aa6494fc..7571550e7 100755 --- a/tests/ninja_reclient_test.py +++ b/tests/ninja_reclient_test.py @@ -13,6 +13,7 @@ import unittest.mock ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, ROOT_DIR) +import gclient_paths import ninja_reclient from testing_support import trial_dir @@ -92,12 +93,15 @@ class NinjaReclientTest(trial_dir.TestCase): mock_call.assert_has_calls([ unittest.mock.call([ os.path.join(self.root_dir, reclient_bin_dir, - 'bootstrap'), "--re_proxy=" + - os.path.join(self.root_dir, reclient_bin_dir, 'reproxy'), + 'bootstrap' + gclient_paths.GetExeSuffix()), + "--re_proxy=" + + os.path.join(self.root_dir, reclient_bin_dir, + 'reproxy' + gclient_paths.GetExeSuffix()), "--cfg=" + os.path.join(self.root_dir, reclient_cfg) ]), unittest.mock.call([ - os.path.join(self.root_dir, reclient_bin_dir, 'bootstrap'), + os.path.join(self.root_dir, reclient_bin_dir, + 'bootstrap' + gclient_paths.GetExeSuffix()), "--shutdown", "--cfg=" + os.path.join(self.root_dir, reclient_cfg) ]), ]) @@ -120,12 +124,15 @@ class NinjaReclientTest(trial_dir.TestCase): mock_call.assert_has_calls([ unittest.mock.call([ os.path.join(self.root_dir, reclient_bin_dir, - 'bootstrap'), "--re_proxy=" + - os.path.join(self.root_dir, reclient_bin_dir, 'reproxy'), + 'bootstrap' + gclient_paths.GetExeSuffix()), + "--re_proxy=" + + os.path.join(self.root_dir, reclient_bin_dir, + 'reproxy' + gclient_paths.GetExeSuffix()), "--cfg=" + os.path.join(self.root_dir, reclient_cfg) ]), unittest.mock.call([ - os.path.join(self.root_dir, reclient_bin_dir, 'bootstrap'), + os.path.join(self.root_dir, reclient_bin_dir, + 'bootstrap' + gclient_paths.GetExeSuffix()), "--shutdown", "--cfg=" + os.path.join(self.root_dir, reclient_cfg) ]), ])