summaryrefslogtreecommitdiff
path: root/yarn
diff options
context:
space:
mode:
Diffstat (limited to 'yarn')
-rwxr-xr-xyarn21
1 files changed, 13 insertions, 8 deletions
diff --git a/yarn b/yarn
index 811e41d..1cfa801 100755
--- a/yarn
+++ b/yarn
@@ -38,7 +38,7 @@ def dry_scenario_runner_factory(info, ts):
def run_scenario(self, scenario, datadir, homedir):
info('Pretending everything went OK')
for step in scenario.steps:
- ts['current_step'] = step
+ ts['steps_completed'] += 1
return True
return DryScenarioRunner
@@ -131,7 +131,8 @@ 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(current_step,all_steps): '
+ '%ElapsedTime() '
+ '[%Integer(steps_completed)/%Integer(total_steps)]: '
'%String(scenario_name): '
'%String(step_name)')
@@ -153,7 +154,8 @@ class YarnRunner(cliapp.Application):
all_steps = []
for scenario in scenarios:
all_steps.extend(scenario.steps)
- self.ts['all_steps'] = all_steps
+ self.ts['total_steps'] = len(all_steps)
+ self.ts['steps_completed'] = 0
self.scenarios_run = 0
self.skipped_for_assuming = 0
@@ -273,8 +275,6 @@ class YarnRunner(cliapp.Application):
started = time.time()
self.info('Running scenario %s' % scenario.name)
- self.ts['scenario_name'] = scenario.name
- self.scenarios_run += 1
self.info('DATADIR is %s' % datadir)
self.info('HOME for tests is %s' % homedir)
return (started,)
@@ -283,18 +283,18 @@ class YarnRunner(cliapp.Application):
stopped = time.time()
started, = pre_scenario_userdata
+ self.scenarios_run += 1
self.remember_scenario_timing(stopped - started)
if not self.settings['snapshot']:
shutil.rmtree(datadir, ignore_errors=True)
- def pre_step(self, step, **ignored):
+ def pre_step(self, scenario, step, **ignored):
started = time.time()
self.info('Running step "%s %s"' % (step.what, step.text))
- self.ts['current_step'] = step
+ self.ts['scenario_name'] = scenario.name
self.ts['step_name'] = '%s %s' % (step.what, step.text)
- self.steps_run += 1
return (started,)
@@ -303,6 +303,9 @@ class YarnRunner(cliapp.Application):
stopped = time.time()
(started,) = pre_step_userdata
+ self.steps_run += 1
+ self.ts['steps_completed'] += 1
+
logging.debug('Exit code: %d' % exit)
if stdout:
logging.debug('Standard output:\n%s' % self.indent(stdout))
@@ -318,6 +321,8 @@ class YarnRunner(cliapp.Application):
'Skipping "%s" because "%s %s" failed' %
(scenario.name, step.what, step.text))
self.skipped_for_assuming += 1
+ skipped = len(scenario.steps) - scenario.steps.index(step) - 1
+ self.ts['total_steps'] -= skipped
else:
self.error(
'ERROR: In scenario "%s"\nstep "%s %s" failed,\n'