From 099c7d84298c12db09979903720fa44c615e1f7b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 21 Jan 2014 09:55:24 +0000 Subject: Make step progress reporting nicer A count of all steps is nicer than separate scenario/step counts. --- yarn | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'yarn') diff --git a/yarn b/yarn index c3cba28..24e982b 100755 --- a/yarn +++ b/yarn @@ -109,9 +109,9 @@ class YarnRunner(cliapp.Application): self.ts = ttystatus.TerminalStatus(period=0.001) if not self.settings['quiet'] and not self.settings['verbose']: self.ts.format( - '%ElapsedTime() %Index(scenario,scenarios): ' + '%ElapsedTime() %Index(current_step,all_steps): ' '%String(scenario_name): ' - 'step %Index(step,steps): %String(step_name)') + '%String(step_name)') scenarios, implementations = self.parse_scenarios(args) self.check_there_are_scenarios(scenarios) @@ -120,10 +120,13 @@ class YarnRunner(cliapp.Application): self.connect_implementations(scenarios, implementations) shell_prelude = self.load_shell_libraries() - self.ts['scenarios'] = scenarios - self.ts['num_scenarios'] = len(scenarios) self.info('Found %d scenarios' % len(scenarios)) + all_steps = [] + for scenario in scenarios: + all_steps.extend(scenario.steps) + self.ts['all_steps'] = all_steps + self.scenarios_run = 0 self.skipped_for_assuming = 0 self.steps_run = 0 @@ -265,13 +268,13 @@ class YarnRunner(cliapp.Application): started = time.time() self.info('Running scenario %s' % scenario.name) - self.ts['scenario'] = scenario self.ts['scenario_name'] = scenario.name - self.ts['steps'] = scenario.steps self.scenarios_run += 1 if self.settings['no-act']: self.info('Pretending everything went OK') + for step in scenario.steps: + self.ts['current_step'] = step self.remember_scenario_timing(time.time() - started) return True @@ -372,7 +375,7 @@ class YarnRunner(cliapp.Application): started = time.time() self.info('Running step "%s %s"' % (step.what, step.text)) - self.ts['step'] = step + self.ts['current_step'] = step self.ts['step_name'] = '%s %s' % (step.what, step.text) self.steps_run += 1 -- cgit v1.2.1