Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1288202 - Ignore malformed PERFHERDER_DATA lines (#1714)
Sometimes a non-valid PERFHERDER string can be found in a log because of debugging code or other reasons. There's no reason to not parse the rest of the log for a job if we find one of them.
- Loading branch information
Showing
2 changed files
with
21 additions
and
3 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,12 @@ | ||
from treeherder.log_parser.parsers import PerformanceParser | ||
|
||
|
||
def test_performance_log_parsing_malformed_perfherder_data(): | ||
""" | ||
If we have one malformed perfherder data line, we should just ignore | ||
it and still be able to parse the next one | ||
""" | ||
parser = PerformanceParser() | ||
parser.parse_line("PERFHERDER_DATA: {oh noes i am not valid json}", 1) | ||
parser.parse_line("PERFHERDER_DATA: {}", 2) | ||
assert parser.get_artifact() == [{}] |
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