public final class TestResult extends MetaTabulatedResult
testsByBlock
Constructor and Description |
---|
TestResult()
Creates an empty result.
|
TestResult(boolean keepLongStdio) |
TestResult(long buildTime,
org.apache.tools.ant.DirectoryScanner results)
Deprecated.
|
TestResult(long buildTime,
org.apache.tools.ant.DirectoryScanner results,
boolean keepLongStdio)
Deprecated.
|
TestResult(long buildTime,
org.apache.tools.ant.DirectoryScanner results,
boolean keepLongStdio,
PipelineTestDetails pipelineTestDetails)
Collect reports from the given
DirectoryScanner , while
filtering out all files that were created before the given time. |
TestResult(TestResultImpl impl) |
Modifier and Type | Method and Description |
---|---|
TabulatedResult |
blockToTestResult(PipelineBlockWithTests block,
TabulatedResult fullResult)
Get an aggregated
TestResult for all test results in a PipelineBlockWithTests and any children it may have. |
PackageResult |
byPackage(String packageName) |
TestResult |
findCorrespondingResult(String id)
Find the test result corresponding to the one identified by
id
within this test result. |
void |
freeze(TestResultAction parent)
Builds up the transient part of the data structure
from results
parsed so far. |
Collection<PackageResult> |
getChildren()
Gets the child test result objects.
|
String |
getChildTitle() |
String |
getDisplayName() |
float |
getDuration()
Time it took to run this test.
|
Object |
getDynamic(String token,
org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp) |
String |
getErrorDetails()
If there was an error or a failure, this is the text from the message.
|
String |
getErrorStackTrace()
If there was an error or a failure, this is the stack trace, or otherwise null.
|
int |
getFailCount()
Gets the total number of failed tests.
|
int |
getFailedSince()
If this test failed, then return the build number
when this test started failing.
|
Run<?,?> |
getFailedSinceRun()
If this test failed, then return the run
when this test started failing.
|
List<CaseResult> |
getFailedTests()
All failed tests.
|
String |
getName()
Gets the name of this object.
|
TestObject |
getParent()
Reverse pointer of
TabulatedResult.getChildren() . |
AbstractTestResultAction |
getParentAction()
Returns the action that points to the top level test result includes
this test result.
|
int |
getPassCount()
Gets the total number of passed tests.
|
List<CaseResult> |
getPassedTests()
Gets the "children" of this test result that passed
|
TestResultImpl |
getPluggableStorage() |
TestResult |
getPreviousResult()
Gets the counter part of this
TestResult in the previous run. |
TestResult |
getResultByNode(String nodeId) |
TestResult |
getResultByNodes(List<String> nodeIds) |
TestResult |
getResultForPipelineBlock(String blockId) |
Run<?,?> |
getRun() |
int |
getSkipCount()
Gets the total number of skipped tests.
|
List<CaseResult> |
getSkippedTests()
Gets the "children" of this test result that were skipped
|
String |
getStderr()
The stderr of this test.
|
String |
getStdout()
The stdout of this test.
|
SuiteResult |
getSuite(String name) |
Collection<SuiteResult> |
getSuites() |
TestResult |
getTestResult()
Returns the top level test result data.
|
String |
getTitle()
Gets the human readable title of this result object.
|
int |
getTotalCount()
Gets the total number of tests.
|
boolean |
hasChildren()
Whether this test result has children.
|
boolean |
isEmpty()
Returns
true if this doesn't have any any test results. |
boolean |
isPassed() |
void |
parse(File reportFile)
Deprecated.
|
void |
parse(File reportFile,
PipelineTestDetails pipelineTestDetails)
Parses an additional report file.
|
void |
parse(long buildTime,
org.apache.tools.ant.DirectoryScanner results)
Deprecated.
|
void |
parse(long buildTime,
org.apache.tools.ant.DirectoryScanner results,
PipelineTestDetails pipelineTestDetails)
Collect reports from the given
DirectoryScanner , while
filtering out all files that were created before the given time. |
void |
parse(long buildTime,
File baseDir,
PipelineTestDetails pipelineTestDetails,
String[] reportFiles)
Collect reports from the given report files, while
filtering out all files that were created before the given time.
|
void |
parse(long buildTime,
File baseDir,
String[] reportFiles)
Deprecated.
|
void |
parse(long buildTime,
Iterable<File> reportFiles)
Deprecated.
|
void |
parse(long buildTime,
Iterable<File> reportFiles,
PipelineTestDetails pipelineTestDetails)
Collect reports from the given report files
|
void |
setParent(TestObject parent)
Sets the parent test result
|
void |
setParentAction(AbstractTestResultAction action)
If the concept of a parent action is important to a subclass, then it should
provide a non-noop implementation of this method.
|
void |
tally()
Recount my children.
|
getPipelineBlockWithTests, hasMultipleBlocks, populateBlocks
annotate, getBuildResult, getResultInRun, toPrettyString
doSubmitDescription, getApi, getDescription, getDurationString, getFullDisplayName, getFullName, getHistory, getId, getRelativePathFrom, getResultInBuild, getSafeName, getSearchUrl, getTestAction, getTestActions, getTestResultAction, getTopLevelTestResult, getUrl, safe, setDescription, uniquifyName
getOwner
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
public TestResult()
public TestResult(boolean keepLongStdio)
@Deprecated public TestResult(long buildTime, org.apache.tools.ant.DirectoryScanner results) throws IOException
IOException
@Deprecated public TestResult(long buildTime, org.apache.tools.ant.DirectoryScanner results, boolean keepLongStdio) throws IOException
IOException
public TestResult(long buildTime, org.apache.tools.ant.DirectoryScanner results, boolean keepLongStdio, PipelineTestDetails pipelineTestDetails) throws IOException
DirectoryScanner
, while
filtering out all files that were created before the given time.keepLongStdio
- if true, retain a suite's complete stdout/stderr even if this is huge and the suite passedpipelineTestDetails
- A PipelineTestDetails
instance containing Pipeline-related additional arguments.IOException
public TestResult(TestResultImpl impl)
@CheckForNull public TestResultImpl getPluggableStorage()
public TestObject getParent()
TestObject
TabulatedResult.getChildren()
.getParent
in class TestObject
TestObject
.public void setParent(TestObject parent)
TestResult
setParent
in class TestResult
parent
- Parent test result.public TestResult getTestResult()
TestObject
getTestResult
in class TestObject
@Deprecated public void parse(long buildTime, org.apache.tools.ant.DirectoryScanner results) throws IOException
IOException
public void parse(long buildTime, org.apache.tools.ant.DirectoryScanner results, PipelineTestDetails pipelineTestDetails) throws IOException
DirectoryScanner
, while
filtering out all files that were created before the given time.buildTime
- Build time.results
- Directory scanner.pipelineTestDetails
- A PipelineTestDetails
instance containing Pipeline-related additional arguments.IOException
- if an error occurs.@Deprecated public void parse(long buildTime, File baseDir, String[] reportFiles) throws IOException
IOException
public void parse(long buildTime, File baseDir, PipelineTestDetails pipelineTestDetails, String[] reportFiles) throws IOException
buildTime
- Build time.baseDir
- Base directory.pipelineTestDetails
- A PipelineTestDetails
instance containing Pipeline-related additional arguments.reportFiles
- Report files.IOException
- if an error occurs.public TestResult getPreviousResult()
TestResult
TestResult
in the previous run.getPreviousResult
in class TestResult
@Deprecated public void parse(long buildTime, Iterable<File> reportFiles) throws IOException
IOException
public void parse(long buildTime, Iterable<File> reportFiles, PipelineTestDetails pipelineTestDetails) throws IOException
buildTime
- Build time.reportFiles
- Report files.pipelineTestDetails
- A PipelineTestDetails
instance containing Pipeline-related additional arguments.IOException
- if an error occurs.@Deprecated public void parse(File reportFile) throws IOException
IOException
public void parse(File reportFile, PipelineTestDetails pipelineTestDetails) throws IOException
reportFile
- Report file to parse.pipelineTestDetails
- A PipelineTestDetails
instance containing Pipeline-related additional arguments.IOException
- if an error occurs.public String getDisplayName()
public Run<?,?> getRun()
getRun
in class TestObject
public TestResult findCorrespondingResult(String id)
TestObject
id
within this test result.findCorrespondingResult
in class TestObject
id
- The path to the original test resultpublic String getTitle()
TestResult
getTitle
in class TestResult
public String getChildTitle()
getChildTitle
in class TabulatedResult
@Exported(visibility=999) public float getDuration()
TestResult
getDuration
in class TestResult
@Exported(visibility=999) public int getPassCount()
TestResult
getPassCount
in class TestResult
@Exported(visibility=999) public int getFailCount()
TestResult
getFailCount
in class TestResult
@Exported(visibility=999) public int getSkipCount()
TestResult
getSkipCount
in class TestResult
public int getTotalCount()
TestObject
getTotalCount
in class TestObject
@Exported(visibility=999) public boolean isEmpty()
true
if this doesn't have any any test results.public List<CaseResult> getFailedTests()
MetaTabulatedResult
getFailedTests
in class MetaTabulatedResult
public List<CaseResult> getPassedTests()
getPassedTests
in class TestResult
public List<CaseResult> getSkippedTests()
getSkippedTests
in class TestResult
public int getFailedSince()
getFailedSince
in class TestResult
public Run<?,?> getFailedSinceRun()
getFailedSinceRun
in class TestResult
public String getStdout()
Depending on the tool that produced the XML report, this method works somewhat inconsistently. With some tools (such as Maven surefire plugin), you get the accurate information, that is the stdout from this test case. With some other tools (such as the JUnit task in Ant), this method returns the stdout produced by the entire test suite.
If you need to know which is the case, compare this output fromSuiteResult.getStdout()
.getStdout
in class TestResult
public String getStderr()
getStderr
in class TestResult
getStdout()
public String getErrorStackTrace()
getErrorStackTrace
in class TestResult
public String getErrorDetails()
getErrorDetails
in class TestResult
public boolean isPassed()
isPassed
in class TestResult
public Collection<PackageResult> getChildren()
TabulatedResult
getChildren
in class TabulatedResult
TestObject.getParent()
public boolean hasChildren()
hasChildren
in class TabulatedResult
@Exported(inline=true, visibility=9) public Collection<SuiteResult> getSuites()
public String getName()
TestObject
getName
in class TestObject
public Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
getDynamic
in class TestObject
public PackageResult byPackage(String packageName)
public SuiteResult getSuite(String name)
@Nonnull public TestResult getResultByNode(@Nonnull String nodeId)
@Nonnull public TestResult getResultByNodes(@Nonnull List<String> nodeIds)
public void setParentAction(AbstractTestResultAction action)
TestResult
setParentAction
in class TestResult
action
- Action that points to the top level test result.public AbstractTestResultAction getParentAction()
TestResult
getParentAction
in class TestResult
public void tally()
tally
in class TestResult
public void freeze(TestResultAction parent)
parsed
so far.
After the data is frozen, more files can be parsed and then freeze can be called again.
@Nonnull public TestResult getResultForPipelineBlock(@Nonnull String blockId)
@Nonnull public TabulatedResult blockToTestResult(@Nonnull PipelineBlockWithTests block, @Nonnull TabulatedResult fullResult)
TestResult
for all test results in a PipelineBlockWithTests
and any children it may have.blockToTestResult
in class TabulatedResult
Copyright © 2016–2020. All rights reserved.