use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class FailingTestsInPipelineTest method shouldOrderSuitesAlphabetically.
@Test
public void shouldOrderSuitesAlphabetically() throws Exception {
failingTests.add("suiteB", "testA", TestStatus.Error, new JobIdentifier("", -1, "", "", "", "job-1"));
failingTests.add("suiteA", "testA", TestStatus.Error, new JobIdentifier("", -1, "", "", "", "job-1"));
failingTests.add("suiteZ", "testA", TestStatus.Error, new JobIdentifier("", -1, "", "", "", "job-1"));
failingTests.add("suiteD", "testA", TestStatus.Error, new JobIdentifier("", -1, "", "", "", "job-1"));
List<TestSuite> suites = failingTests.failingSuites();
assertThat(suites.size(), is(4));
assertThat(suites.get(0).fullName(), is("suiteA"));
assertThat(suites.get(1).fullName(), is("suiteB"));
assertThat(suites.get(2).fullName(), is("suiteD"));
assertThat(suites.get(3).fullName(), is("suiteZ"));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class StageTestRunsTest method removeDuplicateTestEntriesFromNonAdjacentRuns.
@Test
public void removeDuplicateTestEntriesFromNonAdjacentRuns() throws Exception {
StageTestRuns stageTestRuns = new StageTestRuns(999, 0, 0);
JobIdentifier jobIdentifier = new JobIdentifier(null, 1, null, null, null, "job1");
stageTestRuns.add(10, "1.0", "suite1", "test1-2", TestStatus.Failure, jobIdentifier);
stageTestRuns.add(10, "1.0", "suite1", "test1-1", TestStatus.Error, jobIdentifier);
stageTestRuns.add(11, "1.1", "suite1", "test1-1", TestStatus.Error, jobIdentifier);
stageTestRuns.add(9, "0.9", "suite1", "test1-2", TestStatus.Failure, jobIdentifier);
stageTestRuns.removeDuplicateTestEntries();
FailingTestsInPipeline pipeline10 = stageTestRuns.failingTestsInPipelines().get(0);
FailingTestsInPipeline pipeline11 = stageTestRuns.failingTestsInPipelines().get(1);
FailingTestsInPipeline pipeline09 = stageTestRuns.failingTestsInPipelines().get(2);
assertThat(pipeline10.failingSuites().size(), is(1));
assertThat(pipeline10.failingSuites().get(0).tests().size(), is(1));
assertThat(pipeline11.failingSuites().size(), is(1));
assertThat(pipeline11.failingSuites().get(0).tests().size(), is(1));
assertThat(pipeline09.failingSuites().size(), is(0));
}
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 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)));
}
Aggregations