Class TestResultExtension

java.lang.Object
io.jenkins.plugins.mcp.server.extensions.TestResultExtension
All Implemented Interfaces:
ExtensionPoint, McpServerExtension

@OptionalExtension(requirePlugins="junit") public class TestResultExtension extends Object implements McpServerExtension
  • Constructor Details

    • TestResultExtension

      public TestResultExtension()
  • Method Details

    • getTestResults

      @Tool(description="Retrieves the test results of a Jenkins build (a given build number, or the last build). Returns a compact summary by default: the pass/fail/skip counts plus one entry per failing test. Pass summary=false, or onlyFailingTests=true, when you need stdout, stderr and error stack traces.", annotations=) public Map<String,Object> getTestResults(@ToolParam(description="Job full name of the Jenkins job (e.g., \'folder/job-name\')") String jobFullName, @Nullable @ToolParam(description="Build number (optional, if not provided, returns the test results for last build)",required=false) Integer buildNumber, @Nullable @ToolParam(description="Return only the failing tests instead of every test. This only affects the full (non-summary) response, because a summary always lists just the failing tests. Passing true without an explicit summary resolves summary to false, so you get the complete junit records - stdout, stderr and stack traces - for the failing tests.",required=false) Boolean onlyFailingTests, @Nullable @ToolParam(description="Return a compact summary instead of the full junit records. Defaults to true: you get buildNumber, totalCount/failCount/skipCount/passCount, and one entry per failing test with its class name, test name, failure message (cut to 512 characters; the head of the stack trace is used when the test reported no message) and age (number of consecutive builds it has been failing). Use this to triage a build. Set it to false to get the complete junit data including stdout, stderr and error stack traces - that can be several megabytes for a build with many failures, so only do it for a build whose detail you already know you need. If you omit this parameter and pass onlyFailingTests=true, summary resolves to false, because asking for the failing tests alone is treated as asking for their full detail.",required=false) Boolean summary)
    • getFlakyFailures

      @Tool(description="Retrieves the flaky failures of a Jenkins build if any were found - tests that failed and then passed on a retry. Returns a compact summary by default: class name, test name and the message and type of each flaky attempt. Pass summary=false when you need each attempt\'s stack trace, stdout and stderr.", annotations=) public Map<String,Object> getFlakyFailures(@ToolParam(description="Job full name of the Jenkins job (e.g., \'folder/job-name\')") String jobFullName, @Nullable @ToolParam(description="Build number (optional, if not provided, returns the test results for last build)",required=false) Integer buildNumber, @Nullable @ToolParam(description="Return a compact summary instead of the full junit records. Defaults to true: you get buildNumber, the number of flaky tests and flaky attempts, and one entry per test with flaky failures carrying its class name, test name and, per flaky attempt, the failure message (cut to 512 characters; the head of the stack trace is used when the attempt reported no message) and the exception type. Set it to false to get the complete flaky-failure data including each attempt\'s stack trace, stdout and stderr - that can be several megabytes, so only do it for a build whose detail you already know you need.",required=false) Boolean summary)