Merge "[Verify] Make total time like H:M:S (<time in sec> s) in HTML report"
This commit is contained in:
commit
606e48e596
@ -10,6 +10,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import datetime
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from jinja2 import utils
|
from jinja2 import utils
|
||||||
@ -51,7 +52,9 @@ def generate_report(results):
|
|||||||
return template.render(report={
|
return template.render(report={
|
||||||
"tests": tests,
|
"tests": tests,
|
||||||
"total": results["tests"],
|
"total": results["tests"],
|
||||||
"time": results["time"],
|
"time": "{0} ({1} s)".format(
|
||||||
|
datetime.timedelta(seconds=round(
|
||||||
|
float(results["time"]))), results["time"]),
|
||||||
"success": results["success"],
|
"success": results["success"],
|
||||||
"failures": results["failures"],
|
"failures": results["failures"],
|
||||||
"skipped": results["skipped"],
|
"skipped": results["skipped"],
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from rally.verification.tempest import json2html
|
from rally.verification.tempest import json2html
|
||||||
@ -23,7 +25,7 @@ class HtmlOutputTestCase(test.TestCase):
|
|||||||
@mock.patch(BASE + ".json2html.ui_utils.get_template")
|
@mock.patch(BASE + ".json2html.ui_utils.get_template")
|
||||||
def test_generate_report(self, mock_get_template):
|
def test_generate_report(self, mock_get_template):
|
||||||
results = {
|
results = {
|
||||||
"time": 22,
|
"time": 22.75,
|
||||||
"tests": 4,
|
"tests": 4,
|
||||||
"success": 1,
|
"success": 1,
|
||||||
"skipped": 1,
|
"skipped": 1,
|
||||||
@ -50,7 +52,8 @@ class HtmlOutputTestCase(test.TestCase):
|
|||||||
"expected_failures": 0,
|
"expected_failures": 0,
|
||||||
"unexpected_success": 0,
|
"unexpected_success": 0,
|
||||||
"total": 4,
|
"total": 4,
|
||||||
"time": 22,
|
"time": "{0} ({1} s)".format(
|
||||||
|
datetime.timedelta(seconds=23), 22.75),
|
||||||
"tests": [{"name": "tf",
|
"tests": [{"name": "tf",
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"output": "fail_log",
|
"output": "fail_log",
|
||||||
@ -96,7 +99,7 @@ class HtmlOutputTestCase(test.TestCase):
|
|||||||
"expected_failures": 0,
|
"expected_failures": 0,
|
||||||
"unexpected_success": 0,
|
"unexpected_success": 0,
|
||||||
"total": 1,
|
"total": 1,
|
||||||
"time": 0,
|
"time": "{0} ({1} s)".format(datetime.timedelta(seconds=0), 0),
|
||||||
"tests": [{
|
"tests": [{
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"status": "skip",
|
"status": "skip",
|
||||||
|
Loading…
Reference in New Issue
Block a user