hudson.tasks.test
Class DefaultTestResultParserImpl
java.lang.Object
hudson.tasks.test.TestResultParser
hudson.tasks.test.DefaultTestResultParserImpl
- All Implemented Interfaces:
- ExtensionPoint, Serializable
public abstract class DefaultTestResultParserImpl
- extends TestResultParser
- implements Serializable
Default partial implementation of TestResultParser
that handles GLOB dereferencing
and other checks for user errors, such as misconfigured GLOBs, up-to-date checks on test reports.
The instance of the parser will be serialized to the node that performed the build and the parsing will be done
remotely on that slave.
- Since:
- 1.343
- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IGNORE_TIMESTAMP_CHECK
public static final boolean IGNORE_TIMESTAMP_CHECK
DefaultTestResultParserImpl
public DefaultTestResultParserImpl()
parse
protected abstract TestResult parse(List<File> reportFiles,
Launcher launcher,
TaskListener listener)
throws InterruptedException,
IOException
- This method is executed on the slave that has the report files to parse test reports and builds
TestResult
.
- Parameters:
reportFiles
- List of files to be parsed. Never be empty nor null.launcher
- 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.
- 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.
AbortException
- If you encounter an error that you handled gracefully, throw this exception and Hudson
will not show a stack trace.
parse
public TestResult parse(String testResultLocations,
AbstractBuild build,
Launcher launcher,
TaskListener listener)
throws InterruptedException,
IOException
- Description copied from class:
TestResultParser
- Parses the specified set of files and builds a
TestResult
object 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 master/slave into account.
- Specified by:
parse
in class TestResultParser
- Parameters:
testResultLocations
- GLOB pattern relative to the workspace that
specifies the locations of the test result files. Never null.build
- Build for which these tests are parsed. Never null.launcher
- 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.
- 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.
AbortException
- If you encounter an error that you handled gracefully, throw this exception and Hudson
will not show a stack trace.
Copyright © 2004-2013. All Rights Reserved.