aboutsummaryrefslogtreecommitdiffstats
path: root/vsperf
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2016-02-11 14:13:59 +0000
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-02-23 11:37:18 +0000
commit463a1fd56b516687dc4714ad87685530a0e9b8d1 (patch)
tree56cdd3fcbaf3dacb4631b6de31df0b78751a7105 /vsperf
parent9d4b0644730076007490afe0ca7ddddc3bc6b3ef (diff)
CI: Generate test report and push logs and report to the artifactory
Script for CI job execution automatically generates final test report, collects log files and pushes these results into artifactory. Support for branch specific configuration file has been added. Change-Id: Ifdf13b1c4c389f8d20dbc8e0ed99f43273e0820b JIRA: VSPERF-181 Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Diffstat (limited to 'vsperf')
-rwxr-xr-xvsperf25
1 files changed, 21 insertions, 4 deletions
diff --git a/vsperf b/vsperf
index d141227c..db1d5ee5 100755
--- a/vsperf
+++ b/vsperf
@@ -53,7 +53,8 @@ VERBOSITY_LEVELS = {
_TEMPLATE_RST = {'head' : 'tools/report/report_head.rst',
'foot' : 'tools/report/report_foot.rst',
- 'final' : 'test_report.rst'
+ 'final' : 'test_report.rst',
+ 'tmp' : 'tools/report/report_tmp_caption.rst'
}
def parse_arguments():
@@ -279,13 +280,29 @@ def generate_final_report(path):
rst_results = glob.glob(os.path.join(path, 'result*rst'))
if len(rst_results):
try:
- test_report = os.path.join(path, _TEMPLATE_RST['final'])
- retval = subprocess.call('cat {} {} {} > {}'.format(_TEMPLATE_RST['head'], ' '.join(rst_results),
- _TEMPLATE_RST['foot'], test_report), shell=True)
+ test_report = os.path.join(path, '{}_{}'.format(settings.getValue('VSWITCH'), _TEMPLATE_RST['final']))
+ # create report caption directly - it is not worth to execute jinja machinery
+ report_caption = '{}\n{} {}\n{}\n\n'.format(
+ '============================================================',
+ 'Performance report for',
+ Loader().get_vswitches()[settings.getValue('VSWITCH')].__doc__.strip().split('\n')[0],
+
+ '============================================================')
+
+ with open(_TEMPLATE_RST['tmp'], 'w') as file_:
+ file_.write(report_caption)
+
+ retval = subprocess.call('cat {} {} {} {} > {}'.format(_TEMPLATE_RST['tmp'], _TEMPLATE_RST['head'],
+ ' '.join(rst_results), _TEMPLATE_RST['foot'],
+ test_report), shell=True)
if retval == 0 and os.path.isfile(test_report):
logging.info('Overall test report written to "%s"', test_report)
else:
logging.error('Generatrion of overall test report has failed.')
+
+ # remove temporary file
+ os.remove(_TEMPLATE_RST['tmp'])
+
except subprocess.CalledProcessError:
logging.error('Generatrion of overall test report has failed.')