tests.test_prepare_release moduleΒΆ
Tests for repomatic.release.prepare_release: the release freeze and unfreeze edits.
- tests.test_prepare_release.temp_changelog(tmp_path: Path) Path[source]ΒΆ
Create a temporary changelog file.
- Return type:
- tests.test_prepare_release.temp_citation(tmp_path: Path) Path[source]ΒΆ
Create a temporary citation file.
- Return type:
- tests.test_prepare_release.temp_workflows(tmp_path: Path) Path[source]ΒΆ
Create a temporary workflows directory with sample files.
- Return type:
- tests.test_prepare_release.temp_workflows_with_actions(tmp_path: Path) Path[source]ΒΆ
Create workflows referencing a discoverable composite action.
The action freeze/unfreeze logic enumerates
.github/actions/*/action.y*mlto decide which action names to rewrite, so the fixture materializes a dummypr-metadata/action.yamlalongside the workflow that references it.- Return type:
- tests.test_prepare_release.temp_workflows_with_cli(tmp_path: Path) Path[source]ΒΆ
Create workflows with lockfile-backed
uv runCLI invocations.- Return type:
- tests.test_prepare_release.temp_pyproject(tmp_path: Path) Path[source]ΒΆ
Create a temporary pyproject.toml with bumpversion config.
- Return type:
- tests.test_prepare_release.test_current_version_from_pyproject()[source]ΒΆ
Test that current version is read from pyproject.toml.
- Return type:
- tests.test_prepare_release.test_freeze_action_reference(temp_workflows_with_actions)[source]ΒΆ
Test that composite action references are frozen to versioned tag.
- Return type:
- tests.test_prepare_release.test_composite_action_names_enumerates_actions_dir(tmp_path)[source]ΒΆ
composite_action_namesdiscovers every action.y(a)ml directory.Conformance test: a freshly-created action under
.github/actions/must appear in the discovery list without code changes elsewhere.- Return type:
- tests.test_prepare_release.test_composite_action_names_empty_when_no_actions_dir(tmp_path)[source]ΒΆ
composite_action_namesreturns an empty list when actions/ is absent.- Return type:
- tests.test_prepare_release.test_freeze_unfreeze_round_trip_per_action(tmp_path)[source]ΒΆ
Every discovered action is frozen and unfrozen idempotently.
Parametrize-style conformance check: enumerate the population of discovered composite actions, run freeze then unfreeze, and assert each actionβs
@mainβ@v{version}substitution round-trips.- Return type:
- tests.test_prepare_release.test_freeze_cli_version(temp_workflows_with_cli)[source]ΒΆ
Test that the local
uv runinvocation is frozen to a PyPI version.- Return type:
- tests.test_prepare_release.test_freeze_workflow_urls(temp_workflows)[source]ΒΆ
Test that workflow URLs are frozen to versioned tag.
- Return type:
- tests.test_prepare_release.test_post_release(temp_workflows)[source]ΒΆ
Test post-release workflow unfreezing.
- Return type:
- tests.test_prepare_release.test_post_release_unfreezes_cli(temp_workflows_with_cli)[source]ΒΆ
Test that post-release unfreezes CLI invocations back to local source.
- Return type:
- tests.test_prepare_release.test_prepare_release_full(temp_changelog, temp_citation, temp_workflows)[source]ΒΆ
Test full release preparation with all options.
- Return type:
- tests.test_prepare_release.test_prepare_release_freezes_cli(temp_changelog, temp_citation, temp_workflows_with_cli)[source]ΒΆ
Test that prepare_release freezes CLI invocations to current version.
- Return type:
- tests.test_prepare_release.test_prepare_release_without_workflows(temp_changelog, temp_citation)[source]ΒΆ
Test release preparation without workflow updates.
- Return type:
- tests.test_prepare_release.test_release_date_format()[source]ΒΆ
Test that release date is in correct format.
- Return type:
- tests.test_prepare_release.test_set_citation_release_date(temp_citation)[source]ΒΆ
Test that release date is set in citation file.
- Return type:
- tests.test_prepare_release.test_set_citation_release_date_missing_file(tmp_path)[source]ΒΆ
Test that missing citation file is handled gracefully.
- Return type:
- tests.test_prepare_release.test_unfreeze_action_reference(temp_workflows_with_actions)[source]ΒΆ
Test that composite action references are unfrozen to default branch.
- Return type:
- tests.test_prepare_release.test_unfreeze_cli_version(temp_workflows_with_cli)[source]ΒΆ
Test that frozen PyPI version is unfrozen back to local source.
- Return type:
- tests.test_prepare_release.test_spliced_exemption_round_trips_through_unfreeze(temp_workflows_with_cli)[source]ΒΆ
A pin exempted by
sync-workflow-pinsunfreezes like a frozen one.The freeze and
apply_self_pin_exemptionare two writers of the same command line: they must converge on one byte sequence, or the unfreeze pattern silently skips whichever spelling it does not recognize.- Return type:
- tests.test_prepare_release.test_unfreeze_workflow_urls(temp_workflows)[source]ΒΆ
Test that workflow URLs are unfrozen back to default branch.
- Return type:
- tests.test_prepare_release.temp_install(tmp_path: Path) Path[source]ΒΆ
Create a temporary install guide with binary download table.
- Return type:
- tests.test_prepare_release.temp_install_frozen(tmp_path: Path) Path[source]ΒΆ
Create a temporary install guide with previously frozen download URLs.
- Return type:
- tests.test_prepare_release.test_freeze_install_download_urls(temp_install)[source]ΒΆ
Test that initial
/releases/latest/download/URLs are frozen.- Return type:
- tests.test_prepare_release.test_freeze_install_download_urls_already_frozen(temp_install_frozen)[source]ΒΆ
Test that previously frozen URLs are re-frozen to new version.
- Return type:
- tests.test_prepare_release.test_freeze_install_download_urls_updates_link_text(temp_install)[source]ΒΆ
Test that display text in markdown links is also updated.
- Return type:
- tests.test_prepare_release.test_freeze_install_missing_file(tmp_path)[source]ΒΆ
Test that a missing install guide is handled gracefully.
- Return type:
- tests.test_prepare_release.RATCHETING_FREEZES = frozenset({'freeze_install_cli_version', 'freeze_install_download_urls', 'freeze_marketplace_pin', 'freeze_plugin_manifest_version'})ΒΆ
Freeze passes that deliberately have no
unfreeze_counterpart.Each one writes a value that must keep naming the last published release between cycles, so walking it back would leave
mainadvertising avX.Y.Z.devNtag that was never created.
- tests.test_prepare_release.test_every_freeze_declares_its_direction()[source]ΒΆ
A freeze pass either round-trips or is named as ratcheting, never neither.
Which of the two a pin follows is a decision, and it was prose-only until this test: a new
freeze_method simply omitted frompost_releaselooked exactly like one that ratchets on purpose. This guards additions from here on and claims no coverage of the ones already in place.- Return type:
- tests.test_prepare_release.test_freeze_marketplace_pin(tmp_path)[source]ΒΆ
Both halves of an already-pinned entry ratchet to the new release.
- Return type:
- tests.test_prepare_release.test_freeze_marketplace_pin_leaves_an_unpinned_entry_alone(tmp_path)[source]ΒΆ
A never-released catalog tracks the default branch until a tag exists.
- Return type:
- tests.test_prepare_release.test_freeze_marketplace_pin_missing_file(tmp_path)[source]ΒΆ
A repository with no plugin marketplace is left alone.
- Return type:
- tests.test_prepare_release.test_freeze_plugin_manifest_version(tmp_path)[source]ΒΆ
The manifest a
git-subdirsource publishes names the new release.- Return type:
- tests.test_prepare_release.test_freeze_plugin_manifest_version_missing_file(tmp_path)[source]ΒΆ
A repository shipping no plugin is left alone.
- Return type:
- tests.test_prepare_release.test_post_release_leaves_the_plugin_manifest_version(tmp_path, temp_changelog, temp_citation, temp_workflows)[source]ΒΆ
The unfreeze must not walk the manifest back to a
.devNversion.This is why the version is written here rather than by bump-my-version, which runs on both release commits: the post-release bump would leave the published manifest advertising a
X.Y.Z.devNrelease that was never tagged.- Return type:
- tests.test_prepare_release.test_post_release_leaves_the_marketplace_pin(tmp_path, temp_changelog, temp_citation, temp_workflows)[source]ΒΆ
The unfreeze splits the entry: the ref tracks main, the version does not.
Pointing
refback at the default branch is what lets the appβsSync automaticallysee a change at all, since a tag never moves. Theversionbeside it keeps naming the last release rather than following the post-release bump, which would advertise aX.Y.Z.devNrelease nobody can install.- Return type:
- tests.test_prepare_release.test_freeze_unfreeze_round_trips_the_marketplace_ref(tmp_path)[source]ΒΆ
The ref returns to the default branch it started on, and the file with it.
- Return type:
- tests.test_prepare_release.test_prepare_release_freezes_install(temp_changelog, temp_citation, temp_workflows, temp_install)[source]ΒΆ
Test that
prepare_release(update_workflows=True)freezes install URLs.- Return type:
- tests.test_prepare_release.temp_install_pinned(tmp_path: Path) Path[source]ΒΆ
Create a temporary install guide with pinned CLI version examples.
- Return type:
- tests.test_prepare_release.test_freeze_install_cli_version(temp_install_pinned)[source]ΒΆ
Test that pinned
@and==CLI examples are bumped to the release.- Return type:
- tests.test_prepare_release.test_freeze_install_cli_version_leaves_other_pins(temp_install_pinned)[source]ΒΆ
Test that prefixed package names and git refs are left untouched.
- Return type:
- tests.test_prepare_release.test_freeze_install_cli_version_idempotent(temp_install_pinned)[source]ΒΆ
Test that re-freezing to the same version is a no-op.
- Return type:
- tests.test_prepare_release.test_freeze_install_cli_version_missing_file(tmp_path)[source]ΒΆ
Test that a missing install guide is handled gracefully.
- Return type:
- tests.test_prepare_release.test_prepare_release_pins_install_cli(temp_changelog, temp_citation, temp_install_pinned)[source]ΒΆ
Test that
prepare_release()pins CLI examples without workflows.- Return type:
- tests.test_prepare_release.YAMLLINT_LINE_LENGTH = 120ΒΆ
Column cap from the bundled
yamllint.yaml, mirrored here.Not imported from the YAML: this test asserts the frozen workflows satisfy the same rule the
lint-yamljob applies to the working tree, and reading the config would make the test pass by construction if the cap were ever loosened to accommodate a freeze that outgrew it.
- tests.test_prepare_release.test_freeze_keeps_workflows_within_line_length(tmp_path)[source]ΒΆ
Freezing the real workflows must not breach yamllintβs column cap.
The freeze swaps the local
uv runinvocation for the pin plus its cooldown exemption, which is markedly longer, and it is a blind string replacement: a line that fits onmaincan overflow only once frozen. Nothing else catches that, because the frozen state is never committed tomainand only exists on the release commit, where the failure would surface as a redlint-yamlon every release.- Return type:
- tests.test_prepare_release.test_freeze_exempts_self_pin_from_cooldown(tmp_path)[source]ΒΆ
Every frozen invocation carries the cooldown escape hatch.
Without it the workflow-wide
UV_EXCLUDE_NEWERwould refuse the pin the freeze just wrote, since it names a release published minutes earlier.- Return type: