- period : x (x last days)
- 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
:param result_id: Get a result by ID
scenario_arg = self.get_query_argument("scenario", None)
criteria_arg = self.get_query_argument("criteria", None)
period_arg = self.get_query_argument("period", None)
+ trust_indicator_arg = self.get_query_argument("trust_indicator", None)
# prepare request
get_request = dict()
if criteria_arg is not None:
get_request["criteria_tag"] = criteria_arg
+ if trust_indicator_arg is not None:
+ get_request["trust_indicator_arg"] = trust_indicator_arg
+
if period_arg is not None:
try:
period_arg = int(period_arg)
self.build_tag = None\r
self.scenario = None\r
self.criteria = None\r
+ self.trust_indicator = None\r
\r
@staticmethod\r
def test_result_from_dict(test_result_dict):\r
t.build_tag = test_result_dict.get('build_tag')\r
t.scenario = test_result_dict.get('scenario')\r
t.criteria = test_result_dict.get('criteria')\r
-\r
+ # 0 < trust indicator < 1\r
+ # if bad value => set this indicator to 0\r
+ if test_result_dict.get('trust_indicator') is not None:\r
+ if isinstance(test_result_dict.get('trust_indicator'),\r
+ (int, long, float)):\r
+ if test_result_dict.get('trust_indicator') < 0:\r
+ t.trust_indicator = 0\r
+ elif test_result_dict.get('trust_indicator') > 1:\r
+ t.trust_indicator = 1\r
+ else:\r
+ t.trust_indicator = test_result_dict.get('trust_indicator')\r
+ else:\r
+ t.trust_indicator = 0\r
+ else:\r
+ t.trust_indicator = 0\r
return t\r
\r
def format(self):\r
"details": self.details,\r
"build_tag": self.build_tag,\r
"scenario": self.scenario,\r
- "criteria": self.criteria\r
+ "criteria": self.criteria,\r
+ "trust_indicator": self.trust_indicator\r
}\r
\r
def format_http(self):\r
"details": self.details,\r
"build_tag": self.build_tag,\r
"scenario": self.scenario,\r
- "criteria": self.criteria\r
+ "criteria": self.criteria,\r
+ "trust_indicator": self.trust_indicator\r
}\r
-\r