MCPcopy Create free account
hub / github.com/F-Stack/f-stack / DTSResult

Class DTSResult

dpdk/dts/framework/test_result.py:255–327  ·  view source on GitHub ↗

Stores environment information and test results from a DTS run, which are: * Execution level information, such as SUT and TG hardware. * Build target level information, such as compiler, target OS and cpu. * Test suite results. * All errors that are caught and recorded during DT

Source from the content-addressed store, hash-verified

253
254
255class DTSResult(BaseResult):
256 """
257 Stores environment information and test results from a DTS run, which are:
258 * Execution level information, such as SUT and TG hardware.
259 * Build target level information, such as compiler, target OS and cpu.
260 * Test suite results.
261 * All errors that are caught and recorded during DTS execution.
262
263 The information is stored in nested objects.
264
265 The class is capable of computing the return code used to exit DTS with
266 from the stored error.
267
268 It also provides a brief statistical summary of passed/failed test cases.
269 """
270
271 dpdk_version: str | None
272 _logger: DTSLOG
273 _errors: list[Exception]
274 _return_code: ErrorSeverity
275 _stats_result: Statistics | None
276 _stats_filename: str
277
278 def __init__(self, logger: DTSLOG):
279 super(DTSResult, self).__init__()
280 self.dpdk_version = None
281 self._logger = logger
282 self._errors = []
283 self._return_code = ErrorSeverity.NO_ERR
284 self._stats_result = None
285 self._stats_filename = os.path.join(SETTINGS.output_dir, "statistics.txt")
286
287 def add_execution(self, sut_node: NodeConfiguration) -> ExecutionResult:
288 execution_result = ExecutionResult(sut_node)
289 self._inner_results.append(execution_result)
290 return execution_result
291
292 def add_error(self, error) -> None:
293 self._errors.append(error)
294
295 def process(self) -> None:
296 """
297 Process the data after a DTS run.
298 The data is added to nested objects during runtime and this parent object
299 is not updated at that time. This requires us to process the nested data
300 after it's all been gathered.
301
302 The processing gathers all errors and the result statistics of test cases.
303 """
304 self._errors += self.get_errors()
305 if self._errors and self._logger:
306 self._logger.debug("Summary of errors:")
307 for error in self._errors:
308 self._logger.debug(repr(error))
309
310 self._stats_result = Statistics(self.dpdk_version)
311 self.add_stats(self._stats_result)
312 with open(self._stats_filename, "w+") as stats_file:

Callers 1

dts.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected