mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-08 00:47:36 +08:00
add runtime env to report
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
__title__ = 'HttpRunner'
|
__title__ = 'HttpRunner'
|
||||||
__description__ = 'HTTP test runner, not just about api test and load test.'
|
__description__ = 'HTTP test runner, not just about api test and load test.'
|
||||||
__url__ = 'https://github.com/HttpRunner/HttpRunner'
|
__url__ = 'https://github.com/HttpRunner/HttpRunner'
|
||||||
__version__ = '0.9.6a1'
|
__version__ = '0.9.6a2'
|
||||||
__author__ = 'debugtalk'
|
__author__ = 'debugtalk'
|
||||||
__author_email__ = 'mail@debugtalk.com'
|
__author_email__ = 'mail@debugtalk.com'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
|
|||||||
+12
-1
@@ -1,5 +1,6 @@
|
|||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@@ -9,6 +10,15 @@ from jinja2 import Template
|
|||||||
from requests.structures import CaseInsensitiveDict
|
from requests.structures import CaseInsensitiveDict
|
||||||
|
|
||||||
|
|
||||||
|
def get_platform():
|
||||||
|
return {
|
||||||
|
"python_version": "{}_{}".format(
|
||||||
|
platform.python_implementation(),
|
||||||
|
platform.python_version()
|
||||||
|
),
|
||||||
|
"platform": platform.platform()
|
||||||
|
}
|
||||||
|
|
||||||
def get_summary(result):
|
def get_summary(result):
|
||||||
""" get summary from test result
|
""" get summary from test result
|
||||||
"""
|
"""
|
||||||
@@ -21,7 +31,8 @@ def get_summary(result):
|
|||||||
'skipped': len(result.skipped),
|
'skipped': len(result.skipped),
|
||||||
'expectedFailures': len(result.expectedFailures),
|
'expectedFailures': len(result.expectedFailures),
|
||||||
'unexpectedSuccesses': len(result.unexpectedSuccesses)
|
'unexpectedSuccesses': len(result.unexpectedSuccesses)
|
||||||
}
|
},
|
||||||
|
"platform": get_platform()
|
||||||
}
|
}
|
||||||
summary["stat"]["successes"] = summary["stat"]["testsRun"] \
|
summary["stat"]["successes"] = summary["stat"]["testsRun"] \
|
||||||
- summary["stat"]["failures"] \
|
- summary["stat"]["failures"] \
|
||||||
|
|||||||
@@ -142,6 +142,11 @@
|
|||||||
<th>DURATION</th>
|
<th>DURATION</th>
|
||||||
<td colspan="4">{{ '%0.3f'| format(time.duration|float) }} seconds</td>
|
<td colspan="4">{{ '%0.3f'| format(time.duration|float) }} seconds</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>PLATFORM</th>
|
||||||
|
<td colspan="2">{{ platform.python_version }} </td>
|
||||||
|
<td colspan="2">{{ platform.platform }}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>TOTAL</th>
|
<th>TOTAL</th>
|
||||||
<th>SUCCESS</th>
|
<th>SUCCESS</th>
|
||||||
|
|||||||
Reference in New Issue
Block a user