Retire exercise_status: maturity is the only notion; add CLI tests (RBT-WP-0009-T01)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: sonnet Assistant-Process: 295952@bnt-lap001 Assistant-Session: e93f64ad-516c-46eb-9666-aad8d300c477
This commit is contained in:
parent
b89e8eaa74
commit
6d3414d8b7
29 changed files with 444 additions and 218 deletions
|
|
@ -29,8 +29,6 @@ def mut(fn):
|
|||
|
||||
|
||||
@pytest.mark.parametrize("fn,frag", [
|
||||
(lambda d: d.pop("exercise_status"), "exercise_status"),
|
||||
(lambda d: d.update(exercise_status="done"), "exercise_status"),
|
||||
(lambda d: d["parameters"][0].update(secret=True), "secret"),
|
||||
(lambda d: d["steps"][0].pop("verify"), "verify"),
|
||||
(lambda d: d["steps"][0].update(command="x {{nope}}"), "undefined placeholder"),
|
||||
|
|
@ -49,7 +47,7 @@ def test_invalid(tmp_path, fn, frag):
|
|||
|
||||
def test_legacy_requires_command(tmp_path):
|
||||
d = {"spec": "runbook-pack/v0.1", "id": "x.y", "title": "Legacy x", "owner": "o",
|
||||
"exercise_status": "unexercised", "engine": "legacy-command"}
|
||||
"engine": "legacy-command"}
|
||||
assert not check(tmp_path, d).ok
|
||||
d["legacy"] = {"command": ["true"]}
|
||||
assert check(tmp_path, d).ok
|
||||
|
|
@ -74,3 +72,13 @@ def test_text_parameter_allows_spaces_but_not_metacharacters():
|
|||
with pytest.raises(ValueError):
|
||||
P.render(d["steps"][0]["command"], {"host": "two words"}, pk)
|
||||
|
||||
|
||||
|
||||
def test_the_deprecated_exercise_status_is_accepted_and_ignored_so_old_packs_still_load(tmp_path):
|
||||
d = copy.deepcopy(GOOD)
|
||||
d["exercise_status"] = "exercised 2026-01-01 by someone"
|
||||
assert check(tmp_path, d).ok
|
||||
d["exercise_status"] = "whatever text" # deprecated: not validated, not used
|
||||
assert check(tmp_path, d).ok
|
||||
d.pop("exercise_status")
|
||||
assert check(tmp_path, d).ok # and it is not required any more
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue