def complete_active_iteration(self, force_stop=False): logger.info('completea active iteration.') if not self.is_iteration_running(): logger.error('No active iteration found to complete.') return logger.log_result_info_status(self._stc_result_object) self._active_iteration_info = ActiveIterationInfo() self.load_from_stc_object(self._active_iteration_info) self._active_iteration_status = ActiveIterationStatus() self.load_from_stc_object(self._active_iteration_status) if force_stop is True: self._active_iteration_status.exec_status = EnumExecStatus.stopped else: self._active_iteration_status.exec_status = EnumExecStatus.completed self._active_iteration_info._end_time = result_utils.get_current_time_string() result = self.generate_iteration_verdict() if result: self._active_iteration_status.verdict = result['verdict'] self._active_iteration_info.result_file = result['resultFile'] self._active_iteration_info.set_data_class(self._active_iteration_info, EnumDataClass.iteration_result) self._active_iteration_info.set_data_format(self._active_iteration_info, EnumDataFormat.none) else: self._active_iteration_status.verdict = EnumVerdict.none self._active_iteration_info.set_data_class(self._active_iteration_info, EnumDataClass.iteration_result) self._active_iteration_info.set_data_format(self._active_iteration_info, EnumDataFormat.none) self.save_active_iteration_data() self.reset_active_iteration_data() logger.info('completea active iteration completed.')
def create_new_iterator(self): logger.info('Create new iterator.') self._stc_result_object = iterator_utils.create_iterator_result() self.set_stc_object(self.stc_property_Iterator, str(self._iterator_handle)) self._info = IteratorInfo(self._iterator_param) self._status = Status(EnumExecStatus.created) self.commit_info_status() logger.debug('Create new iterator completed.') logger.log_result_info_status(self._stc_result_object)
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)