BuildkiteTestCollector.CiEnv behaviour (buildkite_test_collector v0.1.1)

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

Link to this callback

branch()

(optional)
@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

Link to this callback

commit_sha()

(optional)
@callback commit_sha() :: nil | String.t()

The git commit SHA for the code under test

@callback detected?() :: boolean()

Returns true if the specified environment is present

Link to this callback

job_id()

(optional)
@callback job_id() :: nil | String.t()

A unique job ID

@callback key() :: nil | String.t()

A unique identifier for this test run

Link to this callback

message()

(optional)
@callback message() :: nil | String.t()

Any additional message from the CI environment

Link to this callback

number()

(optional)
@callback number() :: nil | String.t()

A unique number for the run

Link to this callback

url()

(optional)
@callback url() :: nil | String.t()

The URL for more information about this run

Link to this section Functions

Link to this macro

__using__(_)

(macro)
@spec __using__(keyword()) :: Macro.t()

Implements defaults for the optional callbacks.

@spec detect_env() :: {:ok, module()} | :error

Detect if the current process is running in a supported CI environment.