use of pipelite.runner.pipeline.PipelineRunner in project pipelite by enasequence.
the class TestTypePipelineRunner method runPipelines.
public <T extends SingleStageTestProcessConfiguration> void runPipelines(StageService stageServiceSpy, int parallelism, int processCnt, Function<TestType, T> testProcessConfigurationFactory) {
// Register test pipelines.
List<ConfigurableTestPipeline<T>> testPipelines = new ArrayList<>();
for (TestType testType : TestType.tests) {
ConfigurableTestPipeline<T> pipeline = new ConfigurableTestPipeline<T>(parallelism, processCnt, testProcessConfigurationFactory.apply(testType));
testPipelines.add(pipeline);
registeredPipelineService.registerPipeline(pipeline);
}
// Spy stage service.
TestType.spyStageService(stageServiceSpy);
// Run test pipelines.
processRunnerPoolManager.createPools();
processRunnerPoolManager.startPools();
processRunnerPoolManager.waitPoolsToStop();
// Assert test pipelines.
for (PipelineRunner pipelineRunner : runnerService.getPipelineRunners()) {
assertThat(pipelineRunner.getActiveProcessRunners().size()).isEqualTo(0);
}
for (ConfigurableTestPipeline<T> testPipeline : testPipelines) {
assertPipeline(stageServiceSpy, testPipeline, processCnt);
}
}
use of pipelite.runner.pipeline.PipelineRunner in project pipelite by enasequence.
the class ProcessRunnerPoolManager method _createPipelineRunners.
/**
* Should not be called directly. Called by {@link #createPools()}.
*/
public void _createPipelineRunners() {
if (state != State.STOPPED) {
log.atWarning().log("Failed to create pipeline runners manager state is not stopped");
return;
}
for (Pipeline pipeline : pipeliteServices.registeredPipeline().getRegisteredPipelines(Pipeline.class)) {
PipelineRunner pipelineRunner = createPipelineRunner(pipeline.pipelineName());
log.atInfo().log("Creating pipeline runner: " + pipeline.pipelineName());
pipeliteServices.runner().addPipelineRunner(pipelineRunner);
pools.add(pipelineRunner);
}
log.atInfo().log("Created pipeline runners");
}
Aggregations