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
ConstructorsConstructorDescriptionFlakyTestResult(hudson.tasks.junit.TestResult testResult) ConstructFlakyTestResult()fromTestResult -
Method Summary
Modifier and TypeMethodDescriptionhudson.tasks.test.TestResultvoidBuilds up the transient part of the data structure from resultsparsedso far.floatgetDynamic(String token, org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 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.intgetName()hudson.tasks.test.TestObjecthudson.tasks.test.AbstractTestResultActionintCollection<? extends hudson.tasks.test.TestResult>Gets the "children" of this test result that passedRun<?,?> getRun()intGet the map between test name and aHistoryAggregatedFlakyTestResultAction.SingleTestFlakyStatsWithRevision, which counts all its passing runs and failing runs.getTitle()intbooleanWhether this test result has children.booleanisEmpty()booleanisPassed()voidCollect reports from the given report files, while filtering out all files that were created before the given time.voidCollect reports from the given report filesvoidparse(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.voidParses an additional report file.voidsetParent(hudson.tasks.test.TestObject parent) voidsetParentAction(hudson.tasks.test.AbstractTestResultAction action) voidtally()Recount my children.Methods inherited from class hudson.tasks.test.TabulatedResult
blockToTestResult, getChildType, getPipelineBlockWithTests, hasMultipleBlocks, populateBlocksMethods inherited from class hudson.tasks.test.TestResult
annotate, getBuildResult, getFailedSince, getFailedSinceRun, getPreviousResult, getProperties, getResultInRun, getSkippedTests, toPrettyStringMethods 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, uniquifyNameMethods inherited from class hudson.tasks.junit.TestObject
getOwnerMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, 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:
getParentin classhudson.tasks.test.TestObject
-
setParent
public void setParent(hudson.tasks.test.TestObject parent) - Overrides:
setParentin 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:
getRunin classhudson.tasks.junit.TestObject
-
findCorrespondingResult
- Specified by:
findCorrespondingResultin classhudson.tasks.test.TestObject
-
getTitle
- Overrides:
getTitlein classhudson.tasks.test.TestResult
-
getChildTitle
- Overrides:
getChildTitlein classhudson.tasks.test.TabulatedResult
-
getDuration
@Exported(visibility=999) public float getDuration()- Overrides:
getDurationin classhudson.tasks.test.TestResult
-
getPassCount
@Exported(visibility=999) public int getPassCount()- Overrides:
getPassCountin classhudson.tasks.test.TestResult
-
getFailCount
@Exported(visibility=999) public int getFailCount()- Overrides:
getFailCountin classhudson.tasks.test.TestResult
-
getTotalCount
public int getTotalCount()- Overrides:
getTotalCountin classhudson.tasks.test.TestObject
-
getSkipCount
@Exported(visibility=999) public int getSkipCount()- Overrides:
getSkipCountin classhudson.tasks.test.TestResult
-
isEmpty
@Exported(visibility=999) public boolean isEmpty() -
getFailedTests
- Specified by:
getFailedTestsin classhudson.tasks.test.MetaTabulatedResult
-
getFlakyTests
-
getAllTests
-
getPassedTests
Gets the "children" of this test result that passed- Overrides:
getPassedTestsin classhudson.tasks.test.TestResult- Returns:
- the children of this test result, if any, or an empty collection
-
getStdout
- Overrides:
getStdoutin classhudson.tasks.test.TestResult
-
getStderr
- Overrides:
getStderrin classhudson.tasks.test.TestResult
-
getErrorStackTrace
If there was an error or a failure, this is the stack trace, or otherwise null.- Overrides:
getErrorStackTracein classhudson.tasks.test.TestResult
-
getErrorDetails
If there was an error or a failure, this is the text from the message.- Overrides:
getErrorDetailsin classhudson.tasks.test.TestResult
-
isPassed
public boolean isPassed()- Overrides:
isPassedin classhudson.tasks.test.TestResult- Returns:
- true if the test was not skipped and did not fail, false otherwise.
-
getChildren
- Specified by:
getChildrenin classhudson.tasks.test.TabulatedResult
-
hasChildren
public boolean hasChildren()Whether this test result has children.- Specified by:
hasChildrenin classhudson.tasks.test.TabulatedResult
-
getSuites
-
getName
- Overrides:
getNamein classhudson.tasks.test.TestObject
-
getDynamic
public Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) - Overrides:
getDynamicin classhudson.tasks.test.TestObject
-
byPackage
-
getSuite
-
setParentAction
public void setParentAction(hudson.tasks.test.AbstractTestResultAction action) - Overrides:
setParentActionin classhudson.tasks.test.TestResult
-
getParentAction
public hudson.tasks.test.AbstractTestResultAction getParentAction()- Overrides:
getParentActionin classhudson.tasks.test.TestResult
-
tally
public void tally()Recount my children.- Overrides:
tallyin classhudson.tasks.test.TestResult
-
freeze
Builds up the transient part of the data structure from resultsparsedso 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,
-