"test" : {
"properties": {
- "name" : { "type": "text" }, # name of the test
- "type" : { "type": "keyword" }, # stateless,stateful, other
- "duration_sec" : { "type": "double" }, # sec
- "result" : { "type": "keyword" }, # PASS,FAIL,SKIP
- "stdout" : { "type": "text" }, # output in case of faliue
+ "name" : { "type" : "text" }, # name of the test
+ "name_key" : { "type" : "keyword" }, # name of the test
+ "name_full" : { "type" : "keyword" }, # full name of the test
+ "type" : { "type" : "keyword" }, # stateless,stateful, other
+ "duration_sec" : { "type": "double" }, # sec
+ "result" : { "type" : "keyword" }, # PASS,FAIL,SKIP
+ "stdout" : { "type" : "text" }, # output in case of faliue
}
}
}
return ''
def addError(self, test, err, capt=None):
-
- taken = self._timeTaken()
-
- if issubclass(err[0], SkipTest):
- _type = 'SKIPPED'
- else:
- _type = 'ERROR'
-
- tb = format_exception(err, self.encoding)
- id = test.id()
- err_msg=self._getCapturedStdout()+self._getCapturedStderr();
- name=id_split(id)[-1]
-
elk = CTRexScenario.elk
if elk:
+ taken = self._timeTaken()
+ id = test.id()
+ err_msg=self._getCapturedStdout()+self._getCapturedStderr();
+ name=id_split(id)[-1]
+
elk_obj = trex.copy_elk_info ()
elk_obj['test']={
"name" : name,
- "type" : self.get_operation_mode (),
- "duration_sec" : taken,
- "result" : _type,
- "stdout" : err_msg,
+ "name_key" : name,
+ "name_full" : id,
+ "type" : self.get_operation_mode (),
+ "duration_sec" : taken,
+ "result" : "ERROR",
+ "stdout" : err_msg,
};
#pprint(elk_obj['test']);
elk.reg.push_data(elk_obj)
def addFailure(self, test, err, capt=None, tb_info=None):
- taken = self._timeTaken()
- tb = format_exception(err, self.encoding)
- id = test.id()
- err_msg=self._getCapturedStdout()+self._getCapturedStderr();
- name=id_split(id)[-1]
-
elk = CTRexScenario.elk
if elk:
+ taken = self._timeTaken()
+ tb = format_exception(err, self.encoding)
+ id = test.id()
+ err_msg=self._getCapturedStdout()+self._getCapturedStderr();
+ name=id_split(id)[-1]
+
elk_obj = trex.copy_elk_info ()
elk_obj['test']={
"name" : name,
+ "name_key" : name,
+ "name_full" : id,
"type" : self.get_operation_mode (),
"duration_sec" : taken,
"result" : "FAILURE",
def addSuccess(self, test, capt=None):
- taken = self._timeTaken()
- id = test.id()
- name=id_split(id)[-1]
elk = CTRexScenario.elk
if elk:
+ taken = self._timeTaken()
+ id = test.id()
+ name=id_split(id)[-1]
elk_obj = trex.copy_elk_info ()
elk_obj['test']={
"name" : name,
- "type" : self.get_operation_mode (),
- "duration_sec" : taken,
- "result" : "PASS",
- "stdout" : "",
+ "name_key" : name,
+ "name_full" : id,
+ "type" : self.get_operation_mode (),
+ "duration_sec" : taken,
+ "result" : "PASS",
+ "stdout" : "",
};
#pprint(elk_obj['test']);
elk.reg.push_data(elk_obj)