Search in sources :

Example 1 with TestInformation

use of com.thoughtworks.go.domain.testinfo.TestInformation in project gocd by gocd.

the class ShineDaoIntegrationTest method shouldContainLocatorForFailedJob.

@Test
public void shouldContainLocatorForFailedJob() throws Exception {
    StageTestRuns stageTestRuns = failingStageHistory();
    List<FailingTestsInPipeline> failingTestsInPipelines = stageTestRuns.failingTestsInPipelines();
    FailingTestsInPipeline failingPipeline7 = failingTestsInPipelines.get(0);
    FailingTestsInPipeline failingPipeline6 = failingTestsInPipelines.get(1);
    List<TestInformation> failingTests7 = failingPipeline7.failingSuites().get(0).tests();
    assertThat(failingTests7.size(), is(1));
    assertThat(failingTests7.get(0).getJobs().size(), is(2));
    assertThat(failingTests7.get(0).getJobs().get(0).getBuildName(), is("NixBuild"));
    assertThat(failingTests7.get(0).getJobs().get(0).buildLocator(), is("foo-pipeline/3/bar-stage/1/NixBuild"));
    assertThat(failingTests7.get(0).getJobs().get(1).buildLocator(), is("foo-pipeline/3/bar-stage/1/WinBuild"));
    List<TestInformation> failingTests6 = failingPipeline6.failingSuites().get(0).tests();
    assertThat(failingTests6.size(), is(2));
    assertThat(failingTests6.get(0).getJobs().size(), is(1));
    assertThat(failingTests6.get(0).getJobs().get(0).getBuildName(), is("WinBuild"));
    assertThat(failingTests6.get(0).getJobs().get(0).buildLocator(), is("foo-pipeline/2/bar-stage/1/WinBuild"));
    assertThat(failingTests6.get(1).getJobs().size(), is(1));
    assertThat(failingTests6.get(1).getJobs().get(0).getBuildName(), is("WinBuild"));
    assertThat(failingTests6.get(1).getJobs().get(0).buildLocator(), is("foo-pipeline/2/bar-stage/1/WinBuild"));
}
Also used : TestInformation(com.thoughtworks.go.domain.testinfo.TestInformation) StageTestRuns(com.thoughtworks.go.domain.testinfo.StageTestRuns) FailingTestsInPipeline(com.thoughtworks.go.domain.testinfo.FailingTestsInPipeline) Test(org.junit.Test)

Example 2 with TestInformation

use of com.thoughtworks.go.domain.testinfo.TestInformation in project gocd by gocd.

the class ShineDaoIntegrationTest method shouldBeAbleToRetriveStageTestRunsWithLazyGraphLoader.

@Test
public void shouldBeAbleToRetriveStageTestRunsWithLazyGraphLoader() throws Exception {
    StageTestRuns stageTestRuns = shineDao.failedBuildHistoryForStage(stageId, result);
    List<FailingTestsInPipeline> failingTestsInPipelines = stageTestRuns.failingTestsInPipelines();
    assertThat(failingTestsInPipelines.toString(), failingTestsInPipelines.size(), is(1));
    List<TestSuite> suites = failingTestsInPipelines.get(0).failingSuites();
    assertThat(suites.size(), is(1));
    assertThat(suites.get(0).fullName(), is("testSuite1"));
    List<TestInformation> tests = suites.get(0).tests();
    assertThat(tests.size(), is(2));
    assertThat(tests.get(0).getName(), is("test1"));
    assertThat(tests.get(0).getStatus(), is(TestStatus.Failure));
    assertThat(tests.get(0).getJobNames(), hasItems("NixBuild", "WinBuild"));
    assertThat(tests.get(1).getName(), is("test2"));
    assertThat(tests.get(1).getStatus(), is(TestStatus.Error));
    assertThat(tests.get(1).getJobNames(), hasItems("WinBuild"));
}
Also used : TestInformation(com.thoughtworks.go.domain.testinfo.TestInformation) TestSuite(com.thoughtworks.go.domain.testinfo.TestSuite) StageTestRuns(com.thoughtworks.go.domain.testinfo.StageTestRuns) FailingTestsInPipeline(com.thoughtworks.go.domain.testinfo.FailingTestsInPipeline) Test(org.junit.Test)

Aggregations

FailingTestsInPipeline (com.thoughtworks.go.domain.testinfo.FailingTestsInPipeline)2 StageTestRuns (com.thoughtworks.go.domain.testinfo.StageTestRuns)2 TestInformation (com.thoughtworks.go.domain.testinfo.TestInformation)2 Test (org.junit.Test)2 TestSuite (com.thoughtworks.go.domain.testinfo.TestSuite)1