Bug 1370936 - Skip directories when updating metdata, r=ato draft
authorJames Graham <james@hoppipolla.co.uk>
Fri, 16 Jun 2017 10:45:55 +0100
changeset 595541 2b950ddd6e51800e7c8f33079109f0cf0b2676a8
parent 595540 5492fff7041db7107a51330d414e24cdf486368b
child 633711 97e29356dd060217dd77ae73d525eacf31539c49
push id64345
push userbmo:james@hoppipolla.co.uk
push dateFri, 16 Jun 2017 10:22:22 +0000
reviewersato
bugs1370936
milestone56.0a1
Bug 1370936 - Skip directories when updating metdata, r=ato MozReview-Commit-ID: HLFo9vhYS8p
testing/web-platform/mach_commands.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
testing/web-platform/update/updatecommandline.py
--- a/testing/web-platform/mach_commands.py
+++ b/testing/web-platform/mach_commands.py
@@ -148,17 +148,17 @@ class WebPlatformTestsUpdater(MozbuildOb
 
         if kwargs["sync"]:
             if not kwargs["exclude"]:
                 kwargs["exclude"] = ["css/*"]
             if not kwargs["include"]:
                 kwargs["include"] = ["css/css-timing-1/*", "css/css-animations-1/*", "css/css-transitions-1/*"]
 
 
-        updatecommandline.check_args(kwargs)
+        kwargs = updatecommandline.check_args(kwargs)
         logger = update.setup_logging(kwargs, {"mach": sys.stdout})
 
         try:
             update.run_update(logger, **kwargs)
         except Exception:
             import pdb
             import traceback
             traceback.print_exc()
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
@@ -392,16 +392,23 @@ def check_args(kwargs):
 def check_args_update(kwargs):
     set_from_config(kwargs)
 
     if kwargs["product"] is None:
         kwargs["product"] = "firefox"
     if kwargs["patch"] is None:
         kwargs["patch"] = kwargs["sync"]
 
+    for item in kwargs["run_log"]:
+        if os.path.isdir(item):
+            print >> sys.stderr, "Log file %s is a directory" % item
+            sys.exit(1)
+
+    return kwargs
+
 
 def create_parser_update(product_choices=None):
     from mozlog.structured import commandline
 
     import products
 
     if product_choices is None:
         config_data = config.load()
--- a/testing/web-platform/update/updatecommandline.py
+++ b/testing/web-platform/update/updatecommandline.py
@@ -14,17 +14,17 @@ def create_parser():
                         help="Path to file containing github token")
     parser.add_argument("--token", action="store", help="GitHub token to use")
     return parser
 
 
 def check_args(kwargs):
     from wptrunner import wptcommandline
 
-    wptcommandline.set_from_config(kwargs)
+    kwargs = wptcommandline.check_args_update(kwargs)
     kwargs["upstream"] = kwargs["upstream"] if kwargs["upstream"] is not None else kwargs["sync"]
 
     if kwargs["upstream"]:
         if kwargs["rev"]:
             raise ValueError("Setting --rev with --upstream isn't supported")
         if kwargs["token"] is None:
             if kwargs["token_file"] is None:
                 raise ValueError("Must supply either a token file or a token")