Interface STestRun


  • public interface STestRun
    Represents a single test run (execution) in a particular build.
    Since:
    6.5
    Author:
    Sergey Anchipolevsky, Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
    • Field Detail

      • NEW_FIRST_NAME_COMPARATOR

        static final java.util.Comparator<STestRun> NEW_FIRST_NAME_COMPARATOR
    • Method Detail

      • getTest

        @NotNull
        STest getTest()
        Returns corresponding test instance.

        Note: the instance might or might not be shared between different test runs of one test.

        Returns:
        corresponding test instance
      • getBuild

        @NotNull
        SBuild getBuild()
        Returns corresponding build instance.

        Note: each test run has an associated build, but depending on how this test run instance was created build might not be populated. In this case a UnsupportedOperationException is thrown.

        Returns:
        corresponding build instance
      • getBuildId

        long getBuildId()
        Returns:
        id of the build where this test run has occurred
        Since:
        9.1
      • getOrderId

        int getOrderId()
        Returns ordinal number of this test in the build statistics collection. This number can be different depending on what tests were loaded into the build statistics instance.
        Returns:
        ordinal number of this test in the build statistics collection
      • getTestRunId

        int getTestRunId()
        Returns the unique test run id within the build
        Returns:
        test run id
      • getInvocationCount

        int getInvocationCount()
        Return number of times test with this name was run within the build. If this STestRun was obtained as a part of ShortStatistics, only failed test runs are included.
        Returns:
        see above
        Since:
        9.0
      • getFailedInvocationCount

        int getFailedInvocationCount()
        Return number of times test with this name was failed within the build (<= getInvocationCount() For STestRuns obtained from ShortStatistics, returns the same value as getInvocationCount()
        Returns:
        see above
        Since:
        9.0
        See Also:
        getInvocationCount()
      • getDuration

        int getDuration()
        Returns test duration.
        Returns:
        test duration in milliseconds
      • getStatus

        @NotNull
        Status getStatus()
        Returns test status. Currently the test status could be one of: Status.NORMAL Status.FAILURE (better check isFailed() on status object) Status.UNKNOWN - for ignored tests
        Returns:
        test status
      • getStatusText

        @NotNull
        java.lang.String getStatusText()
        Return human-readable test status, not an object
        Returns:
        human-readable test status
        Since:
        8.0
      • getFailureInfo

        @Deprecated
        @Nullable
        default TestFailureInfo getFailureInfo()
        Deprecated.
        in 9.0, use getFullText() instead
        Returns:
        as of 9.0, always returns null
      • getFirstFailed

        @Nullable
        SBuild getFirstFailed()
        Returns the first build in a failing sequence containing this test run
        Returns:
        first failed in build
      • setFirstFailedIn

        void setFirstFailedIn​(@Nullable
                              SBuild firstFailedIn)
        Sets the build where this TestRun is considered first failed in
        Parameters:
        firstFailedIn - the first failed in build
        Since:
        9.0
        See Also:
        getFirstFailed()
      • getFixedIn

        @Nullable
        SBuild getFixedIn()
        Returns the first build in which test is fixed after a failing sequence containing this test run
        Returns:
        fixed in build
      • setFixedIn

        @Deprecated
        void setFixedIn​(@Nullable
                        SBuild fixedIn)
        Deprecated.
        since 2019.2, should not be used by the client code
        Sets the build where this test is considered to be fixed
        Parameters:
        fixedIn - the fixed in build
        Since:
        9.0
        See Also:
        getFixedIn()
      • isFixed

        boolean isFixed()
        Returns true if this test was fixed after this failure. Returns false for a successful test.
        Returns:
        true if this test was fixed
        Throws:
        java.lang.UnsupportedOperationException - if the statistics object was created without option BuildStatisticsOptions.FIXED_IN_BUILD
      • isNewFailure

        boolean isNewFailure()
        Returns whether this test is failed and it was not failed in previous builds
        Returns:
        true if this test is failed and it was not failed in previous builds
      • isMuted

        boolean isMuted()
        Returns whether this test run is marked as muted (this is applicable for failed tests only).
        Returns:
        whether this test run is marked as muted.
        See Also:
        getMuteInfo()
      • isIgnored

        boolean isIgnored()
        Checks whether the test was ignored during the build run
        Returns:
        true if the test was ignored during the build run
        Since:
        8.0
      • getMuteInfo

        @Nullable
        MuteInfo getMuteInfo()
        Returns the brief mute information for this test run.
        Returns:
        mute information if exists.
        See Also:
        isMuted()
      • getFullText

        @Nullable
        java.lang.String getFullText()
        Returns complete test output, including stdout, stderr and exceptions
        Returns:
        complete test output, including stdout, stderr and exceptions
      • getIgnoreComment

        @Nullable
        java.lang.String getIgnoreComment()
        Returns ignore comment, if available
        Returns:
        ignore comment, if available