Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add a script to extra logs for particular test filenames from full WP…
…T logs.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)) | ||
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)) |