Class FlakyTestDetectorFunctions


  • public final class FlakyTestDetectorFunctions
    extends Object

    Flaky Test Detector functions library.

    Since:
    10.0
    Author:
    Andrey Shcheglov <mailto:andrey.shcheglov@jetbrains.com>
    • Method Detail

      • isFlaky

        public static boolean isFlaky​(long testNameId)

        Returns true if the test specified by testNameId is flaky, false otherwise.

        If Flaky Test Detector plug-in is not installed, returns false.

        Parameters:
        testNameId - the unique name_id of the test.
        Returns:
        whether the test specified by testNameId is flaky.
      • isEnvironmentDependent

        public static boolean isEnvironmentDependent​(long testNameId)

        Returns true if the test specified by testNameId depends on environment, false otherwise.

        If Flaky Test Detector plug-in is not installed, returns false.

        Parameters:
        testNameId - the unique name_id of the test.
        Returns:
        whether the test specified by testNameId is flaky.
      • isFlaky

        public static boolean isFlaky​(long testNameId,
                                      @NotNull
                                      String buildTypeId)
        Parameters:
        testNameId - the unique id of the test
        buildTypeId - the unique internal id of build configuration
        Returns:
        true if the test specified by testNameId is flaky in specified build configuration otherwise false
      • isFlakyInProject

        public static boolean isFlakyInProject​(long testNameId,
                                               @Nullable
                                               String projectExternalId)
        Parameters:
        testNameId - the unique id of the test
        projectExternalId - external id of project
        Returns:
        true if specified test is flaky at least in one build configuration which belongs to current project
      • getFlakyReasonsStringified

        @Nullable
        public static String getFlakyReasonsStringified​(long testNameId,
                                                        @NotNull
                                                        CharSequence delimiter)

        Returns the flaky reasons (in a plain text format, separated with the delimiter) for a given test, or null if the test is not flaky.

        If Flaky Test Detector plug-in is not installed, returns null.

        Parameters:
        testNameId - the unique name_id of the test.
        delimiter - the delimiter that separates each flaky reason.
        Returns:
        the flaky reasons in a plain text format for a given test.
      • getEnvironmentDependentReasonsStringified

        @Nullable
        public static String getEnvironmentDependentReasonsStringified​(long testNameId,
                                                                       @NotNull
                                                                       CharSequence delimiter)

        Returns the environment depend reasons (in a plain text format, separated with the delimiter) for a given test, or null if the test doesn't depends on the environment.

        If Flaky Test Detector plug-in is not installed, returns null.

        Parameters:
        testNameId - the unique name_id of the test.
        delimiter - the delimiter that separates each flaky reason.
        Returns:
        the flaky reasons in a plain text format for a given test.
      • getEnvironmentDependentReasons

        @NotNull
        public static String[] getEnvironmentDependentReasons​(long testNameId)

        Returns the environment depend reasons for a given test, or a zero-length array if the test doesn't depend on environment.

        If Flaky Test Detector plug-in is not installed, returns a zero-length array.

        Parameters:
        testNameId - the unique name_id of the test.
        Returns:
        the flaky reasons for a given test.
      • getFlakyReasons

        @NotNull
        public static String[] getFlakyReasons​(long testNameId,
                                               @NotNull
                                               String buildTypeId)

        Returns the flaky reasons for a given test, or a zero-length array if the test is not flaky.

        If Flaky Test Detector plug-in is not installed, returns a zero-length array.

        Parameters:
        testNameId - the unique name_id of the test.
        buildTypeId - the unique internal id of build configuration
        Returns:
        the flaky reasons for a given test.
      • getFlakyReasons

        @NotNull
        public static String[] getFlakyReasons​(long testNameId)

        Returns the flaky reasons for a given test, or a zero-length array if the test is not flaky.

        If Flaky Test Detector plug-in is not installed, returns a zero-length array.

        Parameters:
        testNameId - the unique name_id of the test.
        Returns:
        the flaky reasons for a given test.