Skip to content

Commit 1bce351

Browse files
committed
ingest_mdir: dbg: support printing results for existing runs
Support printing results for existing runs for quicker testing of output format changes. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 67fd6c7 commit 1bce351

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

ingest_mdir.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
parser.add_argument('--tree-name', help='the tree name to expect')
4848
parser.add_argument('--result-dir',
4949
help='the directory where results will be generated')
50+
parser.add_argument('--dbg-print-run', help='print results of previous run')
5051

5152

5253
def get_console_width():
@@ -152,7 +153,7 @@ def print_summary_series(print_state, files, full_path, patch_id):
152153
print('', flush=True)
153154

154155

155-
def print_test_summary(args, series, print_state):
156+
def print_test_summary(args, series, print_state, tests=None):
156157
"""
157158
Report results based on files created by the tester in the filesystem.
158159
Track which files we have already as this function should be called
@@ -172,6 +173,10 @@ def print_test_summary(args, series, print_state):
172173
seen.add(full_path)
173174

174175
rel_path = full_path[len(args.result_dir) + 1:].split('/')
176+
test_name = os.path.basename(full_path)
177+
178+
if tests and test_name not in tests:
179+
continue
175180

176181
patch_id = -1
177182
if len(rel_path) == 3:
@@ -225,7 +230,10 @@ def run_tester(args, tree, series):
225230
def load_patches(args):
226231
""" Load patches from specified location on disk """
227232

228-
series_id = get_series_id(args.result_dir)
233+
if args.dbg_print_run is None:
234+
series_id = get_series_id(args.result_dir)
235+
else:
236+
series_id = int(args.dbg_print_run)
229237

230238
log_open_sec("Loading patches")
231239
try:
@@ -291,6 +299,10 @@ def main():
291299

292300
print_series_info(series)
293301

302+
if args.dbg_print_run:
303+
print_test_summary(args, series, {}, tests={'ynl', 'build_clang'})
304+
return
305+
294306
try:
295307
tree = Tree(tree_name, tree_name, args.tree, current_branch=True)
296308
except cmd.CmdError:

0 commit comments

Comments
 (0)