Class BuildStatisticsImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.stat.BuildStatisticsImpl
-
- All Implemented Interfaces:
BuildStatistics
,ShortStatistics
,ShortStatisticsEx
public class BuildStatisticsImpl extends Object implements BuildStatistics, ShortStatisticsEx
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.BuildStatistics
BuildStatistics.Order
-
-
Field Summary
Fields Modifier and Type Field Description static String
BUILD_STATISTICS_CACHE_ENABLED
static String
BUILD_STATISTICS_CACHE_EXPIRATION_TIME
static String
BUILD_STATISTICS_CACHE_MAX_TEST_RUNS
static String
BUILD_STATISTICS_CACHE_STORAGE_ID
-
Method Summary
-
-
-
Field Detail
-
BUILD_STATISTICS_CACHE_ENABLED
public static final String BUILD_STATISTICS_CACHE_ENABLED
- See Also:
- Constant Field Values
-
BUILD_STATISTICS_CACHE_EXPIRATION_TIME
public static final String BUILD_STATISTICS_CACHE_EXPIRATION_TIME
- See Also:
- Constant Field Values
-
BUILD_STATISTICS_CACHE_MAX_TEST_RUNS
public static final String BUILD_STATISTICS_CACHE_MAX_TEST_RUNS
- See Also:
- Constant Field Values
-
BUILD_STATISTICS_CACHE_STORAGE_ID
public static final String BUILD_STATISTICS_CACHE_STORAGE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
isTestHistorySkipped
public boolean isTestHistorySkipped()
- Specified by:
isTestHistorySkipped
in interfaceShortStatisticsEx
-
getSignature
public int getSignature()
- Specified by:
getSignature
in interfaceShortStatistics
- Returns:
- a signature of the build. We consider two builds fail the same way if they have the same signature.
-
getPassedTestCount
public int getPassedTestCount()
- Specified by:
getPassedTestCount
in interfaceShortStatistics
- Returns:
- number of passed(successful) tests in the build.
-
getBuildStatus
public Status getBuildStatus()
- Specified by:
getBuildStatus
in interfaceShortStatistics
- Returns:
- build status
-
getPreviousFailedTestsCount
public int getPreviousFailedTestsCount()
- Specified by:
getPreviousFailedTestsCount
in interfaceBuildStatistics
- Returns:
- number of tests which fail in this build and in the previous build as well
-
getAllTestCount
public int getAllTestCount()
- Specified by:
getAllTestCount
in interfaceShortStatistics
- Returns:
- total number of tests, including ignored, passed, and failed
-
getTotalDuration
public long getTotalDuration()
- Specified by:
getTotalDuration
in interfaceShortStatistics
- Returns:
- total duration of test execution, i.e. sum of all test durations (msecs). Depending on test runner, may either include or exclude time for test setup/teardown times
-
getTests
public List<STestRun> getTests(@Nullable Status status, @NotNull BuildStatistics.Order order)
- Specified by:
getTests
in interfaceBuildStatistics
- Parameters:
status
- if specified, this is the status of tests to be returned. Supported values areNORMAL
,FAILURE
,UNKNOWN
.- Passing
Status.UNKNOWN
yields a list of ignored tests. - Passing
Status.NORMAL
yields a list of passed tests. - Passing
Status.WARNING
yields an empty list - Passing
Status.FAILURE
orStatus.ERROR
yields a list of failed tests (excl. muted ones). - Passing
null
yields all tests.
- Passing
order
- specifies result order- Returns:
- Non-modifiable list of tests according to the parameters query (passed and ignored tests are returned only if statistics were created with corresponding BuildStatisticsOptions)
-
getAllTests
public List<STestRun> getAllTests()
- Specified by:
getAllTests
in interfaceBuildStatistics
- Returns:
- all build tests in natural order (passed and ignored tests are returned only if statistics were created with corresponding BuildStatisticsOptions)
-
findTestsBy
public List<STestRun> findTestsBy(TestName testName)
- Specified by:
findTestsBy
in interfaceBuildStatistics
- Returns:
- collection of test runs by a testName (test with the same name can run several times in the build)
-
findTestByTestNameId
@Nullable public STestRun findTestByTestNameId(long testNameId)
- Specified by:
findTestByTestNameId
in interfaceBuildStatistics
- Returns:
- Composite STestRun based on given testNameId
- See Also:
STest.getTestNameId()
-
findTestByTestRunId
@Nullable public STestRun findTestByTestRunId(long testRunId)
Description copied from interface:BuildStatistics
Allows to find a specific STestRun by given testRunId.- Specified by:
findTestByTestRunId
in interfaceBuildStatistics
- Parameters:
testRunId
- test run id- Returns:
- Test run according to given testRunId
- See Also:
STestRun.getTestRunId()
-
getAllTestRunCount
public int getAllTestRunCount()
- Specified by:
getAllTestRunCount
in interfaceBuildStatistics
- Returns:
- Total number of test runs in the build. If a test was run several times withing the build, all its runs will be considered.
-
getIgnoredTests
public List<STestRun> getIgnoredTests()
- Specified by:
getIgnoredTests
in interfaceBuildStatistics
- Returns:
- Collection of ignored tests in the build in natural order.
-
getPassedTests
public List<STestRun> getPassedTests()
- Specified by:
getPassedTests
in interfaceBuildStatistics
- Returns:
- Collection of successful tests in the build in natural order.
-
getCompilationErrorBlocks
public List<CompilationBlockBean> getCompilationErrorBlocks()
- Specified by:
getCompilationErrorBlocks
in interfaceBuildStatistics
- Returns:
- messages with compilation error text.
-
getCompilationErrors
@NotNull public List<CompilationBlockBean> getCompilationErrors(@NotNull BuildProblem buildProblem)
-
getIgnoredTestCount
public int getIgnoredTestCount()
- Specified by:
getIgnoredTestCount
in interfaceShortStatistics
- Returns:
- number of ignored tests in the build.
-
isEmpty1
public boolean isEmpty1()
Description copied from interface:ShortStatistics
This method has so strange name because "empty" is predefined keyword in JSP EL.- Specified by:
isEmpty1
in interfaceShortStatistics
- Returns:
- true if build doesn't have any tests and has no compilation errors
-
getCompilationErrorsCount
public int getCompilationErrorsCount()
- Specified by:
getCompilationErrorsCount
in interfaceShortStatistics
- Returns:
- number of detected compilation errors within compilation blocks.
-
getCurrentStage
public final String getCurrentStage()
- Specified by:
getCurrentStage
in interfaceShortStatistics
- Returns:
- current progress text of the build. Progress text can be set either via specific syntax of the echo task
or using specific message from build runner with block type
DefaultMessagesInfo.BLOCK_TYPE_PROGRESS
. Progress blocks can be nested.
-
getFailedTests
public List<STestRun> getFailedTests()
- Specified by:
getFailedTests
in interfaceShortStatistics
- Returns:
- Collection of failed tests in the build, ordered by isNew, orderNumber (excluding muted runs)
-
getFailedTestsIncludingMuted
@NotNull public List<STestRun> getFailedTestsIncludingMuted()
- Specified by:
getFailedTestsIncludingMuted
in interfaceShortStatistics
- Returns:
- Collection of failed tests in the build, ordered by isNew, orderNumber (including muted runs)
-
getMutedTests
@NotNull public List<STestRun> getMutedTests()
- Specified by:
getMutedTests
in interfaceShortStatistics
- Returns:
- collection of muted tests in the build
-
getFailedTestCount
public int getFailedTestCount()
- Specified by:
getFailedTestCount
in interfaceShortStatistics
- Returns:
- number of failed or error tests in the build
-
getMutedTestsCount
public int getMutedTestsCount()
- Specified by:
getMutedTestsCount
in interfaceShortStatistics
- Returns:
- number of muted tests
-
getNewFailedCount
public int getNewFailedCount()
- Specified by:
getNewFailedCount
in interfaceShortStatistics
- Returns:
- number of newly failed tests in the build, i.e. number of tests which fail in this build the first time comparing with recent builds.
-
isTestHistoryCalculated
@TestOnly public boolean isTestHistoryCalculated()
-
-