BuildkiteTestCollector.Payload (buildkite_test_collector v0.3.1)
A structure that represents all data about a test suite run needed for analytics.
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.
Types
@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() }
Functions
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.
@spec init(BuildkiteTestCollector.CiEnv.t()) :: t()
Initialise an empty payload with the given CI environment.
@spec push_test_result(t(), BuildkiteTestCollector.TestResult.t()) :: t()
Push a test pesult into the payload.
@spec set_start_time(t(), BuildkiteTestCollector.Instant.t()) :: t()
Set the start time of the suite.