@Test
  public void shouldNotScheduleBuildIfNoModification() throws Exception {
    autoSchedulePipelines("mingle", "evolve");
    // Get the scheduled evolve stage and complete it.
    Stage evolveInstance =
        stageDao.mostRecentWithBuilds(
            CaseInsensitiveString.str(evolveConfig.name()),
            evolveConfig.findBy(new CaseInsensitiveString("dev")));
    dbHelper.passStage(evolveInstance);
    stageDao.stageStatusChanged(evolveInstance);

    autoSchedulePipelines();
    Stage mostRecent =
        stageDao.mostRecentWithBuilds(
            CaseInsensitiveString.str(evolveConfig.name()),
            evolveConfig.findBy(new CaseInsensitiveString("dev")));

    assertThat(mostRecent.getId(), is(evolveInstance.getId()));
    assertThat(mostRecent.getJobInstances().first().getState(), is(JobState.Completed));
  }
示例#2
0
 @Deprecated // Only actually passes the first stage. Use newPipelineWithAllStagesPassed instead
 public Pipeline passPipeline(Pipeline pipeline) {
   for (Stage stage : pipeline.getStages()) {
     passStage(stage);
   }
   Stages loadedStages = new Stages();
   for (Stage stage : pipeline.getStages()) {
     loadedStages.add(stageDao.stageById(stage.getId()));
   }
   Pipeline loadedPipeline = this.pipelineDao.loadPipeline(pipeline.getId());
   loadedPipeline.setStages(loadedStages);
   return loadedPipeline;
 }