BuildkiteTestCollector.Payload (buildkite_test_collector v0.3.0)
A structure that represents all data about a test suite run needed for analytics.
Link to this section Summary
Functions
Convert the payload into a map ready for serialisation to JSON.
Initialise an empty payload with the given CI environment.
Push a test pesult into the payload.
Set the start time of the suite.
Link to this section Types
Link to this type
serialised_environment()
@type serialised_environment() :: %{ :CI => String.t(), :key => String.t(), optional(:number) => String.t(), optional(:job_id) => String.t(), optional(:branch) => String.t(), optional(:commit_sha) => String.t(), optional(:message) => String.t(), optional(:url) => String.t(), collector: String.t(), version: String.t() }
@type t() :: %BuildkiteTestCollector.Payload{ data: [BuildkiteTestCollector.TestResult.t()], data_size: non_neg_integer(), run_env: serialised_environment(), started_at: nil | BuildkiteTestCollector.Instant.t() }
Link to this section Functions
Link to this function
as_json(payload)
Convert the payload into a map ready for serialisation to JSON.
This is done as a separate step because all timings are relative to the payload start time, so must be calculated.
Link to this function
init(ci_env_mod)
@spec init(BuildkiteTestCollector.CiEnv.t()) :: t()
Initialise an empty payload with the given CI environment.
Link to this function
push_test_result(payload, test_result)
@spec push_test_result(t(), BuildkiteTestCollector.TestResult.t()) :: t()
Push a test pesult into the payload.
Link to this function
set_start_time(payload, started_at)
@spec set_start_time(t(), BuildkiteTestCollector.Instant.t()) :: t()
Set the start time of the suite.