Bug 1370936 - Skip directories when updating metdata, r=ato
MozReview-Commit-ID: HLFo9vhYS8p
--- 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")