Search in sources :

Example 1 with Pipeline

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

the class PipelineWithTwoStages method createPipelineWithFirstStagePassedAndSecondStageRunning.

public Pipeline createPipelineWithFirstStagePassedAndSecondStageRunning() {
    Pipeline pipeline = createPipelineWithFirstStageScheduled();
    dbHelper.passStage(pipeline.getFirstStage());
    dbHelper.scheduleStage(pipeline, pipelineConfig().findBy(new CaseInsensitiveString(ftStage)));
    return dbHelper.getPipelineDao().mostRecentPipeline(pipeline.getName());
}
Also used : Pipeline(com.thoughtworks.go.domain.Pipeline)

Example 2 with Pipeline

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

the class StageResultCacheTest method shouldSendStageResultMessageWhenStageComplete.

@Test
public void shouldSendStageResultMessageWhenStageComplete() {
    Pipeline pipeline = pipelineFixture.createdPipelineWithAllStagesPassed();
    StageResultTopicStub stub = new StageResultTopicStub(messagingService);
    StageResultCache cache = new StageResultCache(stageDao, stub, stageStatusTopic);
    StageIdentifier identifier = pipeline.getFirstStage().getIdentifier();
    cache.onMessage(new StageStatusMessage(identifier, StageState.Passed, StageResult.Passed));
    assertThat(stub.message, is(new StageResultMessage(identifier, StageEvent.Passes, Username.BLANK)));
    cache.onMessage(new StageStatusMessage(identifier, StageState.Failed, StageResult.Failed));
    assertThat(stub.message, is(new StageResultMessage(identifier, StageEvent.Breaks, Username.BLANK)));
}
Also used : StageIdentifier(com.thoughtworks.go.domain.StageIdentifier) StageResultMessage(com.thoughtworks.go.server.messaging.StageResultMessage) StageStatusMessage(com.thoughtworks.go.server.messaging.StageStatusMessage) Pipeline(com.thoughtworks.go.domain.Pipeline) Test(org.junit.Test)

Example 3 with Pipeline

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

the class PipelineWithRunOnAllJob method createPipelineWithFirstStageAssigned.

public Pipeline createPipelineWithFirstStageAssigned(String agentId) {
    Pipeline pipeline = createPipelineWithFirstStageScheduled();
    JobInstances instances = pipeline.getStages().byName(devStage).getJobInstances();
    for (JobInstance instance : instances) {
        dbHelper.assignToAgent(instance, agentId);
    }
    return dbHelper.getPipelineDao().loadPipeline(pipeline.getId());
}
Also used : JobInstance(com.thoughtworks.go.domain.JobInstance) Pipeline(com.thoughtworks.go.domain.Pipeline) JobInstances(com.thoughtworks.go.domain.JobInstances)

Example 4 with Pipeline

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

the class PipelineWithRunOnAllJob method createPipelineWithFirstStageScheduled.

public Pipeline createPipelineWithFirstStageScheduled(MaterialRevisions materialRevisions) {
    Pipeline pipeline = schedulePipeline(BuildCause.createWithModifications(materialRevisions, ""));
    dbHelper.save(pipeline);
    return pipeline;
}
Also used : Pipeline(com.thoughtworks.go.domain.Pipeline)

Example 5 with Pipeline

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

the class PipelineWithRunOnAllJob method createPipelineWithFirstStageScheduled.

public Pipeline createPipelineWithFirstStageScheduled() {
    Pipeline mostRecent = dbHelper.getPipelineDao().mostRecentPipeline(pipelineName);
    bombIf(mostRecent.getStages().byName(devStage).isActive(), "Can not schedule new pipeline: the first stage is still running");
    Pipeline pipeline = schedulePipeline();
    dbHelper.savePipelineWithStagesAndMaterials(pipeline);
    return pipeline;
}
Also used : Pipeline(com.thoughtworks.go.domain.Pipeline)

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