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

Useful scripts for interacting with WPT logs #24841

Merged
merged 10 commits into from Nov 23, 2019

Add a script to extra logs for particular test filenames from full WP…

…T logs.
  • Loading branch information
jdm committed Nov 22, 2019
commit a634d90e4ac80027466782975007de33afcb4c28
@@ -0,0 +1,37 @@
#!/usr/bin/env python

# Copyright 2019 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.

import sys
import json

full_search = len(sys.argv) > 3 and sys.argv[3] == '--full'

with open(sys.argv[1]) as f:
data = f.readlines()
thread = None
for entry in data:
entry = json.loads(entry)
if thread and "thread" in entry:
if entry["thread"] == thread:
print(json.dumps(entry))
This conversation was marked as resolved by jdm

This comment has been minimized.

Copy link
@Manishearth

Manishearth Nov 22, 2019

Member

won't this skip test_starts from other threads?

This comment has been minimized.

Copy link
@jdm

jdm Nov 22, 2019

Author Member

I'm not sure I understand the concern here. The purpose of this script is to extract the output of a single test, so we don't care about other test_start events.

This comment has been minimized.

Copy link
@Manishearth

Manishearth Nov 22, 2019

Member

oh! i think i hadn't fully understood that part

if "action" in entry and entry["action"] == "test_end":
thread = None
else:
if "action" in entry and \
entry["action"] == "test_start" and \
entry["test"] == sys.argv[2]:
thread = entry["thread"]
print(json.dumps(entry))
elif full_search and \
"command" in entry and \
sys.argv[2] in entry["command"]:
thread = entry["thread"]
print(json.dumps(entry))
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.