Class InvestigationTestRunsHolderImpl
- java.lang.Object
-
- jetbrains.buildServer.responsibility.impl.InvestigationTestRunsHolderImpl
-
- All Implemented Interfaces:
InvestigationTestRunsHolder
public class InvestigationTestRunsHolderImpl extends Object implements InvestigationTestRunsHolder
-
-
Field Summary
Fields Modifier and Type Field Description static String
TEAMCITY_INVESTIGATIONS_RESET_BUILD_TYPE_CACHE_DELAY
-
Constructor Summary
Constructors Constructor Description InvestigationTestRunsHolderImpl(BuildServerEx buildServer, ResponsibilityFacadeEx responsibilityFacade, ProblemMutingService problemMutingService, ProjectManagerEx projectManager, CurrentProblemsManagerEx currentProblemsManager, TestHistory testsHistory, ExecutorServices executors, TestName2Index testName2Index, TestRunContext testRunContext, ResetCacheRegister resetCacheRegister, ServerMetrics serverMetrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<SBuildType,List<STestRun>>
getFailingTestRunsFromRunningBuilds(Collection<SRunningBuild> runningBuilds)
Returns the list of last failing test runs from all running builds from all branches.Map<String,HashMap<String,STestRun>>
getLastFailedTestRuns(long testNameId, SProject project)
Returns last failed test runs for a specified test in specified collection.List<STestRun>
getLastTestRunsInBulk(Set<Long> testNameIds, String projectId, boolean onlyForDefaultBranch)
Returns all test runs for all specified tests and in the specified project.Map<Long,STestRun>
getWorstInvestigatedOrMutedTestRuns(SBuild build)
Returns map of worst test runs for each testNameId from build (for tests under investigation or mute).void
invokeInactiveBranchesCleanUpForTesting()
void
invokeLoadTestRunsToWatch()
boolean
isFixedInDefaultBranch(String buildTypeId, long testNameId)
Return true if there was a recent build in the default branch of the given build configuration, where test with given testNameId got fixed.boolean
isReady()
void
resetCachesForTesting()
void
resetFixedInDefaultCache()
void
setExecutor(ExecutorService executor)
-
-
-
Field Detail
-
TEAMCITY_INVESTIGATIONS_RESET_BUILD_TYPE_CACHE_DELAY
@NonNls public static final String TEAMCITY_INVESTIGATIONS_RESET_BUILD_TYPE_CACHE_DELAY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InvestigationTestRunsHolderImpl
public InvestigationTestRunsHolderImpl(@NotNull BuildServerEx buildServer, @NotNull ResponsibilityFacadeEx responsibilityFacade, @NotNull ProblemMutingService problemMutingService, @NotNull ProjectManagerEx projectManager, @NotNull CurrentProblemsManagerEx currentProblemsManager, @NotNull TestHistory testsHistory, @NotNull ExecutorServices executors, @NotNull TestName2Index testName2Index, @NotNull TestRunContext testRunContext, @NotNull ResetCacheRegister resetCacheRegister, @NotNull ServerMetrics serverMetrics)
-
-
Method Detail
-
isReady
public boolean isReady()
- Specified by:
isReady
in interfaceInvestigationTestRunsHolder
- Returns:
- true if the cache was already initialized
-
getLastFailedTestRuns
@NotNull public Map<String,HashMap<String,STestRun>> getLastFailedTestRuns(long testNameId, @NotNull SProject project)
Description copied from interface:InvestigationTestRunsHolder
Returns last failed test runs for a specified test in specified collection. I.e. the result list consists of last run in complete builds in default branch for each build type in a project and failed test runs in branchesCurrently the result of the method includes successful builds and exclude running build.
- Specified by:
getLastFailedTestRuns
in interfaceInvestigationTestRunsHolder
- Parameters:
testNameId
- the test idproject
- the top-most parent project for the returned test runs (project or some of its subprojects (not only direct))- Returns:
- the map (buildTYpeId -> map (branchName -> STestRun)), branchName == null is for default branches
-
getLastTestRunsInBulk
@NotNull public List<STestRun> getLastTestRunsInBulk(@NotNull Set<Long> testNameIds, @NotNull String projectId, boolean onlyForDefaultBranch)
Description copied from interface:InvestigationTestRunsHolder
Returns all test runs for all specified tests and in the specified project.- Specified by:
getLastTestRunsInBulk
in interfaceInvestigationTestRunsHolder
- Parameters:
testNameIds
- test name idsprojectId
- project id - parent project for returned TestRuns (project or some of its subprojects (not only direct))onlyForDefaultBranch
- whether we should collect test runs for default branch only or for all the branches. the flag is ignored when processing for branches is disabled.- Returns:
- the list of all recent test runs;
-
isFixedInDefaultBranch
public boolean isFixedInDefaultBranch(@NotNull String buildTypeId, long testNameId)
Description copied from interface:InvestigationTestRunsHolder
Return true if there was a recent build in the default branch of the given build configuration, where test with given testNameId got fixed. If the test fails again after the fix, the method returns false- Specified by:
isFixedInDefaultBranch
in interfaceInvestigationTestRunsHolder
- Returns:
- see above
-
getFailingTestRunsFromRunningBuilds
@NotNull public Map<SBuildType,List<STestRun>> getFailingTestRunsFromRunningBuilds(@NotNull Collection<SRunningBuild> runningBuilds)
Description copied from interface:InvestigationTestRunsHolder
Returns the list of last failing test runs from all running builds from all branches. Only tests currently muted or investigated are considered.- Specified by:
getFailingTestRunsFromRunningBuilds
in interfaceInvestigationTestRunsHolder
- Returns:
- list of last failing test runs, history information is not pre-loaded there
-
getWorstInvestigatedOrMutedTestRuns
@NotNull public Map<Long,STestRun> getWorstInvestigatedOrMutedTestRuns(@NotNull SBuild build)
Description copied from interface:InvestigationTestRunsHolder
Returns map of worst test runs for each testNameId from build (for tests under investigation or mute). For instance if there are successful test run and failed test run for same testNameId, the method will return failed one only.- Specified by:
getWorstInvestigatedOrMutedTestRuns
in interfaceInvestigationTestRunsHolder
- Returns:
- map testNameId to worst in the build STestRun
-
resetCachesForTesting
@TestOnly public void resetCachesForTesting() throws ExecutionException, InterruptedException
-
invokeInactiveBranchesCleanUpForTesting
@TestOnly public void invokeInactiveBranchesCleanUpForTesting()
-
invokeLoadTestRunsToWatch
@TestOnly public void invokeLoadTestRunsToWatch()
-
resetFixedInDefaultCache
@TestOnly public void resetFixedInDefaultCache()
-
setExecutor
public void setExecutor(@NotNull ExecutorService executor)
-
-