Interface STestManager

  • All Superinterfaces:
    TestMetadataProvider
    All Known Implementing Classes:
    TestManagerImpl

    public interface STestManager
    extends TestMetadataProvider
    The data-access object for tests (right now acts merely as a factory).

    Can become a part of open API some day, though right now there is no critical need for it.

    Note on performance: all create methods are simple factory methods that just instantiate new objects, with few additions:

    • the method may need to look up the test name by id. This data is cached most of the time, but may perform extra DB operation occasionally. In other words one particular method call can be slow.
    • if the method needs to populate external test information (e.g. test mute info), the retrieval may perform extra DB operation. In this case each method call would be slow, thus method is not designed to be called in a loop.
    Since:
    6.5
    Author:
    Sergey Anchipolevsky, Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
    • Method Detail

      • createTest

        @NotNull
        STest createTest​(@NotNull
                         TestName testName,
                         long testNameId,
                         @NotNull
                         String projectId)
        Creates an instance of STest with given test name, testNameId and project id.
        Parameters:
        testName - test name.
        testNameId - test name ID, must be consistent with testName
        projectId - project identifier.
        Returns:
        corresponding test.
        Since:
        2019.1
      • findTest

        @Nullable
        STest findTest​(long testNameId,
                       @NotNull
                       String projectId)
        Looks for a test with given identifier, return null if a test name with this ID does not exist
        Parameters:
        testNameId - identifier of test name.
        projectId - project identifier.
        Returns:
        corresponding test; or null if not found.
        Since:
        6.5
        See Also:
        createTest(jetbrains.buildServer.tests.TestName, String)
      • createTest

        @NotNull
        @Deprecated
        STest createTest​(long testNameId,
                         @NotNull
                         String projectId)
        Deprecated.
        Given test id and project id, creates and returns the STest instance. If there is no test name corresponding to specified test id, an empty string is used.
        Parameters:
        testNameId - test name id
        projectId - project id
        Returns:
        corresponding test instance
        See Also:
        createTest(TestName, long, String)
      • createTests

        @NotNull
        Map<Long,​STest> createTests​(@NotNull
                                          Set<Long> testNameIds,
                                          @NotNull
                                          String projectId)
        Creates tests for a set of test name ids in a given project.
        Parameters:
        testNameIds - set of test name ids
        projectId - project id
        Returns:
        map of test name id to STest object
      • createTestRun

        STestRun createTestRun​(int orderId,
                               int testRunId,
                               int duration,
                               @NotNull
                               STest test,
                               @NotNull
                               Status status)
      • createTestRun

        @NotNull
        TestRunEx createTestRun​(@Nullable
                                SBuild build,
                                @NotNull
                                STest test,
                                @NotNull
                                Status testStatus,
                                @Nullable
                                BuildsManager buildManager)

        Creates a new test run instance. The instance created will have testRunId of 0, meaning HTML hyperlinks (to the build progress log) constructed from this instance (e. g., using <tt:testNameWithPopup/>), when followed, will result in the 1st line of the build progress log focused. If buildManager is non- null, the test run instance is lightweight.

        Parameters:
        build - the build this test run will belong to.
        test - the test which ran as a part of build.
        testStatus - the status of the test run.
        buildManager - build manager used to look up builds; if non- null, the returned instance is lightweight.
        Returns:
        the newly created test run instance.
        Since:
        10.0
        See Also:
        createTestRun(int, int, int, STest, Status)