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_ARCHITECTURES = {'arm64': Architecture(id='aarch64', name='ARM64 (AArch64)'), 'x64': Architecture(id='x86_64', name='x86-64 (AMD64)')}¶
The Architecture column’s own spelling, mapped to extra-platforms.
architecturekeeps the table’s wording, so the cross-check below translates it before comparing.
- tests.test_runner_catalog.by_name(catalog)[source]¶
The catalog indexed by display name, for assertion lookups.
- Return type:
- 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:
- tests.test_runner_catalog.test_no_floating_alias_survives(catalog)[source]¶
No
-latestlabel reaches a caller, wherever it sat in the cell.macos-latest-largeis the one that matters: a suffix test keeps it, and a caller writing it into aruns-on:would introduce the exact floating aliaslint-repowarns about.- Return type:
- 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:
- tests.test_runner_catalog.test_badges_are_read_with_and_without_a_link(by_name)[source]¶
A badge marks the state whether or not it is wrapped in a link.
- Return type:
- 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_thanis what surfaces the fresher option without taking it.- Return type:
- 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:
- 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:
- 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:
- tests.test_runner_catalog.test_rows_without_a_usable_label_are_skipped()[source]¶
A row too short to hold a label, or listing only an alias, is no image.
- Return type:
- tests.test_runner_catalog.test_fetch_catalog_decodes_the_readme()[source]¶
The readme arrives base64-encoded, in lines, and parses like the fixture.
- Return type:
- tests.test_runner_catalog.test_fetch_catalog_fails_closed_on_an_undecodable_readme(content)[source]¶
A readme that does not decode is an unavailable catalog, never a crash.
- Return type:
- 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:
- 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:
- tests.test_runner_catalog.test_runner_architecture_matches_the_build_targets()[source]¶
The derivation agrees with the hand-written Nuitka target table.
NUITKA_BUILD_TARGETSpairs 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: