summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testapi/opnfv_testapi/handlers/result_handlers.py24
-rw-r--r--testapi/opnfv_testapi/models/result_models.py67
-rw-r--r--testapi/opnfv_testapi/tests/UI/e2e/resultsControllerSpec.js3
-rw-r--r--testapi/opnfv_testapi/tests/unit/handlers/test_result.py41
-rw-r--r--testapi/opnfv_testapi/tests/unit/templates/test_result.json4
-rw-r--r--testapi/opnfv_testapi/ui/components/results/result/result.html22
-rw-r--r--testapi/opnfv_testapi/ui/components/results/result/resultController.js8
7 files changed, 4 insertions, 165 deletions
diff --git a/testapi/opnfv_testapi/handlers/result_handlers.py b/testapi/opnfv_testapi/handlers/result_handlers.py
index 74acb2e..edcac6e 100644
--- a/testapi/opnfv_testapi/handlers/result_handlers.py
+++ b/testapi/opnfv_testapi/handlers/result_handlers.py
@@ -48,8 +48,6 @@ class GenericResultHandler(base_handlers.GenericApiHandler):
period = datetime.now() - timedelta(days=v)
obj = {"$gte": str(period)}
query['start_date'] = obj
- elif k == 'trust_indicator':
- query[k + '.current'] = float(v)
elif k == 'from':
date_range.update({'$gte': str(v)})
elif k == 'to':
@@ -108,8 +106,6 @@ class ResultsCLHandler(GenericResultHandler):
- to : ending time in 2016-01-01 or 2016-01-01 00:01:23
- scenario : the test scenario (previously version)
- criteria : the global criteria status passed or failed
- - trust_indicator : evaluate the stability of the test case
- to avoid running systematically long and stable test case
GET /results/project=functest&case=vPing&version=Arno-R1 \
&pod=pod_name&period=15
@@ -168,10 +164,6 @@ class ResultsCLHandler(GenericResultHandler):
@type page: L{int}
@in page: query
@required page: False
- @param trust_indicator: must be float
- @type trust_indicator: L{float}
- @in trust_indicator: query
- @required trust_indicator: False
@param descend: true, newest2oldest; false, oldest2newest
@type descend: L{string}
@in descend: query
@@ -228,19 +220,3 @@ class ResultsGURHandler(GenericResultHandler):
query = dict()
query["_id"] = objectid.ObjectId(result_id)
self._get_one(query=query)
-
- @swagger.operation(nickname="updateTestResultById")
- def put(self, result_id):
- """
- @description: update a single result by _id
- @param body: fields to be updated
- @type body: L{ResultUpdateRequest}
- @in body: body
- @rtype: L{Result}
- @return 200: update success
- @raise 404: result not exist
- @raise 403: nothing to update
- """
- query = {'_id': objectid.ObjectId(result_id)}
- db_keys = []
- self._update(query=query, db_keys=db_keys)
diff --git a/testapi/opnfv_testapi/models/result_models.py b/testapi/opnfv_testapi/models/result_models.py
index f8379d8..602318a 100644
--- a/testapi/opnfv_testapi/models/result_models.py
+++ b/testapi/opnfv_testapi/models/result_models.py
@@ -11,45 +11,7 @@ from opnfv_testapi.tornado_swagger import swagger
@swagger.model()
-class TIHistory(base_models.ModelBase):
- """
- @ptype step: L{float}
- """
- def __init__(self, date=None, step=0):
- self.date = date
- self.step = step
-
-
-@swagger.model()
-class TI(base_models.ModelBase):
- """
- @property histories: trust_indicator update histories
- @ptype histories: C{list} of L{TIHistory}
- @ptype current: L{float}
- """
- def __init__(self, current=0):
- self.current = current
- self.histories = list()
-
- def __eq__(self, other):
- return (self.current == other.current and self._histories_eq(other))
-
- def _histories_eq(self, other):
- hs_equal = all(self.histories[i] == other.histories[i]
- for i in range(len(self.histories)))
- return len(self.histories) == len(other.histories) and hs_equal
-
- @staticmethod
- def attr_parser():
- return {'histories': TIHistory}
-
-
-@swagger.model()
class ResultCreateRequest(base_models.ModelBase):
- """
- @property trust_indicator:
- @ptype trust_indicator: L{TI}
- """
def __init__(self,
pod_name=None,
project_name=None,
@@ -61,8 +23,7 @@ class ResultCreateRequest(base_models.ModelBase):
details=None,
build_tag=None,
scenario=None,
- criteria=None,
- trust_indicator=None):
+ criteria=None):
self.pod_name = pod_name
self.project_name = project_name
self.case_name = case_name
@@ -74,35 +35,15 @@ class ResultCreateRequest(base_models.ModelBase):
self.build_tag = build_tag
self.scenario = scenario
self.criteria = criteria
- self.trust_indicator = trust_indicator if trust_indicator else TI(0)
def __eq__(self, other):
- simple_equal = all(getattr(self, k) == getattr(other, k)
- for k in self.format().keys()
- if k not in ['_id', 'trust_indicator'])
- return simple_equal and self.trust_indicator == other.trust_indicator
-
- @staticmethod
- def attr_parser():
- return {'trust_indicator': TI}
-
-
-@swagger.model()
-class ResultUpdateRequest(base_models.ModelBase):
- """
- @property trust_indicator:
- @ptype trust_indicator: L{TI}
- """
- def __init__(self, trust_indicator=None):
- self.trust_indicator = trust_indicator
+ return all(getattr(self, k) == getattr(other, k)
+ for k in self.format().keys()
+ if k not in ['_id'])
@swagger.model()
class TestResult(ResultCreateRequest):
- """
- @property trust_indicator: used for long duration test case
- @ptype trust_indicator: L{TI}
- """
def __init__(self, _id=None, **kwargs):
super(TestResult, self).__init__(**kwargs)
self._id = _id
diff --git a/testapi/opnfv_testapi/tests/UI/e2e/resultsControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/resultsControllerSpec.js
index 132f77d..d091a38 100644
--- a/testapi/opnfv_testapi/tests/UI/e2e/resultsControllerSpec.js
+++ b/testapi/opnfv_testapi/tests/UI/e2e/resultsControllerSpec.js
@@ -30,7 +30,6 @@ describe('testing the result page for anonymous user', function () {
"user": null,
"installer": "fuel",
"scenario": "test-scenario",
- "trust_indicator": null,
"public": "true",
"version": "euphrates",
"details": "",
@@ -107,7 +106,6 @@ describe('testing the result page for anonymous user', function () {
"user": null,
"installer": "fuel",
"scenario": "test-scenario",
- "trust_indicator": null,
"public": "true",
"version": "euphrates",
"details": "",
@@ -254,7 +252,6 @@ describe('testing the result page for user', function () {
"user": null,
"installer": "fuel",
"scenario": "test-scenario",
- "trust_indicator": null,
"public": "true",
"version": "euphrates",
"details": "",
diff --git a/testapi/opnfv_testapi/tests/unit/handlers/test_result.py b/testapi/opnfv_testapi/tests/unit/handlers/test_result.py
index 892256a..6435367 100644
--- a/testapi/opnfv_testapi/tests/unit/handlers/test_result.py
+++ b/testapi/opnfv_testapi/tests/unit/handlers/test_result.py
@@ -105,18 +105,6 @@ class TestResultCreate(TestResultBase):
req.details = {'1.name': 'dot_name'}
return req
- @executor.create(httplib.OK, '_assert_no_ti')
- def test_no_ti(self):
- req = copy.deepcopy(self.req_d)
- req.trust_indicator = rm.TI(0)
- self.actual_req = req
- return req
-
- def _assert_no_ti(self, body):
- _id = body.href.split('/')[-1]
- code, body = self.get(_id)
- self.assert_res(body, self.actual_req)
-
class TestResultGet(TestResultBase):
def setUp(self):
@@ -158,10 +146,6 @@ class TestResultGet(TestResultBase):
return self._set_query('scenario')
@executor.query(httplib.OK, '_query_success', 3)
- def test_queryTrustIndicator(self):
- return self._set_query('trust_indicator')
-
- @executor.query(httplib.OK, '_query_success', 3)
def test_queryCriteria(self):
return self._set_query('criteria')
@@ -190,7 +174,6 @@ class TestResultGet(TestResultBase):
'installer',
'build_tag',
'scenario',
- 'trust_indicator',
'criteria',
period=5)
@@ -202,7 +185,6 @@ class TestResultGet(TestResultBase):
'installer',
'build_tag',
'scenario',
- 'trust_indicator',
'criteria',
pod='notExistPod',
period=1)
@@ -244,8 +226,6 @@ class TestResultGet(TestResultBase):
def get_value(arg):
if arg in ['pod', 'project', 'case']:
return getattr(self.req_d, arg + '_name')
- elif arg == 'trust_indicator':
- return self.req_d.trust_indicator.current
else:
return getattr(self.req_d, arg)
@@ -255,24 +235,3 @@ class TestResultGet(TestResultBase):
for k, v in kwargs.iteritems():
query.append((k, v))
return urllib.urlencode(query)
-
-
-class TestResultUpdate(TestResultBase):
- def setUp(self):
- super(TestResultUpdate, self).setUp()
- self.req_d_id = self._create_d()
-
- @executor.update(httplib.OK, '_assert_update_ti')
- def test_success(self):
- update_date = str(datetime.now() + timedelta(days=1))
- update_step = -0.05
- self.after_update = copy.deepcopy(self.req_d)
- self.after_update.trust_indicator.current += update_step
- self.after_update.trust_indicator.histories.append(
- rm.TIHistory(update_date, update_step))
- update = rm.ResultUpdateRequest(
- trust_indicator=self.after_update.trust_indicator)
- return update, self.req_d_id
-
- def _assert_update_ti(self, request, body):
- self.assert_res(body, self.after_update)
diff --git a/testapi/opnfv_testapi/tests/unit/templates/test_result.json b/testapi/opnfv_testapi/tests/unit/templates/test_result.json
index b7cb910..8f1d5fa 100644
--- a/testapi/opnfv_testapi/tests/unit/templates/test_result.json
+++ b/testapi/opnfv_testapi/tests/unit/templates/test_result.json
@@ -1,10 +1,6 @@
{
"project_name": "functest",
"scenario": "odl-l2",
- "trust_indicator": {
- "current": 0.7,
- "histories": []
- },
"case_name": "vPing",
"build_tag": "v3.0",
"public": "true",
diff --git a/testapi/opnfv_testapi/ui/components/results/result/result.html b/testapi/opnfv_testapi/ui/components/results/result/result.html
index b435dce..52d794e 100644
--- a/testapi/opnfv_testapi/ui/components/results/result/result.html
+++ b/testapi/opnfv_testapi/ui/components/results/result/result.html
@@ -48,28 +48,6 @@
<td width="90%" class="podsTableLeftTd">{{ctrl.data.stop_date}}</td>
</tr>
<tr style="padding:9px">
- <td class="podsTableTd">Trust&nbsp;Indicator&nbsp;:</td>
- <td width="90%" class="podsTableLeftTd">
- <a ng-click="ctrl.showTrustIndicator()">
- <p ng-if="ctrl.trust_indicator">Hide</p>
- <p ng-if="!ctrl.trust_indicator">Show</p>
- </a>
- <table class="table" ng-class="{'hidden' : !ctrl.trust_indicator}" style="margin:10px">
- <tbody>
- <tr style="padding:9px"></tr>
- <tr style="padding:9px" >
- <td class="podsTableTd">Current&nbsp;:</td>
- <td width="90%" class="podsTableLeftTd">{{ctrl.data.trust_indicator.current}}</td>
- </tr>
- <tr style="padding:9px" >
- <td class="podsTableTd">Histories&nbsp;:</td>
- <td width="90%" class="podsTableLeftTd">{{ctrl.data.trust_indicator.histories}}</td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- <tr style="padding:9px">
<td class="podsTableTd">Details&nbsp;:</td>
<td width="90%" class="podsTableLeftTd">
<a ng-click="ctrl.showDetails()">
diff --git a/testapi/opnfv_testapi/ui/components/results/result/resultController.js b/testapi/opnfv_testapi/ui/components/results/result/resultController.js
index 028e5d8..cb5dd28 100644
--- a/testapi/opnfv_testapi/ui/components/results/result/resultController.js
+++ b/testapi/opnfv_testapi/ui/components/results/result/resultController.js
@@ -54,14 +54,6 @@
});
}
- function showTrustIndicator(){
- if(ctrl.trust_indicator){
- ctrl.trust_indicator = false
- }else{
- ctrl.trust_indicator = true
- }
- }
-
function showDetails(){
if(ctrl.details){
ctrl.details = false