diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2017-08-14 02:47:29 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2017-08-14 02:48:08 +0000 |
commit | b88e1a41c01a34d08ba3a0e201d0603b35ee4fba (patch) | |
tree | 89670578a7cc72f047ef136edf8ed41c2696b9df /yardstick/common/html_template.py | |
parent | c2f99db8b4d8f021b29a4e3aae483ba715936a66 (diff) |
Add yardstick report for each task
JIRA: YARDSTICK-784
Currently we have yardstick report in GUI.
But if users do not use GUI, they can't see this report.
So we need generate a report each task.
After run each test case, we can see report:
http://ip:port/report/report.html
Change-Id: Ic76cf57f55aa6680b91272e210135136f0225373
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/common/html_template.py')
-rw-r--r-- | yardstick/common/html_template.py | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/yardstick/common/html_template.py b/yardstick/common/html_template.py index 4b46e77a0..f030a2f6c 100644 --- a/yardstick/common/html_template.py +++ b/yardstick/common/html_template.py @@ -131,3 +131,63 @@ $(function() { </body> </html>""" + +report_template = """ +<html> + <head> + <title>Yardstick Report</title> + <link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css\ +/bootstrap.min.css" rel="stylesheet"> + </head> + <div class="content"> + <h3>Yardstick Report </h3> + <hr/> + <div> + + <div>Task ID : {{result.task_id}} </div> + <div style="margin-top:5px;">Criteria : + <font> {{result.criteria}}</font> + </div> + <hr/> + + <caption>Information</caption> + <table class="table table-striped"> + <tr> + <th>#</th> + <th>key</th> + <th>value</th> + </tr> + <tbody> + {% for key, value in result.info.iteritems() %} + <tr> + <td>{{ loop.index }}</td> + <td>{{key}}</td> + <td>{{value}}</td> + </tr> + {% endfor %} + </tbody> + </table> + <hr/> + + <caption>Test Cases</caption> + <table class="table table-striped"> + <tr> + <th>#</th> + <th>key</th> + <th>value</th> + </tr> + <tbody> + {% for key, value in result.testcases.iteritems() %} + <tr> + <td>{{ loop.index }}</td> + <td>{{key}}</td> + <td>{{value.criteria}}</td> + </tr> + {% endfor %} + </tbody> + </table> + + </div> + </div> +</html> +""" |