From 4a7221beef916ffddf6404711a4283276d3e62af Mon Sep 17 00:00:00 2001 From: Georg Kunz Date: Thu, 26 Jul 2018 23:32:54 +0200 Subject: 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 --- .../components/results-report/partials/reportDetails.html | 2 +- 3rd_party/static/testapi-ui/components/results/results.html | 2 ++ opnfv_testapi/resources/result_handlers.py | 10 +++++++++- 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:
- {{ type }}: (Total: 3 test areas, {{ ctrl.statistics[type].total }} tests) + {{ type }}: {{ ctrl.statistics[type].total }} tests
    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 @@ Upload Date Test ID + OVP Version Owner File Name Label @@ -39,6 +40,7 @@ {{ result.upload_date | limitTo:19}} {{ result.id | limitTo:8 }} + {{ result.version || "2018.01" }} {{ result.owner }} {{ result.filename || "None"}} 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) -- cgit 1.2.3-korg