BuildkiteTestCollector.CiEnv behaviour (buildkite_test_collector v0.3.1)

A behaviour for representing CI environments.

Implemented for each CI environment.

Summary

Callbacks

The git branch or tag that is being tested

Returns the name of the environment snake_case

Name of test collector

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

Version of test collector

Functions

Implements defaults for the optional callbacks.

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

Callbacks

branch()

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

The git branch or tag that is being tested

ci()

@callback ci() :: String.t()

Returns the name of the environment snake_case

collector()

@callback collector() :: String.t()

Name of test collector

commit_sha()

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

job_id()

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

A unique job ID

key()

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

A unique identifier for this test run

message()

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

Any additional message from the CI environment

number()

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

A unique number for the run

url()

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

The URL for more information about this run

version()

@callback version() :: String.t()

Version of test collector

Functions

__using__(_)

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

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.