Skip to content

Commit

Permalink
Fix reproduce file formatting (use flow style)
Browse files Browse the repository at this point in the history
Set flow style (JSON-like) explicitly instead of block style to don't
break indentation.

Before the patch (incorrect):

 | - - app-tap/iconv.test.lua
 | - null

After the patch:

 | - [app-tap/iconv.test.lua, null]

The default was changed in [1].

[1]: yaml/pyyaml#256
  • Loading branch information
Totktonada committed Sep 14, 2020
1 parent f0a3bd3 commit 461731d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ def report_undone(self, verbose):
'queue, but were not reported as done (does not matters '
'success or fail):\n', schema='test_var')
for task_id in undone:
color_stdout('- %s' % yaml.safe_dump(task_id))
task_id_str = yaml.safe_dump(task_id, default_flow_style=True)
color_stdout('- %s' % task_id_str)
else:
# Visually continue StatisticsWatcher.print_statistics() output.
color_stdout('* undone: %d\n' % len(undone), schema='test_var')
Expand Down
3 changes: 2 additions & 1 deletion lib/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ def run_task(self, task_id):
try:
task = self.find_task(task_id)
with open(self.reproduce_file, 'a') as f:
f.write('- ' + yaml.safe_dump(task.id))
task_id_str = yaml.safe_dump(task.id, default_flow_style=True)
f.write('- ' + task_id_str)
short_status = self.suite.run_test(
task, self.server, self.inspector)
except KeyboardInterrupt:
Expand Down
3 changes: 2 additions & 1 deletion listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def print_statistics(self):
color_stdout('Failed tasks:\n', schema='test_var')
for task_id, worker_name, show_reproduce_content in self.failed_tasks:
logfile = self.get_logfile(worker_name)
color_stdout('- %s' % yaml.safe_dump(task_id), schema='test_var')
task_id_str = yaml.safe_dump(task_id, default_flow_style=True)
color_stdout('- %s' % task_id_str, schema='test_var')
color_stdout('# logfile: %s\n' % logfile)
reproduce_file_path = get_reproduce_file(worker_name)
color_stdout('# reproduce file: %s\n' % reproduce_file_path)
Expand Down

0 comments on commit 461731d

Please sign in to comment.