use of pipelite.tester.pipeline.ConfigurableTestSchedule in project pipelite by enasequence.
the class TestTypeScheduleRunner method runSchedules.
public <T extends SingleStageTestProcessConfiguration> void runSchedules(StageService stageServiceSpy, int schedulerSeconds, int processCnt, Function<TestType, T> testProcessConfigurationFactory) {
// Register test pipelines.
List<ConfigurableTestSchedule<T>> testSchedules = new ArrayList<>();
for (TestType testType : TestType.tests) {
ConfigurableTestSchedule<T> schedule = new ConfigurableTestSchedule<>("0/" + schedulerSeconds + " * * * * ?", testProcessConfigurationFactory.apply(testType));
testSchedules.add(schedule);
registeredPipelineService.registerPipeline(schedule);
}
registeredScheduleService.saveSchedules();
// Spy stage service.
TestType.spyStageService(stageServiceSpy);
try {
processRunnerPoolManager.createPools();
ScheduleRunner scheduleRunner = runnerService.getScheduleRunner();
for (ConfigurableTestSchedule<T> f : testSchedules) {
scheduleRunner.setMaximumExecutions(f.pipelineName(), processCnt);
}
processRunnerPoolManager.startPools();
processRunnerPoolManager.waitPoolsToStop();
for (ConfigurableTestSchedule<T> f : testSchedules) {
assertSchedule(stageServiceSpy, f, processCnt);
}
} finally {
for (ConfigurableTestSchedule<T> f : testSchedules) {
deleteSchedule(f);
}
}
}
Aggregations