def stop_test(): logger.debug('stop_test') start_test_if_required() test_obj = TestResult() if not test_obj.is_test_completed(): logger.warning('Test did not complete.') end_test(True)
def start_next_iteration(self, value, iteration_id): logger.info('start next iteration.') # make sure no active iteration running. if self.is_iteration_running(): logger.warning('Complete iteration call missing for previous iteration.') self.complete_active_iteration() self._active_iteration_info = ActiveIterationInfo(value, iteration_id, self._iterator_param) self._active_iteration_info._start_time = result_utils.get_current_time_string() self._active_iteration_status = ActiveIterationStatus(EnumExecStatus.running) self.commit_active_info_status() logger.debug('start next iteration completed.') logger.log_result_info_status(self._stc_result_object)
def complete(self, force_stop): logger.info('Complete - End iterator.') if self.is_iteration_running(): logger.warning('Complete iteration call missing before end iterator.') self.complete_active_iteration(force_stop) self.load_all_iterator_data() if force_stop is True: self._status.exec_status = EnumExecStatus.stopped else: self._status.exec_status = EnumExecStatus.completed self._status.verdict = EnumVerdict.none self._info.set_data_format(self._info, EnumDataFormat.group) self._info.set_data_class(self._info, EnumDataClass.iterator_result) iteratorData = self._info.run_time_data iteratorData[self._status.dict_name] = self._status.run_time_data allData = self.get_from_stc_collection_property_as_dict(self.stc_property_completed_data) iteratorData[self.get_data_dict_name()] = result_utils.wrap_data_as_single_group(allData) self._stc_result_object.MarkDelete() logger.debug('Complete - End iterator completed.') return iteratorData
def start_test_if_required(test_obj=None): if test_obj is None: test_obj = TestResult() if not test_obj.is_test_started(): logger.warning('Test is not created and/or started.') test_obj.start_test()