Showing OVP version on "my results" page 23/60223/2
authorGeorg Kunz <georg.kunz@ericsson.com>
Thu, 26 Jul 2018 21:32:54 +0000 (23:32 +0200)
committerGeorg Kunz <georg.kunz@ericsson.com>
Fri, 27 Jul 2018 12:32:03 +0000 (14:32 +0200)
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>
3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html
3rd_party/static/testapi-ui/components/results/results.html
opnfv_testapi/resources/result_handlers.py

index e363289..78ec4b1 100644 (file)
@@ -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">
index 719e689..80d08d6 100644 (file)
@@ -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>
index 2e65ba4..1f6ec73 100644 (file)
@@ -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)