Skip to content

Commit

Permalink
Pass Text instead of full kwargs dict
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmcgruer committed Aug 14, 2020
1 parent 7d62f0c commit d42d22d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions tools/ci/tc/github_checks_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ def output(self, line):


__outputter = None
def get_gh_checks_outputter(kwargs):
# type: (Dict[Text, Text]) -> Optional[GitHubChecksOutputter]
def get_gh_checks_outputter(filepath):
# type: (Optional[Text]) -> Optional[GitHubChecksOutputter]
"""Return the outputter for GitHub Checks output, if enabled.
:param kwargs: The arguments passed to the program (to look for the
--github_checks_text_file flag)
:param filepath: The filepath to write GitHub Check output information to,
or None if not enabled.
"""
global __outputter
if kwargs['github_checks_text_file'] and __outputter is None:
__outputter = GitHubChecksOutputter(kwargs['github_checks_text_file'])
if filepath and __outputter is None:
__outputter = GitHubChecksOutputter(filepath)
return __outputter
2 changes: 1 addition & 1 deletion tools/lint/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ def main(**kwargs_str):

ignore_glob = kwargs.get("ignore_glob", [])

github_checks_outputter = get_gh_checks_outputter(kwargs)
github_checks_outputter = get_gh_checks_outputter(kwargs["github_checks_text_file"])

return lint(repo_root, paths, output_format, ignore_glob, github_checks_outputter)

Expand Down
2 changes: 1 addition & 1 deletion tools/wptrunner/wptrunner/stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def check_stability(logger, repeat_loop=10, repeat_restart=5, chaos_mode=True, m
start_time = datetime.now()
step_results = []

github_checks_outputter = get_gh_checks_outputter(kwargs)
github_checks_outputter = get_gh_checks_outputter(kwargs["github_checks_text_file"])

for desc, step_func in steps:
if max_time and datetime.now() - start_time > max_time:
Expand Down
4 changes: 2 additions & 2 deletions tools/wptrunner/wptrunner/wptcommandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import OrderedDict
from distutils.spawn import find_executable
from datetime import timedelta
from six import iterkeys, itervalues, iteritems
from six import ensure_text, iterkeys, itervalues, iteritems

from . import config
from . import wpttest
Expand Down Expand Up @@ -350,7 +350,7 @@ def create_parser(product_choices=None):

taskcluster_group = parser.add_argument_group("Taskcluster-specific")
taskcluster_group.add_argument("--github-checks-text-file",
dest="github_checks_text_file",
type=ensure_text,
help="Path to GitHub checks output file")

webkit_group = parser.add_argument_group("WebKit-specific")
Expand Down

0 comments on commit d42d22d

Please sign in to comment.