Skip to content

Commit

Permalink
EPMRPP-95621 || Pattern-Analysis doesn't work on Launch finish when A…
Browse files Browse the repository at this point in the history
…A finished working
  • Loading branch information
APiankouski authored Nov 1, 2024
1 parent e059e0e commit 3190bc4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public ProjectConfigDelegatingSubscriber<LaunchFinishedEvent> launchFinishedDele
LaunchPatternAnalysisRunner patternAnalysisEventHandler,
LaunchNotificationRunner notificationEventHandler) {
return new ProjectConfigDelegatingSubscriber<>(projectConfigProvider,
List.of(autoAnalysisEventHandler,
List.of(patternAnalysisEventHandler,
autoAnalysisEventHandler,
uniqueErrorAnalysisEventHandler,
launchAnalysisFinishEventPublisher,
patternAnalysisEventHandler,
notificationEventHandler
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@
import com.epam.ta.reportportal.core.events.handler.ConfigurableEventHandler;
import com.epam.ta.reportportal.core.events.subscriber.EventSubscriber;
import com.epam.ta.reportportal.core.project.config.ProjectConfigProvider;
import com.epam.ta.reportportal.ws.converter.resource.handler.attribute.launch.LaunchResourceAttributeLogger;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @author <a href="mailto:[email protected]">Ivan Budayeu</a>
*/
public class ProjectConfigDelegatingSubscriber<T extends ProjectIdAwareEvent> implements
EventSubscriber<T> {

private static final Logger LOGGER = LoggerFactory.getLogger(ProjectConfigDelegatingSubscriber.class);

private final ProjectConfigProvider projectConfigProvider;
private final List<ConfigurableEventHandler<T, Map<String, String>>> eventHandlers;

Expand All @@ -41,6 +46,12 @@ public ProjectConfigDelegatingSubscriber(ProjectConfigProvider projectConfigProv
@Override
public void handleEvent(T event) {
final Map<String, String> projectConfig = projectConfigProvider.provide(event.getProjectId());
eventHandlers.forEach(h -> h.handle(event, projectConfig));
eventHandlers.forEach(h -> {
try {
h.handle(event, projectConfig);
} catch (Exception e) {
LOGGER.debug("Error while processing event: " + e.getMessage());
}
});
}
}

0 comments on commit 3190bc4

Please sign in to comment.