Adding OS Release and OS Build info to the run_info for Edge (#15992)
diff --git a/tools/wptrunner/wptrunner/browsers/edge.py b/tools/wptrunner/wptrunner/browsers/edge.py
index 2530961..027c8f8 100644
--- a/tools/wptrunner/wptrunner/browsers/edge.py
+++ b/tools/wptrunner/wptrunner/browsers/edge.py
@@ -1,4 +1,5 @@
from __future__ import print_function
+import subprocess
from .base import Browser, ExecutorBrowser, require_arg
from ..webdriver_server import EdgeDriverServer
from ..executors import executor_kwargs as base_executor_kwargs
@@ -16,6 +17,7 @@
"executor_kwargs": "executor_kwargs",
"env_extras": "env_extras",
"env_options": "env_options",
+ "run_info_extras": "run_info_extras",
"timeout_multiplier": "get_timeout_multiplier"}
@@ -97,3 +99,17 @@
def executor_browser(self):
return ExecutorBrowser, {"webdriver_url": self.server.url}
+
+
+def run_info_extras(**kwargs):
+ osReleaseCommand = "(Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion').ReleaseId"
+ osBuildCommand = "(Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion').BuildLabEx"
+ try:
+ os_release = subprocess.check_output(["powershell.exe", osReleaseCommand]).strip()
+ os_build = subprocess.check_output(["powershell.exe", osBuildCommand]).strip()
+ except (subprocess.CalledProcessError, OSError):
+ return {}
+
+ rv = {"os_build": os_build,
+ "os_release": os_release}
+ return rv