Interface TestHistory

  • All Known Implementing Classes:
    TestHistoryImpl

    public interface TestHistory
    Since:
    2020.2
    Author:
    kir
    • Method Detail

      • hasBuildsWithTests

        boolean hasBuildsWithTests​(@NotNull
                                   BuildType buildType)
        Returns the number of builds of the given Build Type that have at leat one test run.
        Parameters:
        buildType - Build Type
        Returns:
        true if build configuration has builds with tests.
      • getLastBuildsForTestsDefaultBranch

        @NotNull
        Collection<SBuild> getLastBuildsForTestsDefaultBranch​(@NotNull
                                                              Collection<Long> testNameIds,
                                                              @Nullable
                                                              SProject project)
        Returns the last finished builds in the project that have any of the tests specified either passed or failed (ignored tests are not considered).
        Parameters:
        testNameIds - the ids of the tests
        project - the project to search in, `null` project means all active build types under `root` project on buildserver
        Returns:
        required builds
      • getLastBuildsForTestsActiveBranches

        @NotNull
        Collection<SBuild> getLastBuildsForTestsActiveBranches​(@NotNull
                                                               Collection<Long> testNameIds,
                                                               @Nullable
                                                               SProject project)
        Same as TestsHistory#getLastBuildsForTestsDefaultBranch for all active branches. One build for every pair of build configuration and branch name.
      • getBuildTypesForTests

        @NotNull
        Collection<SBuildType> getBuildTypesForTests​(@NotNull
                                                     Collection<Long> testNameIds,
                                                     @Nullable
                                                     SProject project)
        Returns the collection of build types, in which the tests that correspond to testNameIds were executed (the union, not intersection). If the project is specified, the result is filtered by it.

        Currently running builds are not considered.

        Parameters:
        testNameIds - the tests collection
        project - the project (nullable)
        Returns:
        collection of build types
        Since:
        7.1
      • getBuildTypesForTests

        @NotNull
        Collection<SBuildType> getBuildTypesForTests​(@NotNull
                                                     Collection<STest> tests)
        Returns the collection of build types, in which the tests were executed (the union, not intersection). If all tests are from one project, the result is filtered by it.

        Currently running builds are not considered.

        Parameters:
        tests - the tests collection
        Returns:
        collection of build types
        Since:
        7.1
      • getBuildTypesForTests

        @NotNull
        Collection<SBuildType> getBuildTypesForTests​(@Nullable
                                                     SProject project,
                                                     @NotNull
                                                     Collection<TestName> testNames)
        Returns the collection of build types, in which the tests that correspond to testNames were executed (the union, not intersection). If the project is specified, the result is filtered by it.

        Currently running builds are not considered.

        Parameters:
        project - the project (nullable)
        testNames - the tests collection
        Returns:
        collection of build types
        Since:
        7.1
      • getTestStatuses

        Long2StatusCollection getTestStatuses​(@NotNull
                                              Collection<Long> testNameIds,
                                              long buildId,
                                              boolean cacheResults)
        Return a Long2StatusCollection which contains statuses of test runs for build from testNameIds collection
        Parameters:
        buildId - build to analyze
        testNameIds - collection of tests
        cacheResults - should be false if build is running
        Returns:
        see above
      • getTestHistory

        @NotNull
        List<STestRun> getTestHistory​(long testNameId,
                                      @NotNull
                                      String buildTypeId,
                                      long userId,
                                      @Nullable
                                      String branchName)
        Order of the returned TestRuns is recent runs first, according to the starting order of the builds. Multiple test runs in the build are NOT wrapped into MultiRun class, i.e. each test run is returned independently
        Parameters:
        testNameId -
        buildTypeId - required to set the build configuration for the test history
        userId - if > 0, includes personal builds of the given user
        branchName - if not null, returns only builds which match given branchName
        Returns:
        Test run objects for given test, recent builds go first
      • getTestHistory

        @NotNull
        List<STestRun> getTestHistory​(long testNameId,
                                      @NotNull
                                      SProject project,
                                      long userId,
                                      @Nullable
                                      String branchName)
        Order of the returned TestRuns is recent runs first, according to the starting order of the builds. Multiple test runs in the build are NOT wrapped into MultiRun class, i.e. each test run is returned independently
        Parameters:
        testNameId -
        project - required to set the parent project, all returned test runs will belong to build configurations under this project and its subprojects
        userId - if > 0, includes personal builds of the given user
        branchName - if not null, returns only builds which match given branchName
        Returns:
        Test run objects for given test, recent builds go first
      • getTestHistory

        @NotNull
        List<STestRun> getTestHistory​(long testNameId,
                                      @NotNull
                                      String buildTypeId,
                                      Filter<STestRun> filter)
        Order of the returned TestRuns is recent runs first, according to the starting order of the builds. Multiple test runs in the build are NOT wrapped into MultiRun class, i.e. each test run is returned independently
        Parameters:
        testNameId -
        buildTypeId - required to set the build configuration for the test history
        filter - additional filter for the returned test runs
        Returns:
        Test run objects for given test, recent builds go first
      • getTestHistory

        @NotNull
        List<STestRun> getTestHistory​(long testNameId,
                                      @NotNull
                                      SProject project,
                                      Filter<STestRun> filter)
        Order of the returned TestRuns is recent runs first, according to the starting order of the builds. Multiple test runs in the build are NOT wrapped into MultiRun class, i.e. each test run is returned independently
        Parameters:
        testNameId -
        project - required to set the parent project, all returned test runs will belong to build configurations under this project and its subprojects
        filter - additional filter for the returned test runs
        Returns:
        Test run objects for given test, recent builds go first
      • getBuild2StatusMapForTest

        Long2StatusCollection getBuild2StatusMapForTest​(long testNameId,
                                                        @NotNull
                                                        Set<String> buildTypeIds,
                                                        long minBuildId)
        Loads test statuses across all builds in the given build configurations.

        Return a map structure: buildId -> Status for test statuses of a test with given testNameId, in no particular order

        Parameters:
        testNameId -
        buildTypeIds -
        minBuildId - Minimal value of buildId for which the data will be obtained (inclusive)
        Returns:
        see above
      • getRelevantBuildTypes

        @NotNull
        Collection<SBuildType> getRelevantBuildTypes​(@NotNull
                                                     SBuild build)
        Return build types which should be treated equally when calculating "isNew" and "isFixedIn" status for a test.
        Parameters:
        build - build for which the scope should be calculated. This build may belong to any of the configurations from the scope, or maybe some parent configuration.
        Returns:
        see above
        Since:
        2022.10
        See Also:
        BuildTypesTestScope