use of com.thoughtworks.studios.shine.cruise.builder.JunitXML 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.studios.shine.cruise.builder.JunitXML in project gocd by gocd.
the class ShineDaoIntegrationTest method failingStageHistory.
private StageTestRuns failingStageHistory() {
failureSetup.setupPipelineInstance(true, null, Arrays.asList(new Modification("fooUser", "revision 15", "loser@mail.com", new Date(), "15"), new Modification("RRR & DR", "revision 16", "boozer@mail.com", new Date(), "16")), new TestFailureSetup.TestResultsStubbing() {
public void stub(Stage stage) {
JunitXML junit1 = junitXML("testSuite1", 2).failed(2).errored(1);
junit1.registerStubContent(goURLRepository, "pipelines/" + stage.getJobInstances().get(0).getIdentifier().artifactLocator("junit") + "/junit/");
}
}, new Date());
stageId = failureSetup.setupPipelineInstance(true, null, Arrays.asList(new Modification("blahUser", "revision 17", "hello@world", new Date(), "17")), new TestFailureSetup.TestResultsStubbing() {
public void stub(Stage 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;
return shineDao.failedBuildHistoryForStage(stageId, result);
}
use of com.thoughtworks.studios.shine.cruise.builder.JunitXML in project gocd by gocd.
the class TestFailureSetup method setupPipelineInstance.
public SavedStage setupPipelineInstance(final boolean failStage, final String overriddenLabel, final StubGoURLRepository goURLRepository) {
TestResultsStubbing resultStubbing = new TestResultsStubbing() {
public void stub(Stage stage) {
JunitXML junit1 = junitXML("testSuite1", 2).errored(2).failed(1);
junit1.registerStubContent(goURLRepository, "pipelines/" + stage.getJobInstances().get(0).getIdentifier().artifactLocator("junit") + "/junit/");
JunitXML junit2 = junitXML("testSuite1", 1).failed(1);
junit2.registerStubContent(goURLRepository, "pipelines/" + stage.getJobInstances().get(1).getIdentifier().artifactLocator("junit") + "/junit/");
}
};
return setupPipelineInstance(failStage, overriddenLabel, resultStubbing, new Date());
}
Aggregations