Remove the custom example release check
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""Check Promptkit's launcher and release profile using a disposable local remote.
|
||||
|
||||
ReleaseKit owns the detailed publication, validation, and delivery algorithms.
|
||||
These fixtures protect this repository's tool selection and product-check wiring.
|
||||
These fixtures protect this repository's launcher and release-profile wiring.
|
||||
"""
|
||||
|
||||
import json
|
||||
@@ -56,18 +56,7 @@ def prepare_fixture(root, environment, module_bytes):
|
||||
shutil.copy2(REPOSITORY_ROOT / "scripts" / name, destination)
|
||||
shutil.copy2(REPOSITORY_ROOT / "releasekit.json", repository / "releasekit.json")
|
||||
shutil.copy2(REPOSITORY_ROOT / ".gitignore", repository / ".gitignore")
|
||||
for version in (RELEASE_VERSION, FAILED_VERSION):
|
||||
write(repository / f"docs/releases/{version}.md", f"# Promptkit {version}\n\nFixture.\n")
|
||||
write(repository / "scripts/check-examples.py", """
|
||||
import os
|
||||
import sys
|
||||
|
||||
with open(os.environ["FIXTURE_CHECK_MARKER"], "a") as marker:
|
||||
marker.write("called\\n")
|
||||
if os.environ.get("FIXTURE_CHECK_FAILURE"):
|
||||
print("fixture example check rejected candidate", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
""")
|
||||
write(repository / f"docs/releases/{RELEASE_VERSION}.md", f"# Promptkit {RELEASE_VERSION}\n\nFixture.\n")
|
||||
write(repository / "fixture_test.go", """
|
||||
package fixture
|
||||
|
||||
@@ -127,14 +116,10 @@ def verify_publication(repository, remote, root, environment, profile, selected_
|
||||
if git(remote, environment, "rev-parse", f"refs/tags/{RELEASE_VERSION}^{{}}") != candidate:
|
||||
raise RuntimeError("launcher did not publish the intended candidate")
|
||||
suite = Path(environment["FIXTURE_SUITE_MARKER"]).read_text().splitlines()
|
||||
checks = Path(environment["FIXTURE_CHECK_MARKER"]).read_text().splitlines()
|
||||
if suite != [selected_go] or checks != ["called"]:
|
||||
raise RuntimeError(f"profile did not run the selected suite/check: {suite}, {checks}")
|
||||
if suite != [selected_go]:
|
||||
raise RuntimeError(f"profile did not run the selected suite: {suite}")
|
||||
|
||||
failed_environment = dict(environment, FIXTURE_CHECK_FAILURE="1")
|
||||
run([publication, FAILED_VERSION], root, failed_environment, status=1)
|
||||
if Path(environment["FIXTURE_CHECK_MARKER"]).read_text().splitlines() != ["called", "called"]:
|
||||
raise RuntimeError("failure scenario did not exercise the product check")
|
||||
run([publication, FAILED_VERSION], root, environment, status=1)
|
||||
run(
|
||||
["git", "-C", str(remote), "show-ref", "--verify", "--quiet", f"refs/tags/{FAILED_VERSION}"],
|
||||
root, environment, status=1,
|
||||
@@ -153,14 +138,12 @@ def main():
|
||||
GOPROXY="off", GONOPROXY="none", GOSUMDB="off")
|
||||
profile = json.loads((REPOSITORY_ROOT / "releasekit.json").read_text())
|
||||
environment.pop(profile["delivery"].get("token_env", "RELEASEKIT_GITEA_TOKEN"), None)
|
||||
environment.pop("FIXTURE_CHECK_FAILURE", None)
|
||||
module_bytes = {name: (REPOSITORY_ROOT / name).read_bytes() for name in ("go.mod", "go.sum")}
|
||||
try:
|
||||
selected_go = run(["go", "env", "GOVERSION"], REPOSITORY_ROOT, environment).strip()
|
||||
with tempfile.TemporaryDirectory(prefix="promptkit-release-fixture-") as directory:
|
||||
root = Path(directory)
|
||||
environment.update(FIXTURE_CHECK_MARKER=str(root / "checks"),
|
||||
FIXTURE_SUITE_MARKER=str(root / "suite"))
|
||||
environment.update(FIXTURE_SUITE_MARKER=str(root / "suite"))
|
||||
repository, remote = prepare_fixture(root, environment, module_bytes)
|
||||
verify_bootstrap(repository, root, environment, selected_go)
|
||||
verify_publication(repository, remote, root, environment, profile, selected_go)
|
||||
|
||||
Reference in New Issue
Block a user