aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit
diff options
context:
space:
mode:
authorStamatis Katsaounis <mokats@intracom-telecom.com>2019-02-14 22:39:36 +0200
committerStamatis Katsaounis <mokats@intracom-telecom.com>2019-02-15 11:20:58 +0200
commit13777d607dd219ace0157e560ff11c3cd6f1aad0 (patch)
tree20eb9c6877bb94c502e9be9002a634214e0017c6 /functest/tests/unit
parent3393f2016483555c27d612c69ec11274cc8aa72a (diff)
Enrich Rally results output
This patch adds success/failure information of rally test cases to summary output. Change-Id: Ie4f9b4972a26e187bb7afdddfd5ce51b16f3db12 Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com>
Diffstat (limited to 'functest/tests/unit')
-rw-r--r--functest/tests/unit/openstack/rally/test_rally.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py
index 67cf07e79..5dc38a20f 100644
--- a/functest/tests/unit/openstack/rally/test_rally.py
+++ b/functest/tests/unit/openstack/rally/test_rally.py
@@ -360,14 +360,31 @@ class OSRallyTesting(unittest.TestCase):
mock_prep_env.assert_called()
def test_append_summary(self):
- text = '{"tasks": [{"subtasks": [{"workloads": [{"full_duration": ' \
- '1.23,"data": [{"error": []}]}]},{"workloads": ' \
- '[{"full_duration": 2.78, "data": [{"error": ["err"]}]}]}]}]}'
- self.rally_base._append_summary(text, "foo_test")
+ json_dict = {
+ 'tasks': [{
+ 'subtasks': [{
+ 'title': 'sub_task',
+ 'workloads': [{
+ 'full_duration': 1.23,
+ 'data': [{
+ 'error': []
+ }]
+ }, {
+ 'full_duration': 2.78,
+ 'data': [{
+ 'error': ['err']
+ }]
+ }]
+ }]
+ }]
+ }
+ self.rally_base._append_summary(json.dumps(json_dict), "foo_test")
self.assertEqual(self.rally_base.summary[0]['test_name'], "foo_test")
self.assertEqual(self.rally_base.summary[0]['overall_duration'], 4.01)
self.assertEqual(self.rally_base.summary[0]['nb_tests'], 2)
self.assertEqual(self.rally_base.summary[0]['nb_success'], 1)
+ self.assertEqual(self.rally_base.summary[0]['success'], [])
+ self.assertEqual(self.rally_base.summary[0]['failures'], ['sub_task'])
def test_is_successful_false(self):
with mock.patch('six.moves.builtins.super') as mock_super: