Works in freestyle (post-build action) and Pipeline (the {@code testingbotChecks} step). The + * actual GitHub delivery is done by the {@code github-checks} plugin; when it is not installed the + * publish is a safe no-op (a {@code NullChecksPublisher}).
+ */ +public class TestingBotChecksPublisher extends Recorder implements SimpleBuildStep { + + private static final String DEFAULT_NAME = "TestingBot"; + + private String name; + private String message; + + @DataBoundConstructor + public TestingBotChecksPublisher() { + } + + /** The check name — the "context" shown on the commit/PR. Defaults to {@code TestingBot}. */ + public String getName() { + return Util.fixEmptyAndTrim(name) == null ? DEFAULT_NAME : name; + } + + @DataBoundSetter + public void setName(String name) { + this.name = Util.fixEmptyAndTrim(name); + } + + /** Optional custom summary/message for the check; a session summary is generated when empty. */ + public String getMessage() { + return message; + } + + @DataBoundSetter + public void setMessage(String message) { + this.message = Util.fixEmptyAndTrim(message); + } + + @Override + public BuildStepMonitor getRequiredMonitorService() { + return BuildStepMonitor.NONE; + } + + @Override + public void perform(@NonNull Run, ?> run, @NonNull FilePath workspace, @NonNull EnvVars env, + @NonNull Launcher launcher, @NonNull TaskListener listener) { + int total = 0; + int passed = 0; + List3 of 4 TestingBot session(s) passed.).
+ The check links to the embedded TestingBot build report when one is available, otherwise to the
+ Jenkins run.
+TestingBot. Use a distinct name if you publish more than one check from a job.
+ Defaults to TestingBot.
+