Class TestResultParser

    • Constructor Detail

      • TestResultParser

        public TestResultParser()
    • Method Detail

      • getDisplayName

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

        @Deprecated
        public String getTestResultLocationMessage()
        Deprecated.
        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:"
        Returns:
        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,
                                      @NonNull
                                      FilePath workspace,
                                      Launcher launcher,
                                      TaskListener listener)
                               throws InterruptedException,
                                      IOException
        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.
        Parameters:
        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.
        Returns:
        a TestResult object 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.
        AbortException - If you encounter an error that you handled gracefully, throw this exception and Hudson will not show a stack trace.
        Since:
        1.22