RecordingGate

sealed interface RecordingGate(source)

Whether recording is allowed in this process: the one way to obtain the Enabled a FixtureRecorder needs. evaluate reads the environment: recording is off unless WEBTOOLS_HTTP_RECORD (RECORD_VARIABLE) holds a recognised value, and is refused whenever any of the twelve CI variables (CI_VARIABLES) is present with any value, the empty string included.

Stable Core, source compatibility only. Sealed: the recorder accepts only Enabled, whose constructor is internal, so the live path cannot be reached without passing the gate. "Never runs in CI" holds for every CI that sets one of the twelve variables; it is not a guarantee against a CI that sets none of them and a developer who sets the variable there. Equality is identity; toString() prints the mode or the reason, never a value from the environment.

A Test task is UP-TO-DATE when only an environment variable changed, so a build that records declares the variable as an input of its test tasks:

tasks.withType<Test>().configureEach {
inputs.property("webtoolsHttpRecord", providers.environmentVariable("WEBTOOLS_HTTP_RECORD").orElse(""))
}

Inheritors

Types

Link copied to clipboard
object Companion

The variables and the evaluation.

Link copied to clipboard

Recording is off; reason is one of three constants or refusing to record: <VAR> is set, naming the variable only. A test uses it with assumeTrue(gate is Enabled).

Link copied to clipboard

Recording is on, in mode.