tests.test_runner_catalog module

The available-images table parses, and fails closed when it does not.

The fixture below is trimmed from the real actions/runner-images readme and keeps every shape that has bitten: a -latest alias sitting inside a label rather than at its end (macos-latest-large), a row whose plain label is the x64 -intel variant rather than the bare name, badges with and without a link, and the <br> endpoint markup that follows every display name.

tests.test_runner_catalog.catalog() → list[RunnerImage][source]
Return type:

list[RunnerImage]

tests.test_runner_catalog.by_name(catalog) → dict[str, RunnerImage][source]

The catalog indexed by display name, for assertion lookups.

Return type:

dict[str, RunnerImage]

tests.test_runner_catalog.test_every_row_is_parsed(catalog)[source]

The separator row and the trailing prose are not mistaken for images.

Return type:

None

tests.test_runner_catalog.test_no_floating_alias_survives(catalog)[source]

No -latest label reaches a caller, wherever it sat in the cell.

macos-latest-large is the one that matters: a suffix test keeps it, and a caller writing it into a runs-on: would introduce the exact floating alias lint-repo warns about.

Return type:

None

tests.test_runner_catalog.test_preferred_label(by_name, display_name, expected)[source]

One label per row, picked without reaching for a larger runner.

Return type:

None

A badge marks the state whether or not it is wrapped in a link.

Return type:

None

tests.test_runner_catalog.test_successor_prefers_released_over_preview(catalog, label, expected)[source]

A retirement lands on released ground whenever released ground exists.

A forced move should not trade a known deadline for an unknown one, so a released successor wins however old it is. newer_preview_than is what surfaces the fresher option without taking it.

Return type:

None

tests.test_runner_catalog.test_successor_accepts_a_same_version_sibling(catalog)[source]

A dying image with only a same-version sibling still has somewhere to go.

Version is not filtered here, unlike newer_version_than(): staying on an image with an end date is worse than moving sideways to one without.

Return type:

None

tests.test_runner_catalog.test_newer_version_is_strict(catalog, label, expected)[source]

Only a strictly higher version counts as an upgrade.

This is what keeps a same-version flavour, like a Visual Studio variant, from being proposed as a newer image when it is merely a different one.

Return type:

None

tests.test_runner_catalog.test_parse_fails_closed(readme)[source]

A restyled table yields nothing rather than something wrong.

Every caller reads an empty catalog as “propose nothing”. A wrong label would rewrite a runs-on: to an image GitHub does not host, failing every job in the repository; a missing one costs a cycle of not noticing.

Return type:

None

tests.test_runner_catalog.test_runner_architecture(label, expected)[source]

Every label shape the published table lists resolves to its own column.

Transcribed from the Available Images table rather than derived from the rule under test, so a rule that starts guessing fails here instead of agreeing with itself.

Return type:

None

tests.test_runner_catalog.test_runner_architecture_matches_the_catalog(catalog)[source]

The offline derivation agrees with the table it stands in for.

runner_architecture() exists because nothing running inside a job can wait on a network fetch, which makes it a second answer to a question the catalog already answers. This is what keeps the two from drifting: a label shape GitHub introduces that the rule reads wrong fails here, on the fixture, with no network involved.

Return type:

None

tests.test_runner_catalog.test_runner_architecture_matches_the_build_targets()[source]

The derivation agrees with the hand-written Nuitka target table.

NUITKA_BUILD_TARGETS pairs a runner image with an architecture by hand, for the six images release binaries are compiled on. Deriving the same pairing from the label is the cross-check: the two are written independently, so a repointed image breaks one of them loudly rather than shipping a binary built for the wrong architecture.

Return type:

None