Search in sources :

Example 1 with PipelineRunner

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);
    }
}
Also used : ConfigurableTestPipeline(pipelite.tester.pipeline.ConfigurableTestPipeline) PipelineRunner(pipelite.runner.pipeline.PipelineRunner) ArrayList(java.util.ArrayList)

Example 2 with PipelineRunner

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");
}
Also used : PipelineRunner(pipelite.runner.pipeline.PipelineRunner) Pipeline(pipelite.Pipeline)

Aggregations

PipelineRunner (pipelite.runner.pipeline.PipelineRunner)2 ArrayList (java.util.ArrayList)1 Pipeline (pipelite.Pipeline)1 ConfigurableTestPipeline (pipelite.tester.pipeline.ConfigurableTestPipeline)1