Search in sources :

Example 1 with ConfigurableTestPipeline

use of pipelite.tester.pipeline.ConfigurableTestPipeline 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 ConfigurableTestPipeline

use of pipelite.tester.pipeline.ConfigurableTestPipeline in project pipelite by enasequence.

the class PipelineRunnerProcessQueueTest method sync.

@Test
public void sync() {
    Pipeline pipeline = new ConfigurableTestPipeline<>(PARALLELISM, PROCESS_CNT, new SyncTestProcessConfiguration());
    test(pipeline);
}
Also used : ConfigurableTestPipeline(pipelite.tester.pipeline.ConfigurableTestPipeline) ConfigurableTestPipeline(pipelite.tester.pipeline.ConfigurableTestPipeline) Pipeline(pipelite.Pipeline) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 3 with ConfigurableTestPipeline

use of pipelite.tester.pipeline.ConfigurableTestPipeline in project pipelite by enasequence.

the class PipelineRunnerProcessQueueTest method async.

@Test
public void async() {
    Pipeline pipeline = new ConfigurableTestPipeline<>(PARALLELISM, PROCESS_CNT, new AsyncTestProcessConfiguration());
    test(pipeline);
}
Also used : ConfigurableTestPipeline(pipelite.tester.pipeline.ConfigurableTestPipeline) ConfigurableTestPipeline(pipelite.tester.pipeline.ConfigurableTestPipeline) Pipeline(pipelite.Pipeline) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

ConfigurableTestPipeline (pipelite.tester.pipeline.ConfigurableTestPipeline)3 Test (org.junit.jupiter.api.Test)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 Pipeline (pipelite.Pipeline)2 ArrayList (java.util.ArrayList)1 PipelineRunner (pipelite.runner.pipeline.PipelineRunner)1