Class ConformanceRunner.Builder

java.lang.Object
codes.grow.packages.datadoglogs.testing.ConformanceRunner.Builder
Enclosing class:
ConformanceRunner

public static final class ConformanceRunner.Builder extends Object
Builder for ConformanceRunner.
  • Method Details

    • scenarioDir

      public ConformanceRunner.Builder scenarioDir(Path dir)
      Reads scenarios from this directory instead of searching for conformance/scenarios.
      Parameters:
      dir - scenario directory
      Returns:
      this builder
    • target

      public ConformanceRunner.Builder target(String category, TargetFactory factory)
      Sets the target factory of a category; categories without a target do not run.
      Parameters:
      category - core, secrets, logging or tracing
      factory - creates the target per scenario
      Returns:
      this builder
    • capabilities

      public ConformanceRunner.Builder capabilities(String... caps)
      Declares capabilities of the target (write, delete, versions, query, version, ...). Scenarios and steps requiring others are skipped.
      Parameters:
      caps - capability names
      Returns:
      this builder
    • prefix

      public ConformanceRunner.Builder prefix(String prefix)
      Sets the ${prefix} template (may contain ${run}).
      Parameters:
      prefix - prefix template, default "grow-conformance/${run}/"
      Returns:
      this builder
    • variable

      public ConformanceRunner.Builder variable(String name, String value)
      Sets an extra variable, e.g. serviceName.
      Parameters:
      name - variable name
      value - value
      Returns:
      this builder
    • serviceName

      public ConformanceRunner.Builder serviceName(String serviceName)
      Sets ${serviceName} (the tracing service name the factory configured).
      Parameters:
      serviceName - service name
      Returns:
      this builder
    • only

      public ConformanceRunner.Builder only(String... ids)
      Restricts the run to these scenario ids.
      Parameters:
      ids - scenario ids
      Returns:
      this builder
    • register

      public ConformanceRunner.Builder register(ConformanceOps categoryOps)
      Registers (or overrides) operations of a category.
      Parameters:
      categoryOps - operations
      Returns:
      this builder
    • op

      public ConformanceRunner.Builder op(String category, String op, OpHandler handler)
      Registers one operation.
      Parameters:
      category - category
      op - operation name
      handler - handler
      Returns:
      this builder
    • poll

      public ConformanceRunner.Builder poll(String op, Duration timeout)
      Repeats a failing step of op until its expectation passes or timeout (or the step's timeoutMs argument) runs out, for eventually consistent backends. listServices polls for ConformanceRunner.DEFAULT_POLL_TIMEOUT by default; Duration.ZERO turns polling off for an op.
      Parameters:
      op - operation name
      timeout - how long to repeat the step
      Returns:
      this builder
    • pollInterval

      public ConformanceRunner.Builder pollInterval(Duration interval)
      Sets the pause between repeated steps (default ConformanceRunner.DEFAULT_POLL_INTERVAL).
      Parameters:
      interval - positive pause
      Returns:
      this builder
    • build

      public ConformanceRunner build()
      Builds the runner.
      Returns:
      the runner