Add a script for filtering failed tck scenarios
Reviewers: buda, mislav.bradac, matej.gradicek Reviewed By: buda, mislav.bradac, matej.gradicek Differential Revision: https://phabricator.memgraph.io/D361
This commit is contained in:
parent
d29c38f6fd
commit
cee2405f85
28
filter_failing_scenarios
Executable file
28
filter_failing_scenarios
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
'''
|
||||||
|
Filters failing scenarios from a tck test run and prints them to stdout.
|
||||||
|
'''
|
||||||
|
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def main():
|
||||||
|
argp = ArgumentParser(description=__doc__)
|
||||||
|
argp.add_argument('test_log', metavar='TEST_LOG', type=str,
|
||||||
|
help='Path to the log of a tck test run')
|
||||||
|
args = argp.parse_args()
|
||||||
|
with open(args.test_log) as f:
|
||||||
|
scenario_failed = False
|
||||||
|
scenario_lines = []
|
||||||
|
for line in f:
|
||||||
|
if line.strip().startswith('Scenario:'):
|
||||||
|
if scenario_failed:
|
||||||
|
print(''.join(scenario_lines))
|
||||||
|
scenario_failed = False
|
||||||
|
scenario_lines.clear()
|
||||||
|
if line.strip().startswith('AssertionError'):
|
||||||
|
scenario_failed = True
|
||||||
|
scenario_lines.append(line)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
Loading…
Reference in New Issue
Block a user