Class TestResultParser

    • Constructor Detail

      • TestResultParser

        public TestResultParser()
    • Method Detail

      • getDisplayName

        public String getDisplayName()
        Normally unused.
        Returns a human readable name of the parser, like "JUnit Parser".
        a human readable name of the parser, like "JUnit Parser".
      • getTestResultLocationMessage

        public String getTestResultLocationMessage()
        Normally unused.
        This text is used in the UI prompt for the GLOB that specifies files to be parsed by this parser. For example, "JUnit XML reports:"
        the text is used in the UI prompt for the GLOB that specifies files to be parsed by this parser.
      • parseResult

        public TestResult parseResult​(String testResultLocations,
                                      Run<?,​?> run,
                                      PipelineTestDetails pipelineTestDetails,
                                      FilePath workspace,
                                      Launcher launcher,
                                      TaskListener listener)
                               throws InterruptedException,
        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 controller/agent into account.
        testResultLocations - GLOB pattern relative to the workspace that specifies the locations of the test result files. Never null.
        run - Build for which these tests are parsed. Never null.
        pipelineTestDetails - A PipelineTestDetails instance containing Pipeline-related additional arguments.
        workspace - the workspace in which tests can be found
        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.
        a TestResult object representing the provided files and builds.
        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.