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

Extract Safari version from safaridriver #13467

Merged
merged 4 commits into from
Nov 2, 2018
Merged

Conversation

foolip
Copy link
Member

@foolip foolip commented Oct 11, 2018

No description provided.

Copy link
Member Author

@foolip foolip left a comment

Choose a reason for hiding this comment

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

This sort of works but is only half done. Sent out with comments hoping that @jgraham or @jugglinmike might have ideas. For what's left a mystery I will dig in myself :)

output = output[14:]
return output
except subprocess.CalledProcessError:
# TODO stderr gets printed :'(
Copy link
Member Author

Choose a reason for hiding this comment

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

I've found that call doesn't suppress stderr and just prints it instead. This isn't great because this is expected to fail on every safaridriver before STP 67, notable including Safari 12 stable. Should I just change call to return a stdout,stderr tuple?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's surprising; it looks like it calls subprocess.checkou_output with no arguments. I would suggest making it take **kwargs and passing those down to the caller so you can redirect stderr to /dev/null or whatever.

tools/wpt/browser.py Outdated Show resolved Hide resolved
except subprocess.CalledProcessError:
# TODO stderr gets printed :'(
pass
# TODO: this message doesn't show up anywhere
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know why this, is the logger not wired up correctly?

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 the logger handler gets wired up late, but we should probably fix that.

tools/wpt/browser.py Outdated Show resolved Hide resolved
@foolip
Copy link
Member Author

foolip commented Oct 23, 2018

Needs to be rebased on top of #13642 now.

@foolip foolip force-pushed the foolip/safari-version branch from 3e6d406 to a35a216 Compare October 23, 2018 22:42
@Hexcles
Copy link
Member

Hexcles commented Oct 30, 2018

@foolip could your rebase this and fix the unit tests?

@foolip foolip force-pushed the foolip/safari-version branch from a35a216 to 75f0e0a Compare November 1, 2018 20:54
@foolip
Copy link
Member Author

foolip commented Nov 2, 2018

Alright, this finally works! A snippet from a wpt_report.json produced locally:

    "run_info": {
        "bits": 64,
        "browser_channel": "preview",
        "browser_version": "Technology Preview (Release 68, 13607.1.11)",
        "debug": false,
        "has_sandbox": true,
        "os": "mac",
        "os_version": "10.13",
        "processor": "x86_64",
        "product": "safari_webdriver",
        "revision": "eb59233bf287cd7391926719bcfc9bf9f4e02a20",
        "verify": false,
        "version": "OS X 10.13.6",
        "wasm": false
    }

(It works when using --webdriver-binary instead of --channel too, but then "browser_channel" won't be present. That's why it's a good idea to include "Technology Preview" in the output.)

@jgraham jgraham merged commit bd9dbc0 into master Nov 2, 2018
@foolip foolip deleted the foolip/safari-version branch November 2, 2018 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants