use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class StageTestRunsTest method shouldReturnAllPipelineCounters.
@Test
public void shouldReturnAllPipelineCounters() throws Exception {
StageTestRuns stageTestRuns = new StageTestRuns(999, 0, 0);
JobIdentifier jobIdentifier = new JobIdentifier(null, 1, null, null, null, "job1");
stageTestRuns.add(18, "1.8", "testSuite1", "testName1", TestStatus.Failure, jobIdentifier);
stageTestRuns.add(17, "1.7", "testSuite1", "testName1", TestStatus.Failure, jobIdentifier);
stageTestRuns.add(16, "1.6", "testSuite1", "testName1", TestStatus.Failure, jobIdentifier);
stageTestRuns.removeDuplicateTestEntries();
assertThat(stageTestRuns.failingCounters(), is(Arrays.asList(16, 17, 18)));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class StageTestRunsTest method removeDuplicateTestEntriesShouldRemoveFailuresThatHaveBeenFixedInSubsequentPipelines.
@Test
public void removeDuplicateTestEntriesShouldRemoveFailuresThatHaveBeenFixedInSubsequentPipelines() throws Exception {
StageTestRuns stageTestRuns = new StageTestRuns(999, 0, 0);
JobIdentifier jobIdentifier = new JobIdentifier(null, 1, null, null, null, "job1");
stageTestRuns.add(18, "1.8", "testSuite1", "testName0", TestStatus.Failure, jobIdentifier);
stageTestRuns.add(17, "1.7", "testSuite1", "testName0", TestStatus.Failure, jobIdentifier);
stageTestRuns.add(17, "1.7", "testSuite1", "testName1", TestStatus.Failure, jobIdentifier);
stageTestRuns.removeDuplicateTestEntries();
assertThat(stageTestRuns.failingTestsInPipelines().size(), is(2));
FailingTestsInPipeline pipeline8 = stageTestRuns.failingTestsInPipelines().get(0);
FailingTestsInPipeline pipeline7 = stageTestRuns.failingTestsInPipelines().get(1);
assertThat(pipeline8.failingSuites().size(), is(0));
assertThat(pipeline7.failingSuites().size(), is(1));
assertThat(pipeline7.failingSuites().get(0).tests().size(), is(1));
assertThat(pipeline7.failingSuites().get(0).tests().get(0).getName(), is("testName0"));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class StageTestRunsTest method shouldReturnTheTotalNumberOfErrorsAndFailuresRollingUpFailuresInMultipleJobsToSingleFailure.
@Test
public void shouldReturnTheTotalNumberOfErrorsAndFailuresRollingUpFailuresInMultipleJobsToSingleFailure() throws Exception {
StageTestRuns stageTestRuns = new StageTestRuns(999, 3, 2);
JobIdentifier jobIdentifier1 = new JobIdentifier(null, 1, null, null, null, "job1");
JobIdentifier jobIdentifier2 = new JobIdentifier(null, 1, null, null, null, "job2");
stageTestRuns.add(18, "lbl", "testSuite1", "testName1", TestStatus.Failure, jobIdentifier1);
stageTestRuns.add(18, "lbl", "testSuite1", "testName1", TestStatus.Failure, jobIdentifier2);
stageTestRuns.add(18, "lbl", "testSuite1", "testName2", TestStatus.Error, jobIdentifier1);
stageTestRuns.add(18, "lbl", "testSuite1", "testName3", TestStatus.Failure, jobIdentifier1);
stageTestRuns.add(18, "lbl", "testSuite1", "testName4", TestStatus.Error, jobIdentifier1);
stageTestRuns.add(18, "lbl", "testSuite1", "testName5", TestStatus.Failure, jobIdentifier1);
stageTestRuns.add(17, "lbl", "testSuite1", "testName4", TestStatus.Error, jobIdentifier1);
stageTestRuns.add(17, "lbl", "testSuite1", "testName5", TestStatus.Failure, jobIdentifier1);
stageTestRuns.add(16, "lbl", "testSuite1", "testName6", TestStatus.Failure, jobIdentifier1);
stageTestRuns.removeDuplicateTestEntries();
assertThat(stageTestRuns.count(TestStatus.Error), is(2));
assertThat(stageTestRuns.count(TestStatus.Failure), is(3));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class TestInformationTest method equalsTrueWhenStatusSameNameSameAndJobIdentifiersHaveSameNames.
@Test
public void equalsTrueWhenStatusSameNameSameAndJobIdentifiersHaveSameNames() {
TestInformation info1 = new TestInformation("test", TestStatus.Error);
info1.addJob(new JobIdentifier(null, 1, null, null, null, "job1"));
info1.addJob(new JobIdentifier(null, 2, null, null, null, "job"));
TestInformation info2 = new TestInformation("test", TestStatus.Error);
info2.addJob(new JobIdentifier(null, 3, null, null, null, "job1"));
info2.addJob(new JobIdentifier(null, 4, null, null, null, "job"));
assertThat(info1, is(info2));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class TestInformationTest method testShouldSortJobIdentifiers.
@Test
public void testShouldSortJobIdentifiers() {
TestInformation info = new TestInformation("test", TestStatus.Error);
JobIdentifier first = new JobIdentifier(null, 1, null, null, null, "job1");
JobIdentifier second = new JobIdentifier(null, 1, null, null, null, "job");
info.addJob(first);
info.addJob(second);
assertThat(info.getJobs(), is(Arrays.asList(second, first)));
}
Aggregations