Search in sources :

Example 6 with Pipeline

use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.

the class PipelineWithRunOnAllJob method latestPipelineWithIdentifiers.

private Pipeline latestPipelineWithIdentifiers() {
    Pipeline pipeline;
    pipeline = dbHelper.getPipelineDao().mostRecentPipeline(pipelineName);
    //TODO: #2318 - pipeline loaded from DB should contain identifiers
    for (Stage stage : pipeline.getStages()) {
        stage.setIdentifier(new StageIdentifier(pipeline, stage));
        for (JobInstance jobInstance : stage.getJobInstances()) {
            jobInstance.setIdentifier(new JobIdentifier(pipeline, stage, jobInstance));
        }
    }
    return pipeline;
}
Also used : StageIdentifier(com.thoughtworks.go.domain.StageIdentifier) JobInstance(com.thoughtworks.go.domain.JobInstance) Stage(com.thoughtworks.go.domain.Stage) JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) Pipeline(com.thoughtworks.go.domain.Pipeline)

Example 7 with Pipeline

use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.

the class PipelineWithTwoStages method latestPipelineWithIdentifiers.

private Pipeline latestPipelineWithIdentifiers() {
    Pipeline pipeline;
    pipeline = dbHelper.getPipelineDao().mostRecentPipeline(pipelineName);
    //TODO: #2318 - pipeline loaded from DB should contain identifiers
    for (Stage stage : pipeline.getStages()) {
        stage.setIdentifier(new StageIdentifier(pipeline, stage));
        for (JobInstance jobInstance : stage.getJobInstances()) {
            jobInstance.setIdentifier(new JobIdentifier(pipeline, stage, jobInstance));
        }
    }
    return pipeline;
}
Also used : StageIdentifier(com.thoughtworks.go.domain.StageIdentifier) JobInstance(com.thoughtworks.go.domain.JobInstance) Stage(com.thoughtworks.go.domain.Stage) JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) Pipeline(com.thoughtworks.go.domain.Pipeline)

Example 8 with Pipeline

use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.

the class GoPropertiesTestTest method shouldGeneratePropertiesAfterBuildCompleted.

@Test
public void shouldGeneratePropertiesAfterBuildCompleted() throws Exception {
    Pipeline newPipeline = fixture.createPipelineWithFirstStageAssigned(AGENT_UUID);
    JobInstance job = completeStageAndTrigger(newPipeline.getFirstStage());
    assertCommonBuildProperties(newPipeline, job);
    assertThat(propertyDao.value(job.getId(), GoConstants.CRUISE_AGENT), is(HOSTNAME));
}
Also used : JobInstance(com.thoughtworks.go.domain.JobInstance) Pipeline(com.thoughtworks.go.domain.Pipeline) Test(org.junit.Test)

Example 9 with Pipeline

use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.

the class RestfulServiceTest method canSupportQueryingUsingPipelineNameWithDifferentCase.

@Test
public void canSupportQueryingUsingPipelineNameWithDifferentCase() throws Exception {
    Pipeline pipeline = fixture.createdPipelineWithAllStagesPassed();
    JobIdentifier jobIdentifier = restfulService.findJob(pipeline.getName().toUpperCase(), JobIdentifier.LATEST, fixture.devStage, "", PipelineWithTwoStages.JOB_FOR_DEV_STAGE);
    assertThat(jobIdentifier.getPipelineName(), is(pipeline.getName()));
}
Also used : JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) Pipeline(com.thoughtworks.go.domain.Pipeline) Test(org.junit.Test)

Example 10 with Pipeline

use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.

the class RestfulServiceTest method shouldShouldTranslateLatestPipelineLabel.

@Test
public void shouldShouldTranslateLatestPipelineLabel() throws Exception {
    fixture.createdPipelineWithAllStagesPassed();
    Pipeline latestPipleine = fixture.createdPipelineWithAllStagesPassed();
    final JobIdentifier jobIdentifier1 = new JobIdentifier(latestPipleine.getName(), JobIdentifier.LATEST, fixture.devStage, JobIdentifier.LATEST, PipelineWithTwoStages.JOB_FOR_DEV_STAGE);
    JobIdentifier jobIdentifier = restfulService.findJob(jobIdentifier1.getPipelineName(), jobIdentifier1.getPipelineLabel(), jobIdentifier1.getStageName(), jobIdentifier1.getStageCounter(), jobIdentifier1.getBuildName());
    assertThat(jobIdentifier.getPipelineLabel(), is(latestPipleine.getLabel()));
}
Also used : JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) Pipeline(com.thoughtworks.go.domain.Pipeline) Test(org.junit.Test)

Aggregations

Pipeline (com.thoughtworks.go.domain.Pipeline)177 Test (org.junit.jupiter.api.Test)73 Test (org.junit.Test)55 Stage (com.thoughtworks.go.domain.Stage)40 JobInstance (com.thoughtworks.go.domain.JobInstance)26 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)23 Username (com.thoughtworks.go.server.domain.Username)17 ServerHealthStateOperationResult (com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult)16 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)14 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)12 JobIdentifier (com.thoughtworks.go.domain.JobIdentifier)12 StageIdentifier (com.thoughtworks.go.domain.StageIdentifier)11 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)10 ModelAndView (org.springframework.web.servlet.ModelAndView)10 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)9 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)9 Modification (com.thoughtworks.go.domain.materials.Modification)9 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)7 PipelineState (com.thoughtworks.go.domain.PipelineState)6 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)6