Fix atomic wrapper

If raw data is old format, we need to convert to new
format, and specify the starting time with 0.
1.move out `rally task results` to cli module
2.port _test_atomic_action_timer to wrapper

Afert porting report to new atomic format,we will
move convert_atomic_actions to wrapper too.

Change-Id: I6f42d7a9272673dccea8770c83b7084a2c9503d4
This commit is contained in:
chenhb-zte 2017-04-18 10:34:47 +08:00 committed by chenhb
parent 8cf9e22e28
commit d5dc53752f

View File

@ -22,8 +22,8 @@ from oslotest import base
from oslotest import mockpatch from oslotest import mockpatch
from rally.common import db from rally.common import db
from rally.common import objects
from rally import plugins from rally import plugins
from rally.task import utils as tutils
from tests.unit import fakes from tests.unit import fakes
@ -47,9 +47,8 @@ class TestCase(base.BaseTestCase):
plugins.load() plugins.load()
def _test_atomic_action_timer(self, atomic_actions, name): def _test_atomic_action_timer(self, atomic_actions, name):
_old_atomic_actions = objects.Task.convert_atomic_actions( atomic_wrapper = tutils.WrapperForAtomicActions(atomic_actions)
atomic_actions) action_duration = atomic_wrapper.get(name)
action_duration = _old_atomic_actions.get(name)
self.assertIsNotNone(action_duration) self.assertIsNotNone(action_duration)
self.assertIsInstance(action_duration, float) self.assertIsInstance(action_duration, float)