Packaging, rtut check, tests CI job; schemas move into the package (RBT-WP-0009-T02)
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
6d3414d8b7
commit
e021fd979f
16 changed files with 163 additions and 10 deletions
|
|
@ -97,3 +97,24 @@ def test_ui_and_launch_arguments_parse(repo):
|
|||
from rtut.__main__ import main as m
|
||||
with pytest.raises(SystemExit):
|
||||
m(["ui", "--port", "not-a-port"])
|
||||
|
||||
|
||||
def test_check_validates_everything_declarative_and_reports_problems(repo, capsys):
|
||||
(repo / "runbooks/v1/pack.yaml").write_text((repo / "runbooks/v1/pack.yaml").read_text().replace("engine: native", "engine: nonsense"))
|
||||
code, out, _ = run(capsys, "check", repo)
|
||||
assert code == 1 and "FAIL rtut.showcase-lighthouse" in out and "ok rtut.showcase-lighthouse-v2" in out
|
||||
assert "attribute sets" in out and "ok harbour-defaults" in out and "templates" in out and "of" in out.splitlines()[-1]
|
||||
|
||||
|
||||
def test_check_passes_on_a_clean_repository_and_fails_on_an_empty_one(repo, capsys, tmp_path):
|
||||
code, out, _ = run(capsys, "check", repo)
|
||||
assert code == 0 and out.rstrip().endswith("4 of 4 ok") # two packs, one attribute set, one template
|
||||
empty = tmp_path / "empty"; empty.mkdir()
|
||||
code, _, err = run(capsys, "check", empty)
|
||||
assert code == 1 and "nothing to check" in err
|
||||
|
||||
|
||||
def test_the_schemas_ship_inside_the_package(repo):
|
||||
from rtut import pack, v2, attrs
|
||||
for path in (pack.SCHEMA_PATH, v2.SCHEMA_PATH, attrs.SCHEMA_DIR / "project.schema.json", attrs.SCHEMA_DIR / "attribute-set.schema.json"):
|
||||
assert path.exists() and "rtut/schema" in str(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue