Skip to content

Commit

Permalink
Adding OS Release and OS Build info to the run_info for Edge (#15992)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleyhon authored and gsnedders committed Mar 26, 2019
1 parent b1a2ae2 commit 9925422
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tools/wptrunner/wptrunner/browsers/edge.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"}


Expand Down Expand Up @@ -97,3 +99,17 @@ def cleanup(self):

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

0 comments on commit 9925422

Please sign in to comment.