Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wptrunner] Fix support for --binary-arg in Fx #13154

Merged
merged 2 commits into from
Sep 24, 2018

Conversation

jugglinmike
Copy link
Contributor

In order to automate Firefox, wptrunner requires the browser's internal
module "Marionette" to be enabled. This is a requirement regardless of
any custom configuration specified by the user, including additional
command-line flags via the --binary-arg argument.

Previously, this project would omit the -marionette argument in the
presence of any user-specified arguments. Because this interferes with
normal operation (and because the source code is formatted in a way that
conflicts with the order of operations), this is likely an unintentional
behavior.

Modify the code which derives the command-line arguments to always
include the -marionette argument.

In order to automate Firefox, wptrunner requires the browser's internal
module "Marionette" to be enabled. This is a requirement regardless of
any custom configuration specified by the user, including additional
command-line flags via the `--binary-arg` argument.

Previously, this project would omit the `-marionette` argument in the
presence of any user-specified arguments. Because this interferes with
normal operation (and because the source code is formatted in a way that
conflicts with the order of operations), this is likely an unintentional
behavior.

Modify the code which derives the command-line arguments to always
include the `-marionette` argument.
@wpt-pr-bot wpt-pr-bot added infra wpt wptrunner The automated test runner, commonly called through ./wpt run labels Sep 21, 2018
jugglinmike added a commit to bocoup/wpt that referenced this pull request Sep 21, 2018
Also include `-marionette` in order to work around a known bug in the
WPT CLI [1].

[1] web-platform-tests#13154
jugglinmike added a commit to bocoup/wpt that referenced this pull request Sep 21, 2018
Include additional arguments to work around a known bug in the WPT CLI:

web-platform-tests#13154
@pytest.mark.remote_network
@pytest.mark.xfail(sys.platform == "win32",
reason="Tests currently don't work on Windows for path reasons")
def test_run_firefox_binary_args(manifest_dir):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this test is pretty heavyweight for what it does. Can we fold it into another test, or just add an assert to the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I've extended the previous test and inserted a comment to explain the consideration we're making here.

@@ -251,9 +251,11 @@ def start(self, group_metadata=None, **kwargs):
if self.ca_certificate_path is not None:
self.setup_ssl()

args = self.binary_args[:] if self.binary_args else []
args += [cmd_arg("marionette"), "about:blank"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we possibly want to check for duplicate arguments. It doesn't make much difference, but is a little cleaner.

If not any(item.strip("-/") == "marionette" for item in args):
  args += "--marionette"

Just appending about:blank is probably fine, although we might worry about args not starting with --, - or /, which would be interpreted as URLs and could in some future hypothetically start opening multiple tabs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have a utility that's designated for creation of CLI arguments, I'd rather incorporate that:

marionette_flag = cmd_arg("marionette")
if not any(item == marionette_flag for item in args):
    args.append(marionette_flag)

...but I don't think this discussion should delay the bug fix. I'm also not sure how to relate the new behavior to the fix in the commit message. What do you think about deferring this for a follow-up patch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't work because multiple variants are supported. The Firefox command line parser is something quite… special.

I'm OK on this not delaying the fix though.

@jgraham jgraham merged commit 3a749a1 into web-platform-tests:master Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra wpt wptrunner The automated test runner, commonly called through ./wpt run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants