use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class JobResultListenerTest method setup.
@Before
public void setup() {
agentService = mockery.mock(AgentService.class);
listener = new JobResultListener(new JobResultTopic(null), agentService);
jobIdentifier = new JobIdentifier("cruise", "1", "dev", "1", "linux-firefox");
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class FailingTestsInPipelineTest method shouldRemoveSuiteIfNoTestsAfterDuplicateRemoval.
@Test
public void shouldRemoveSuiteIfNoTestsAfterDuplicateRemoval() {
failingTests.add("suiteA", "testA", TestStatus.Error, new JobIdentifier("", 3, "", "", "", "job-1"));
failingTests.add("suiteB", "testB", TestStatus.Error, new JobIdentifier("", 3, "", "", "", "job-1"));
FailingTestsInPipeline failingTests1 = new FailingTestsInPipeline("1.3", 3);
failingTests1.add("suiteA", "testA", TestStatus.Error, new JobIdentifier("", 4, "", "", "", "job-1"));
failingTests.removeDuplicateTestEntries(failingTests1);
List<TestSuite> failingSuites = failingTests.failingSuites();
assertThat(failingSuites.size(), is(1));
assertThat(failingSuites.get(0).fullName(), is("suiteB"));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class StageTestRunsTest method removeDuplicateTestEntriesDoesNotEliminatesSusequentDuplicateFailuresWhenJobsAreNotIdentical.
@Test
public void removeDuplicateTestEntriesDoesNotEliminatesSusequentDuplicateFailuresWhenJobsAreNotIdentical() throws Exception {
StageTestRuns stageTestRuns = new StageTestRuns(999, 0, 0);
JobIdentifier job1 = new JobIdentifier(null, 1, null, null, null, "job1");
JobIdentifier job2 = new JobIdentifier(null, 1, null, null, null, "job2");
stageTestRuns.add(18, "1.8", "testSuite1", "testName1", TestStatus.Failure, job1);
stageTestRuns.add(18, "1.8", "testSuite1", "testName1", TestStatus.Failure, job2);
stageTestRuns.add(17, "1.7", "testSuite1", "testName1", TestStatus.Failure, job2);
stageTestRuns.add(16, "1.6", "testSuite1", "testName1", TestStatus.Failure, job1);
stageTestRuns.removeDuplicateTestEntries();
FailingTestsInPipeline pipeline8 = stageTestRuns.failingTestsInPipelines().get(0);
FailingTestsInPipeline pipeline7 = stageTestRuns.failingTestsInPipelines().get(1);
FailingTestsInPipeline pipeline6 = stageTestRuns.failingTestsInPipelines().get(2);
assertThat(pipeline8.failingSuites().size(), is(1));
assertThat(pipeline8.failingSuites().get(0).tests().get(0).getJobNames().size(), is(2));
assertThat(pipeline8.failingSuites().get(0).tests().get(0).getJobNames().get(0), is("job1"));
assertThat(pipeline8.failingSuites().get(0).tests().get(0).getJobNames().get(1), is("job2"));
assertThat(pipeline7.failingSuites().size(), is(1));
assertThat(pipeline7.failingSuites().get(0).tests().get(0).getJobNames().size(), is(1));
assertThat(pipeline7.failingSuites().get(0).tests().get(0).getJobNames().get(0), is("job2"));
assertThat(pipeline6.failingSuites().size(), is(1));
assertThat(pipeline6.failingSuites().get(0).tests().get(0).getJobNames().size(), is(1));
assertThat(pipeline6.failingSuites().get(0).tests().get(0).getJobNames().get(0), is("job1"));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class StageTestRunsTest method removeDuplicateTestEntriesEliminatesSusequentDuplicateFailures.
@Test
public void removeDuplicateTestEntriesEliminatesSusequentDuplicateFailures() 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.failingTestsInPipelines().size(), is(3));
FailingTestsInPipeline pipeline8 = stageTestRuns.failingTestsInPipelines().get(0);
FailingTestsInPipeline pipeline7 = stageTestRuns.failingTestsInPipelines().get(1);
FailingTestsInPipeline pipeline6 = stageTestRuns.failingTestsInPipelines().get(2);
assertThat(pipeline8.failingSuites().size(), is(0));
assertThat(pipeline7.failingSuites().size(), is(0));
assertThat(pipeline6.failingSuites().size(), is(1));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class TestInformationTest method equalsFalseWhenStatusSameNameSameAndJobIdentifiersHaveDifferentNames.
@Test
public void equalsFalseWhenStatusSameNameSameAndJobIdentifiersHaveDifferentNames() {
TestInformation testInformation1 = new TestInformation("testA", TestStatus.Error);
testInformation1.addJob(new JobIdentifier("", -1, "", "", "", "job-1"));
TestInformation testInformation2 = new TestInformation("testA", TestStatus.Error);
testInformation2.addJob(new JobIdentifier("", -1, "", "", "", "job-2"));
assertThat(testInformation1, not(testInformation2));
assertThat(testInformation2, not(testInformation1));
assertThat(Arrays.asList(testInformation1), not(hasItem(testInformation2)));
}
Aggregations