Skip to content

Commit 48a52e5

Browse files
committed
[build] only update test files if the version is in stable channel
1 parent 3e6dbeb commit 48a52e5

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

scripts/update_cdp.py

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@
1414
http = urllib3.PoolManager()
1515
root_dir = Path(os.path.realpath(__file__)).parent.parent
1616

17+
"""This is the same method from pinned_browser. Use --chrome_channel=Beta if
18+
using early stable release."""
19+
parser = argparse.ArgumentParser()
20+
parser.add_argument(
21+
"--chrome_channel", default="Stable", help="Set the Chrome channel"
22+
)
23+
args = parser.parse_args()
24+
channel = args.chrome_channel
1725

1826
def get_chrome_milestone():
19-
"""This is the same method from pinned_browser. Use --chrome_channel=Beta if
20-
using early stable release."""
21-
parser = argparse.ArgumentParser()
22-
parser.add_argument(
23-
"--chrome_channel", default="Stable", help="Set the Chrome channel"
24-
)
25-
args = parser.parse_args()
26-
channel = args.chrome_channel
27-
2827
r = http.request(
2928
"GET",
3029
f"https://chromiumdash.appspot.com/fetch_releases?channel={channel}&num=1&platform=Mac,Linux",
@@ -195,16 +194,12 @@ def update_dotnet(chrome_milestone):
195194
file, old_chrome(chrome_milestone), new_chrome(chrome_milestone)
196195
)
197196

198-
files = [
199-
root_dir / "dotnet/test/common/CustomDriverConfigs/StableChannelChromeDriver.cs"
200-
]
201-
dir_path = root_dir / "dotnet/test/common/DevTools"
202-
files.extend(str(file) for file in dir_path.glob("*") if file.is_file())
203-
for file in files:
204-
replace_in_file(
205-
file, previous_chrome(chrome_milestone), new_chrome(chrome_milestone)
206-
)
207-
197+
if channel == "Stable":
198+
dir_path = root_dir / "dotnet/test/common/DevTools"
199+
for file in dir_path.glob("*") if file.is_file()
200+
replace_in_file(
201+
file, previous_chrome(chrome_milestone), new_chrome(chrome_milestone)
202+
)
208203

209204
def update_ruby(chrome_milestone):
210205
file = root_dir / "rb/lib/selenium/devtools/BUILD.bazel"

0 commit comments

Comments
 (0)