summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Kunz <georg.kunz@ericsson.com>2018-07-26 23:32:54 +0200
committerGeorg Kunz <georg.kunz@ericsson.com>2018-07-27 14:32:03 +0200
commit4a7221beef916ffddf6404711a4283276d3e62af (patch)
treefedc03bbcb5b3cb2864b44e5b68adc3ecf09fad7
parent635f8b72b7ff629b32ba8b66b33cf3424c6f6868 (diff)
Showing OVP version on "my results" page
Adding an "OVP Version" column to the "my results" page. JIRA: DOVETAIL-708 Change-Id: Id9a9228002f3be88fda8c71aedf2f5abe24d833d Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
-rw-r--r--3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html2
-rw-r--r--3rd_party/static/testapi-ui/components/results/results.html2
-rw-r--r--opnfv_testapi/resources/result_handlers.py10
3 files changed, 12 insertions, 2 deletions
diff --git a/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html b/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html
index e363289..78ec4b1 100644
--- a/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html
+++ b/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html
@@ -27,7 +27,7 @@ Test Filters:<br />
<uib-accordion-group ng-repeat="(type,data) in ctrl.data" is-open="isOpen">
<uib-accordion-heading>
- {{ type }}: (Total: 3 test areas, {{ ctrl.statistics[type].total }} tests)
+ {{ type }}: {{ ctrl.statistics[type].total }} tests
<i class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': isOpen, 'glyphicon-chevron-right': !isOpen}"></i>
</uib-accordion-heading>
<ol class="capabilities">
diff --git a/3rd_party/static/testapi-ui/components/results/results.html b/3rd_party/static/testapi-ui/components/results/results.html
index 719e689..80d08d6 100644
--- a/3rd_party/static/testapi-ui/components/results/results.html
+++ b/3rd_party/static/testapi-ui/components/results/results.html
@@ -23,6 +23,7 @@
<tr>
<th>Upload Date</th>
<th>Test ID</th>
+ <th>OVP Version</th>
<th>Owner</th>
<th>File Name</th>
<th>Label</th>
@@ -39,6 +40,7 @@
<tr ng-repeat="(index, result) in ctrl.data.tests">
<td>{{ result.upload_date | limitTo:19}}</td>
<td><a uib-tooltip="{{ result.id }}" tooltip-placement="top" tooltip-append-to-body="true" ng-click="ctrl.gotoResultDetail(result.id, result._id)">{{ result.id | limitTo:8 }}</a></td>
+ <td>{{ result.version || "2018.01" }}</td>
<td>{{ result.owner }}</td>
<td>{{ result.filename || "None"}}</td>
<td><div class="popover-wrapper"><a editable-theme="bs3" onbeforesave="ctrl.changeLabel(result, 'label', $data)" editable-text="result.label"> {{ result.label || "None" }}</a></div></td>
diff --git a/opnfv_testapi/resources/result_handlers.py b/opnfv_testapi/resources/result_handlers.py
index 2e65ba4..1f6ec73 100644
--- a/opnfv_testapi/resources/result_handlers.py
+++ b/opnfv_testapi/resources/result_handlers.py
@@ -256,10 +256,18 @@ class ResultsUploadHandler(ResultsCLHandler):
return
results = results.split('\n')
result_ids = []
+ version = ''
for result in results:
if result == '':
continue
self.json_args = json.loads(result).copy()
+ # the result files used in the first release of OVP did not
+ # specify an OVP version
+ if (self.json_args['version'] == 'master' or
+ self.json_args['version'] == 'unknown'):
+ version = '2018.01'
+ else:
+ version = self.json_args['version']
build_tag = self.json_args['build_tag']
_id = yield self._inner_create()
result_ids.append(str(_id))
@@ -269,7 +277,7 @@ class ResultsUploadHandler(ResultsCLHandler):
log_filename = "/home/testapi/logs/log_%s.tar.gz" % (test_id)
with open(log_filename, "wb") as tar_out:
tar_out.write(fileinfo['body'])
- resp = {'id': test_id, 'results': result_ids}
+ resp = {'id': test_id, 'results': result_ids, 'version': version}
self.finish_request(resp)