use of com.thoughtworks.go.fixture.PipelineWithMultipleStages in project gocd by gocd.
the class ScheduleStageTest method setUp.
@Before
public void setUp() throws Exception {
configHelper = new GoConfigFileHelper().usingCruiseConfigDao(dao);
fixture = new PipelineWithMultipleStages(3, materialRepository, transactionTemplate);
fixture.usingThreeJobs();
fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
}
use of com.thoughtworks.go.fixture.PipelineWithMultipleStages in project gocd by gocd.
the class StageServiceIntegrationTest method shouldSaveTheStageStatusProperlyUponJobCancelAfterInvalidatingTheCache.
@Test
public void shouldSaveTheStageStatusProperlyUponJobCancelAfterInvalidatingTheCache() throws Exception {
fixture = (PipelineWithMultipleStages) new PipelineWithMultipleStages(2, materialRepository, transactionTemplate).usingTwoJobs();
fixture.usingConfigHelper(configFileHelper).usingDbHelper(dbHelper).onSetUp();
Pipeline pipeline = fixture.createPipelineWithFirstStageAssigned();
Stage currentStage = pipeline.getFirstStage();
JobInstances jobs = currentStage.getJobInstances();
JobInstance firstJob = jobs.first();
firstJob.completing(JobResult.Passed);
firstJob.completed(new Date());
jobInstanceDao.updateStateAndResult(firstJob);
// prime the cache
stageService.findStageWithIdentifier(new StageIdentifier(pipeline, currentStage));
stageService.cancelJob(jobs.last());
Stage savedStage = stageService.stageById(currentStage.getId());
assertThat(savedStage.getState(), is(StageState.Cancelled));
assertThat(savedStage.getResult(), is(StageResult.Cancelled));
}
use of com.thoughtworks.go.fixture.PipelineWithMultipleStages in project gocd by gocd.
the class PipelineHistoryServiceIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
goCache.clear();
pipelineOne = new PipelineWithMultipleStages(3, materialRepository, transactionTemplate);
pipelineOne.setGroupName("group1");
pipelineTwo = new PipelineWithTwoStages(materialRepository, transactionTemplate);
pipelineTwo.setGroupName("group2");
diskIsFull = new ArtifactsDiskIsFull();
configHelper.usingCruiseConfigDao(goConfigDao);
configHelper.onSetUp();
dbHelper.onSetUp();
pipelineOne.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
pipelineTwo.usingConfigHelper(configHelper).usingDbHelper(dbHelper).addToSetup();
pipelineOne.configStageAsManualApprovalWithApprovedUsers(pipelineOne.stageName(2), "jez");
configHelper.addSecurityWithAdminConfig();
configHelper.setOperatePermissionForGroup("group1", "jez");
pipelineCommentFeatureToggleState = featureToggleService.isToggleOn(Toggles.PIPELINE_COMMENT_FEATURE_TOGGLE_KEY);
featureToggleService.changeValueOfToggle(Toggles.PIPELINE_COMMENT_FEATURE_TOGGLE_KEY, true);
notifier.disableUpdates();
}
use of com.thoughtworks.go.fixture.PipelineWithMultipleStages in project gocd by gocd.
the class StageServiceIntegrationTest method shouldReturnFalseWhenAllStagesAreCompletedInAGivenPipeline.
@Test
public void shouldReturnFalseWhenAllStagesAreCompletedInAGivenPipeline() throws Exception {
fixture = new PipelineWithMultipleStages(4, materialRepository, transactionTemplate);
fixture.usingConfigHelper(configFileHelper).usingDbHelper(dbHelper).onSetUp();
Pipeline pipeline = fixture.createdPipelineWithAllStagesPassed();
assertThat(stageService.isAnyStageActiveForPipeline(fixture.pipelineName, pipeline.getCounter()), Is.is(false));
}
Aggregations