Package testingbot

Class TestingBotBuildReportAction

java.lang.Object
testingbot.TestingBotBuildReportAction
All Implemented Interfaces:
Action, ModelObject, RunAction2

public class TestingBotBuildReportAction extends Object implements RunAction2
Adds a "TestingBot Build" page to a build that embeds the TestingBot build report (all TestingBot sessions grouped under this build) in an iframe.

Tests associate themselves with the build by using the TESTINGBOT_BUILD environment variable (exposed by the testingbot/testingbotTunnel steps and the freestyle build wrapper) as their build desired capability. The embedded report lives at /mini/builds/<clientKey>/<buildId> and is authenticated with a plain MD5(clientKey:clientSecret:buildId) token — computed once here so the raw secret is never stored on the build.

  • Field Details

    • TESTINGBOT_BUILD

      public static final String TESTINGBOT_BUILD
      Env var holding the build identifier. Tests should pass its value as their build desired capability so their sessions are grouped under this Jenkins build's report — the TestingBot analog of Sauce Labs' SAUCE_BUILD_NAME.
      See Also:
  • Method Details

    • create

      public static TestingBotBuildReportAction create(Run<?,?> run, TestingBotCredentials credentials)
      Builds the action for a run, computing the embed auth token from the credentials.
    • buildIdFor

      public static String buildIdFor(Run<?,?> run)
      The value tests should use as their build capability to appear in this build's report. Safe both as a capability value and as a URL path segment, and injective: distinct job names never collapse to the same identifier.
    • attach

      public static String attach(Run<?,?> run, TestingBotCredentials credentials)
      Adds the report action to the run (once) and returns the build identifier to expose as TESTINGBOT_BUILD. Callers that only need the identifier — e.g. a run without resolvable credentials — can use buildIdFor(Run) directly.

      Synchronized on the run so that concurrent steps in one build cannot attach duplicate actions. If an action already exists for a different TestingBot account (different client key), it is replaced so the embedded report and its auth token match the credentials now in effect.

    • getReportUrl

      public String getReportUrl()
    • getBuildId

      public String getBuildId()
    • getRun

      public Run<?,?> getRun()
    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • onAttached

      public void onAttached(Run<?,?> run)
      Specified by:
      onAttached in interface RunAction2
    • onLoad

      public void onLoad(Run<?,?> run)
      Specified by:
      onLoad in interface RunAction2