use of com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig in project service-api by reportportal.
the class SaveLastRunAttributePartProviderTest method shouldUpdateWhenExists.
@Test
void shouldUpdateWhenExists() {
final GenerateClustersConfig config = getConfig(false);
final ItemAttribute itemAttribute = new ItemAttribute();
when(itemAttributeRepository.findByLaunchIdAndKeyAndSystem(config.getLaunchId(), RP_CLUSTER_LAST_RUN_KEY, true)).thenReturn(Optional.of(itemAttribute));
final PipelinePart pipelinePart = provider.provide(config);
pipelinePart.handle();
verify(itemAttributeRepository, times(1)).save(itemAttribute);
}
use of com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig in project service-api by reportportal.
the class ConfigProvider method getConfig.
public static final GenerateClustersConfig getConfig(boolean forUpdate) {
final GenerateClustersConfig config = new GenerateClustersConfig();
final AnalyzerConfig analyzerConfig = new AnalyzerConfig();
analyzerConfig.setNumberOfLogLines(1);
config.setAnalyzerConfig(analyzerConfig);
config.setProject(1L);
config.setLaunchId(1L);
config.setForUpdate(forUpdate);
config.setCleanNumbers(false);
return config;
}
use of com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig in project service-api by reportportal.
the class UpdateLaunchHandlerImpl method createClusters.
@Override
@Transactional
public OperationCompletionRS createClusters(CreateClustersRQ createClustersRQ, ReportPortalUser.ProjectDetails projectDetails, ReportPortalUser user) {
final Launch launch = getLaunchHandler.getLaunch(createClustersRQ.getLaunchId());
launchAccessValidator.validate(launch, projectDetails, user);
// TODO should be put inside *Validator after validators refactoring
expect(launch.getStatus(), not(statusIn(StatusEnum.IN_PROGRESS))).verify(INCORRECT_REQUEST, "Cannot analyze launch in progress.");
final Project project = getProjectHandler.getProject(projectDetails);
AnalyzerConfig analyzerConfig = getAnalyzerConfig(project);
final GenerateClustersConfig config = new GenerateClustersConfig();
config.setAnalyzerConfig(analyzerConfig);
config.setLaunchId(launch.getId());
config.setProject(project.getId());
config.setForUpdate(false);
config.setCleanNumbers(createClustersRQ.isRemoveNumbers());
clusterGenerator.generate(config);
return new OperationCompletionRS(Suppliers.formattedSupplier("Clusters generation for launch with ID='{}' started.", launch.getId()).get());
}
Aggregations