Index: tools/android/loading/sandwich_runner.py |
diff --git a/tools/android/loading/sandwich_runner.py b/tools/android/loading/sandwich_runner.py |
index f8ca187885b416722a921e0a485e6250182bf04e..745a5841233638dae320784fe1ba5a57d37d5b5e 100644 |
--- a/tools/android/loading/sandwich_runner.py |
+++ b/tools/android/loading/sandwich_runner.py |
@@ -250,3 +250,24 @@ class SandwichRunner(object): |
self._PullCacheFromDevice() |
self._chrome_ctl = None |
+ |
+ |
+def IterRepeatedRuns(runner_output_dir): |
pasko
2016/05/31 13:00:33
naming:
this is a generator, so let's call it: Ge
gabadie
2016/05/31 14:33:01
WalkRepeatedRuns as agreed offline.
|
+ """Yields repeat_id, repeat_dir. |
pasko
2016/05/31 13:00:33
Let's add "Not ordered."
pasko
2016/05/31 13:00:33
s/repeat_dir/repeat_directory/
gabadie
2016/05/31 14:33:01
Line are not very wide and git -C tools/android/lo
gabadie
2016/05/31 14:33:02
Done.
pasko
2016/05/31 16:00:00
LOL, this was about the comment that fits into the
gabadie
2016/06/01 12:04:33
Oh my bad, I have not seen that this comment was a
|
+ |
+ Args: |
+ runner_output_dir: Same as for SandwichRunner.output_dir. |
+ """ |
+ repeated_run_count = 0 |
+ for node_name in os.listdir(runner_output_dir): |
+ repeat_dir = os.path.join(runner_output_dir, node_name) |
+ if not os.path.isdir(repeat_dir): |
+ continue |
+ try: |
+ repeat_id = int(node_name) |
+ except ValueError: |
+ continue |
+ yield repeat_id, repeat_dir |
+ repeated_run_count += 1 |
+ assert repeated_run_count > 0, ('Looks like \'{}\' was not a sandwich runner ' |
pasko
2016/05/31 13:00:33
nit: I prefer error messages to mention the import
gabadie
2016/05/31 14:33:01
Done.
|
+ 'output directory.').format(output_directory_path) |