Class FlakyTestResult
java.lang.Object
hudson.model.AbstractModelObject
hudson.tasks.junit.TestObject
hudson.tasks.test.TestObject
hudson.tasks.test.TestResult
hudson.tasks.test.TabulatedResult
hudson.tasks.test.MetaTabulatedResult
com.google.jenkins.flakyTestHandler.junit.FlakyTestResult
- All Implemented Interfaces:
ModelObject
,SearchableModelObject
,SearchItem
,Serializable
public final class FlakyTestResult
extends hudson.tasks.test.MetaTabulatedResult
Root of all the test results for one build, including flaky runs information.
Majority of code copied from hudson.tasks.junit.TestResult
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/junit/
TestResult.java
- Author:
- Qingzhou Luo
- See Also:
-
Field Summary
Fields inherited from class hudson.tasks.test.TabulatedResult
testsByBlock
-
Constructor Summary
ConstructorDescriptionFlakyTestResult
(hudson.tasks.junit.TestResult testResult) ConstructFlakyTestResult()
fromTestResult
-
Method Summary
Modifier and TypeMethodDescriptionhudson.tasks.test.TestResult
void
Builds up the transient part of the data structure from resultsparsed
so far.float
getDynamic
(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) If there was an error or a failure, this is the text from the message.If there was an error or a failure, this is the stack trace, or otherwise null.int
getName()
hudson.tasks.test.TestObject
hudson.tasks.test.AbstractTestResultAction
int
Collection<? extends hudson.tasks.test.TestResult>
Gets the "children" of this test result that passedRun<?,
?> getRun()
int
Get the map between test name and aHistoryAggregatedFlakyTestResultAction.SingleTestFlakyStatsWithRevision
, which counts all its passing runs and failing runs.getTitle()
int
boolean
Whether this test result has children.boolean
isEmpty()
boolean
isPassed()
void
Collect reports from the given report files, while filtering out all files that were created before the given time.void
Collect reports from the given report filesvoid
parse
(long buildTime, org.apache.tools.ant.DirectoryScanner results) Collect reports from the givenDirectoryScanner
, while filtering out all files that were created before the given time.void
Parses an additional report file.void
setParent
(hudson.tasks.test.TestObject parent) void
setParentAction
(hudson.tasks.test.AbstractTestResultAction action) void
tally()
Recount my children.Methods inherited from class hudson.tasks.test.TabulatedResult
blockToTestResult, getChildType, getPipelineBlockWithTests, hasMultipleBlocks, populateBlocks
Methods inherited from class hudson.tasks.test.TestResult
annotate, getBuildResult, getFailedSince, getFailedSinceRun, getPreviousResult, getProperties, getResultInRun, getSkippedTests, toPrettyString
Methods inherited from class hudson.tasks.test.TestObject
doSubmitDescription, getApi, getDescription, getDurationString, getFullDisplayName, getFullName, getHistory, getId, getRelativePathFrom, getResultInBuild, getSafeName, getSearchUrl, getTestAction, getTestActions, getTestResult, getTestResultAction, getTopLevelTestResult, getUrl, safe, setDescription, uniquifyName
Methods inherited from class hudson.tasks.junit.TestObject
getOwner
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Constructor Details
-
FlakyTestResult
public FlakyTestResult(hudson.tasks.junit.TestResult testResult) ConstructFlakyTestResult()
fromTestResult
- Parameters:
testResult
- result of tests
-
FlakyTestResult
public FlakyTestResult()
-
-
Method Details
-
getParent
public hudson.tasks.test.TestObject getParent()- Specified by:
getParent
in classhudson.tasks.test.TestObject
-
setParent
public void setParent(hudson.tasks.test.TestObject parent) - Overrides:
setParent
in classhudson.tasks.test.TestResult
-
parse
Collect reports from the givenDirectoryScanner
, while filtering out all files that were created before the given time.- Parameters:
buildTime
- time of buildresults
- directory scanner for result files- Throws:
IOException
- throws exception when opening result files fails
-
parse
Collect reports from the given report files, while filtering out all files that were created before the given time.- Parameters:
buildTime
- time of buildbaseDir
- base directoryreportFiles
- report file names- Throws:
IOException
- throws exception when opening result files fails- Since:
- 1.426
-
parse
Collect reports from the given report files- Parameters:
buildTime
- time of buildreportFiles
- list of report files- Throws:
IOException
- throws exception when opening result files fails- Since:
- 1.500
-
parse
Parses an additional report file.- Parameters:
reportFile
- additional report file- Throws:
IOException
- throws exception when opening report file fails
-
getDisplayName
-
getRun
- Overrides:
getRun
in classhudson.tasks.junit.TestObject
-
findCorrespondingResult
- Specified by:
findCorrespondingResult
in classhudson.tasks.test.TestObject
-
getTitle
- Overrides:
getTitle
in classhudson.tasks.test.TestResult
-
getChildTitle
- Overrides:
getChildTitle
in classhudson.tasks.test.TabulatedResult
-
getDuration
@Exported(visibility=999) public float getDuration()- Overrides:
getDuration
in classhudson.tasks.test.TestResult
-
getPassCount
@Exported(visibility=999) public int getPassCount()- Overrides:
getPassCount
in classhudson.tasks.test.TestResult
-
getFailCount
@Exported(visibility=999) public int getFailCount()- Overrides:
getFailCount
in classhudson.tasks.test.TestResult
-
getTotalCount
public int getTotalCount()- Overrides:
getTotalCount
in classhudson.tasks.test.TestObject
-
getSkipCount
@Exported(visibility=999) public int getSkipCount()- Overrides:
getSkipCount
in classhudson.tasks.test.TestResult
-
isEmpty
@Exported(visibility=999) public boolean isEmpty() -
getFailedTests
- Specified by:
getFailedTests
in classhudson.tasks.test.MetaTabulatedResult
-
getFlakyTests
-
getAllTests
-
getPassedTests
Gets the "children" of this test result that passed- Overrides:
getPassedTests
in classhudson.tasks.test.TestResult
- Returns:
- the children of this test result, if any, or an empty collection
-
getStdout
- Overrides:
getStdout
in classhudson.tasks.test.TestResult
-
getStderr
- Overrides:
getStderr
in classhudson.tasks.test.TestResult
-
getErrorStackTrace
If there was an error or a failure, this is the stack trace, or otherwise null.- Overrides:
getErrorStackTrace
in classhudson.tasks.test.TestResult
-
getErrorDetails
If there was an error or a failure, this is the text from the message.- Overrides:
getErrorDetails
in classhudson.tasks.test.TestResult
-
isPassed
public boolean isPassed()- Overrides:
isPassed
in classhudson.tasks.test.TestResult
- Returns:
- true if the test was not skipped and did not fail, false otherwise.
-
getChildren
- Specified by:
getChildren
in classhudson.tasks.test.TabulatedResult
-
hasChildren
public boolean hasChildren()Whether this test result has children.- Specified by:
hasChildren
in classhudson.tasks.test.TabulatedResult
-
getSuites
-
getName
- Overrides:
getName
in classhudson.tasks.test.TestObject
-
getDynamic
public Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) - Overrides:
getDynamic
in classhudson.tasks.test.TestObject
-
byPackage
-
getSuite
-
setParentAction
public void setParentAction(hudson.tasks.test.AbstractTestResultAction action) - Overrides:
setParentAction
in classhudson.tasks.test.TestResult
-
getParentAction
public hudson.tasks.test.AbstractTestResultAction getParentAction()- Overrides:
getParentAction
in classhudson.tasks.test.TestResult
-
tally
public void tally()Recount my children.- Overrides:
tally
in classhudson.tasks.test.TestResult
-
freeze
Builds up the transient part of the data structure from resultsparsed
so far.After the data is frozen, more files can be parsed and then freeze can be called again.
-
getTestFlakyStatsMap
public Map<String,HistoryAggregatedFlakyTestResultAction.SingleTestFlakyStatsWithRevision> getTestFlakyStatsMap()Get the map between test name and aHistoryAggregatedFlakyTestResultAction.SingleTestFlakyStatsWithRevision
, which counts all its passing runs and failing runs. No flake will be included, because a flake will be decomposed into a passing run with several failing runs.- Returns:
- the map between test name and a
HistoryAggregatedFlakyTestResultAction.SingleTestFlakyStatsWithRevision
,
-