BuildkiteTestCollector.CiEnv behaviour (buildkite_test_collector v0.1.0)
A behaviour for representing CI environments.
Implemented for each CI environment.
Link to this section Summary
Callbacks
The git branch or tag that is being tested
Returns the name of the environment snake_case
The git commit SHA for the code under test
Returns true if the specified environment is present
A unique job ID
A unique identifier for this test run
Any additional message from the CI environment
A unique number for the run
The URL for more information about this run
Functions
Implements defaults for the optional callbacks.
Detect if the current process is running in a supported CI environment.
Link to this section Callbacks
@callback branch() :: nil | String.t()
The git branch or tag that is being tested
@callback ci() :: String.t()
Returns the name of the environment snake_case
@callback commit_sha() :: nil | String.t()
The git commit SHA for the code under test
detected?()
@callback detected?() :: boolean()
Returns true if the specified environment is present
@callback job_id() :: nil | String.t()
A unique job ID
key()
@callback key() :: nil | String.t()
A unique identifier for this test run
@callback message() :: nil | String.t()
Any additional message from the CI environment
@callback number() :: nil | String.t()
A unique number for the run
@callback url() :: nil | String.t()
The URL for more information about this run
Link to this section Functions
Implements defaults for the optional callbacks.
detect_env()
@spec detect_env() :: {:ok, module()} | :error
Detect if the current process is running in a supported CI environment.