summaryrefslogtreecommitdiffstats
path: root/reporting
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-06-21 15:37:39 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2017-06-21 15:56:48 +0200
commit89b73ab4e3b3d9a217bf0c9388e910d8b4b094e2 (patch)
treeea18bc998af09f47aff0636090cf6ba8c1d9b02a /reporting
parentc9cb0fd7d6b7f3736f94b0eebb517f248b8e670e (diff)
bug fix: bad format for start/time in Tempest reporting
Change-Id: Ic9792023b9041dbe8081ff9840caa2cf2901b189 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'reporting')
-rwxr-xr-xreporting/functest/reporting-tempest.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/reporting/functest/reporting-tempest.py b/reporting/functest/reporting-tempest.py
index 6e6585a..0304298 100755
--- a/reporting/functest/reporting-tempest.py
+++ b/reporting/functest/reporting-tempest.py
@@ -1,4 +1,15 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2017 Orange and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+# SPDX-license-identifier: Apache-2.0
+
from urllib2 import Request, urlopen, URLError
+from datetime import datetime
import json
import jinja2
import os
@@ -97,7 +108,13 @@ for version in rp_utils.get_config('general.versions'):
crit_rate = True
# Expect that the suite duration is inferior to 30m
- if result['details']['duration'] < criteria_duration:
+ stop_date = datetime.strptime(result['stop_date'],
+ '%Y-%m-%d %H:%M:%S')
+ start_date = datetime.strptime(result['start_date'],
+ '%Y-%m-%d %H:%M:%S')
+
+ delta = stop_date - start_date
+ if (delta.total_seconds() < criteria_duration):
crit_time = True
result['criteria'] = {'tests': crit_tests,