Answer principles round 1: 1 🔴, 7 🟡 (0 misread); every effect is handed in as an argument, no test patches a global, and the traces principle scopes tools that run on their user's machine
CI / tests (pull_request) Successful in 3m43s
CI / tests (pull_request) Successful in 3m43s
This commit is contained in:
@@ -13,8 +13,12 @@ It reads three environment variables and fails, naming each that is missing:
|
||||
{chr(10).join(f' {name}: {meaning}' for name, meaning in settings.MEANING.items())}
|
||||
It prints a line per check, and exits 0 only where every check held."""
|
||||
|
||||
EpicMade = typing.Callable[[settings.Sandbox, str], typing.ContextManager[str | Failure]]
|
||||
Run = typing.Callable[[settings.Sandbox, str, pathlib.Path, typing.Mapping[str, str]], scenario.Report]
|
||||
|
||||
def main(argv: list[str], env: typing.Mapping[str, str], launcher: pathlib.Path) -> int:
|
||||
|
||||
def main(argv: list[str], env: typing.Mapping[str, str], launcher: pathlib.Path, epic_made: EpicMade, run: Run) -> int:
|
||||
"""Runs do-epic-e2e: epic_made makes the sandbox epic, as sandbox.epic_made does, and run drives do-epic against it, as scenario.run does."""
|
||||
if argv:
|
||||
print(HELP, file=sys.stdout if argv in (["-h"], ["--help"]) else sys.stderr)
|
||||
return 0 if argv in (["-h"], ["--help"]) else 1
|
||||
@@ -25,12 +29,12 @@ def main(argv: list[str], env: typing.Mapping[str, str], launcher: pathlib.Path)
|
||||
report = scenario.Report()
|
||||
left: sandbox.Leftover | None = None
|
||||
try:
|
||||
with sandbox.epic_made(found, "do-epic e2e sandbox epic") as key:
|
||||
with epic_made(found, "do-epic e2e sandbox epic") as key:
|
||||
if isinstance(key, Failure):
|
||||
print(f"do-epic-e2e: {key.reason}", file=sys.stderr)
|
||||
return 1
|
||||
print(f"Sandbox epic {key} in {found.jira_url}")
|
||||
report = scenario.run(found, key, launcher, env)
|
||||
report = run(found, key, launcher, env)
|
||||
except sandbox.Leftover as failure:
|
||||
left = failure
|
||||
# The checks are printed even where the epic could not be deleted.
|
||||
|
||||
Reference in New Issue
Block a user