Package hudson.tasks.junit
Class JUnitParser
java.lang.Object
hudson.tasks.test.TestResultParser
hudson.tasks.junit.JUnitParser
Parse some JUnit xml files and generate a TestResult containing all the
results parsed.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.JUnitParser(boolean keepLongStdio) Deprecated.JUnitParser(boolean keepLongStdio, boolean allowEmptyResults) Deprecated.JUnitParser(boolean keepLongStdio, boolean keepProperties, boolean allowEmptyResults, boolean skipOldReports) Deprecated.JUnitParser(StdioRetention stdioRetention, boolean keepProperties, boolean allowEmptyResults, boolean skipOldReports) Deprecated.JUnitParser(StdioRetention stdioRetention, boolean keepProperties, boolean allowEmptyResults, boolean skipOldReports, boolean keepTestNames) -
Method Summary
Modifier and TypeMethodDescriptionReturns a human readable name of the parser, like "JUnit Parser".This text is used in the UI prompt for the GLOB that specifies files to be parsed by this parser.parse(String testResultLocations, AbstractBuild build, Launcher launcher, TaskListener listener) Deprecated.parseResult(String testResultLocations, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) Deprecated.parseResult(String testResultLocations, Run<?, ?> build, PipelineTestDetails pipelineTestDetails, FilePath workspace, Launcher launcher, TaskListener listener) Parses the specified set of files and builds aTestResultobject that represents them.summarizeResult(String testResultLocations, Run<?, ?> build, PipelineTestDetails pipelineTestDetails, FilePath workspace, Launcher launcher, TaskListener listener, JunitTestResultStorage storage) Methods inherited from class hudson.tasks.test.TestResultParser
all
-
Constructor Details
-
JUnitParser
Deprecated.Generally unused, but present for extension compatibility. -
JUnitParser
Deprecated.- Parameters:
keepLongStdio- if true, retain a suite's complete stdout/stderr even if this is huge and the suite passed- Since:
- 1.358
-
JUnitParser
Deprecated.- Parameters:
keepLongStdio- if true, retain a suite's complete stdout/stderr even if this is huge and the suite passedallowEmptyResults- if true, empty results are allowed- Since:
- 1.10
-
JUnitParser
@Deprecated public JUnitParser(boolean keepLongStdio, boolean keepProperties, boolean allowEmptyResults, boolean skipOldReports) Deprecated. -
JUnitParser
@Deprecated public JUnitParser(StdioRetention stdioRetention, boolean keepProperties, boolean allowEmptyResults, boolean skipOldReports) Deprecated. -
JUnitParser
public JUnitParser(StdioRetention stdioRetention, boolean keepProperties, boolean allowEmptyResults, boolean skipOldReports, boolean keepTestNames)
-
-
Method Details
-
getDisplayName
Description copied from class:TestResultParserReturns a human readable name of the parser, like "JUnit Parser".- Overrides:
getDisplayNamein classTestResultParser- Returns:
- a human readable name of the parser, like "JUnit Parser".
-
getTestResultLocationMessage
Description copied from class:TestResultParserThis text is used in the UI prompt for the GLOB that specifies files to be parsed by this parser. For example, "JUnit XML reports:"- Overrides:
getTestResultLocationMessagein classTestResultParser- Returns:
- the text is used in the UI prompt for the GLOB that specifies files to be parsed by this parser.
-
parse
@Deprecated public TestResult parse(String testResultLocations, AbstractBuild build, Launcher launcher, TaskListener listener) throws InterruptedException, IOException Deprecated.- Overrides:
parsein classTestResultParser- Throws:
InterruptedExceptionIOException
-
parseResult
@Deprecated public TestResult parseResult(String testResultLocations, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOExceptionDeprecated.- Overrides:
parseResultin classTestResultParser- Throws:
InterruptedExceptionIOException
-
parseResult
public TestResult parseResult(String testResultLocations, Run<?, ?> build, PipelineTestDetails pipelineTestDetails, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOExceptionDescription copied from class:TestResultParserParses the specified set of files and builds aTestResultobject that represents them.The implementation is encouraged to do the following:
- If the build is successful but GLOB didn't match anything, report that as an error. This is to detect the error in GLOB. But don't do this if the build has already failed (for example, think of a failure in SCM checkout.)
- Examine time stamp of test report files and if those are younger than the build, ignore them. This is to ignore test reports created by earlier executions. Take the possible timestamp difference in the controller/agent into account.
- Overrides:
parseResultin classTestResultParser- Parameters:
testResultLocations- GLOB pattern relative to theworkspacethat specifies the locations of the test result files. Never null.build- Build for which these tests are parsed. Never null.pipelineTestDetails- APipelineTestDetailsinstance containing Pipeline-related additional arguments.workspace- the workspace in which tests can be foundlauncher- Can be used to fork processes on the machine where the build is running. Never null.listener- Use this to report progress and other problems. Never null.- Returns:
- a
TestResultobject representing the provided files and builds. - Throws:
InterruptedException- If the user cancels the build, it will be received as a thread interruption. Do not catch it, and instead just forward that through the call stack.IOException- If you don't care about handling exceptions gracefully, you can just throw IOException and let the default exception handling in Hudson takes care of it.
-
summarizeResult
public TestResultSummary summarizeResult(String testResultLocations, Run<?, ?> build, PipelineTestDetails pipelineTestDetails, FilePath workspace, Launcher launcher, TaskListener listener, JunitTestResultStorage storage) throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-