use of com.thoughtworks.go.domain.StageIdentifier in project gocd by gocd.
the class ShineDaoIntegrationTest method shouldRetriveHistoricalFailureInformation.
@Test
public void shouldRetriveHistoricalFailureInformation() throws Exception {
Pipeline pipeline1 = pipeline;
TestFailureSetup.SavedStage savedStage = failureSetup.setupPipelineInstance(true, null, goURLRepository);
StageIdentifier stageId2 = savedStage.stageId;
Pipeline pipeline2 = savedStage.pipeline;
StageTestRuns stageTestRuns = shineDao.failedBuildHistoryForStage(stageId2, result);
List<FailingTestsInPipeline> failingTestsInPipelines = stageTestRuns.failingTestsInPipelines();
assertThat(failingTestsInPipelines.size(), is(2));
FailingTestsInPipeline failingPipeline2 = failingTestsInPipelines.get(0);
assertThat(failingPipeline2.getLabel(), is(pipeline2.getLabel()));
assertThat(failingPipeline2.failingSuites().size(), is(0));
FailingTestsInPipeline failingPipeline1 = failingTestsInPipelines.get(1);
assertThat(failingPipeline1.getLabel(), is(pipeline1.getLabel()));
assertThat(failingPipeline1.failingSuites().size(), is(1));
}
use of com.thoughtworks.go.domain.StageIdentifier in project gocd by gocd.
the class ShineDaoIntegrationTest method shouldReturnTheTotalNumberOfFailuresAndErrorsForAPassedStage.
@Test
public void shouldReturnTheTotalNumberOfFailuresAndErrorsForAPassedStage() {
StageIdentifier stageId = failureSetup.setupPipelineInstance(false, null, Arrays.asList(new Modification("blahUser", "revision 17", "hello@world", new Date(), "17")), new TestFailureSetup.TestResultsStubbing() {
public void stub(Stage stage) {
dbHelper.passStage(stage);
JunitXML junit1 = junitXML("testSuite1", 2).failed(2).errored(1);
junit1.registerStubContent(goURLRepository, "pipelines/" + stage.getJobInstances().get(0).getIdentifier().artifactLocator("junit") + "/junit/");
JunitXML junit2 = junitXML("testSuite1", 2).errored(1);
junit2.registerStubContent(goURLRepository, "pipelines/" + stage.getJobInstances().get(1).getIdentifier().artifactLocator("junit") + "/junit/");
}
}, new Date()).stageId;
StageTestRuns testRuns = shineDao.failedBuildHistoryForStage(stageId, result);
assertThat(testRuns.numberOfTests(), is(4));
assertThat(testRuns.totalErrorCount(), is(2));
assertThat(testRuns.totalFailureCount(), is(1));
}
use of com.thoughtworks.go.domain.StageIdentifier in project gocd by gocd.
the class FailedBuildHistoryCacheSweeperTest method shouldClearFbhForPipelinesAfterUpdatedPipeline.
@Test
public void shouldClearFbhForPipelinesAfterUpdatedPipeline() {
PipelineIdentifier pipelineIdentifier = entryAfterNew.getPipelineLocator();
Stage stage = StageMother.cancelledStage("dev", "rspec");
stage.setIdentifier(new StageIdentifier(pipelineIdentifier, "dev", "2"));
String pipelineKey = key.forFbhOfStagesUnderPipeline(pipelineIdentifier);
String stageKey = key.forFailedBuildHistoryStage(stage, "html");
goCache.put(pipelineKey, stageKey, "fragment");
sweeper.added(newlyAddedEntry, timeline);
assertThat(goCache.get(pipelineKey), is(nullValue()));
}
use of com.thoughtworks.go.domain.StageIdentifier in project gocd by gocd.
the class StageNotificationServiceTest method setUp.
@Before
public void setUp() {
pipelineService = mock(PipelineService.class);
userService = mock(UserService.class);
systemEnvironment = mock(SystemEnvironment.class);
stageService = mock(StageService.class);
inMemoryEmailNotificationTopic = new InMemoryEmailNotificationTopic();
serverConfigService = mock(ServerConfigService.class);
goConfigService = mock(GoConfigService.class);
shineDao = mock(ShineDao.class);
stageNotificationService = new StageNotificationService(pipelineService, userService, inMemoryEmailNotificationTopic, systemEnvironment, stageService, serverConfigService, shineDao);
stageIdentifier = new StageIdentifier("go", 1, "go-1", "dev", "2");
instanceFactory = new InstanceFactory();
}
use of com.thoughtworks.go.domain.StageIdentifier in project gocd by gocd.
the class StageFeedEntryTest method shouldNotAddDuplicateMingleCardsToMingleCardsList.
@Test
public void shouldNotAddDuplicateMingleCardsToMingleCardsList() {
StageFeedEntry entry = new StageFeedEntry(1, 1, new StageIdentifier(), 1, new Date(), StageResult.Passed);
entry.addCard(new MingleCard(new MingleConfig("mingle-url", "project-name", null), "#1234"));
entry.addCard(new MingleCard(new MingleConfig("mingle-url", "project-name", null), "#1234"));
entry.addCard(new MingleCard(new MingleConfig("mingle-url", "project-name-2", null), "#5678"));
assertThat(entry.getMingleCards().size(), is(2));
}
Aggregations