config
config
¶
The consumer's declarative surface — tests/containers/matrix.yml.
A consuming repo declares what its matrix is (image prefix, Containerfile
flavor, slot selection, capability contract, test phases); the engine owns
how a matrix runs. This module is the schema and its loader — parse,
validate against the slot catalog, and hand the runner a frozen
MatrixConfig.
Unknown keys and unknown slot names are hard errors: the file is small and hand-written, so a typo silently ignored would mean a slot or phase quietly not running.
SCOPES = ('unit', 'integ')
module-attribute
¶
MatrixConfigError
¶
Bases: ValueError
A matrix.yml failed validation.
Phase(name, run=(), pytest=None, scope=None, expect_add=(), tolerate_failure=False)
dataclass
¶
One step of the in-container test flow.
A phase either runs shell commands (run) or a pytest invocation
(pytest) — never both. Command phases abort the slot on failure
(later phases depend on their effect, e.g. installed hooks); pytest
phases record the failure and continue, so one run surfaces every
failing suite.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Human-readable heading printed before the phase. |
required |
run
|
tuple[str, ...]
|
Shell commands executed in order (command phase). |
()
|
pytest
|
str | None
|
Arguments to |
None
|
scope
|
str | None
|
Optional |
None
|
expect_add
|
tuple[str, ...]
|
Capability names appended to |
()
|
tolerate_failure
|
bool
|
Run the commands best-effort (diagnostics). |
False
|
SlotConfig(extra_packages=(), skip_arches=(), skip_reason='', groups=None, expect=None, phases=None)
dataclass
¶
Per-slot choices a repo makes on top of the catalog facts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_packages
|
tuple[str, ...]
|
Distro packages appended to the shared image's
base set (the |
()
|
skip_arches
|
tuple[str, ...]
|
Host architectures ( |
()
|
skip_reason
|
str
|
Human-readable reason shown for the skip. |
''
|
groups
|
tuple[str, ...] | None
|
Override of the repo-level dependency groups. |
None
|
expect
|
tuple[str, ...] | None
|
Override of the repo-level capability contract. |
None
|
phases
|
tuple[Phase, ...] | None
|
Override of the repo-level phase list. |
None
|
extra_packages = ()
class-attribute
instance-attribute
¶
skip_arches = ()
class-attribute
instance-attribute
¶
skip_reason = ''
class-attribute
instance-attribute
¶
groups = None
class-attribute
instance-attribute
¶
expect = None
class-attribute
instance-attribute
¶
phases = None
class-attribute
instance-attribute
¶
MatrixConfig(image_prefix, flavor, groups, expect, slots, phases, containers_dir, repo_root)
dataclass
¶
A repo's whole matrix declaration, resolved and validated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_prefix
|
str
|
Image/container name prefix and prune-label value. |
required |
flavor
|
str
|
Shared Containerfile family ( |
required |
groups
|
tuple[str, ...]
|
Dependency groups synced before testing. |
required |
expect
|
tuple[str, ...]
|
|
required |
slots
|
dict[str, SlotConfig]
|
Selected slots in declaration order. |
required |
phases
|
tuple[Phase, ...]
|
Repo-level test flow. |
required |
containers_dir
|
Path
|
Directory of the |
required |
repo_root
|
Path
|
Build context and bind-mounted source tree. |
required |
image_prefix
instance-attribute
¶
flavor
instance-attribute
¶
groups
instance-attribute
¶
expect
instance-attribute
¶
slots
instance-attribute
¶
phases
instance-attribute
¶
containers_dir
instance-attribute
¶
repo_root
instance-attribute
¶
slot_groups(name)
¶
slot_expect(name)
¶
Capability contract effective for slot name.
slot_phases(name)
¶
load_config(path)
¶
Load and validate a matrix.yml.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The config file; its grandparent directory is taken as the
repo root ( |
required |
Raises:
| Type | Description |
|---|---|
MatrixConfigError
|
On unknown keys, unknown slots, or a phase that is neither a command phase nor a pytest phase. |