Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/nullius/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def steps(self) -> List[dict]:
return [p for p in self.parts if p.get("script")] or [{"id": "run", "label": "the run", "script": self.script}]

def check(self) -> Optional[str]:
if not _NAME.match(self.name):
if not _NAME.fullmatch(self.name):
return "the run needs a name: letters, digits, dots, dashes"
if not self.script.strip() and not any(p.get("script") for p in self.parts):
return "nothing to run"
Expand Down
11 changes: 11 additions & 0 deletions app/tests/test_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@
from tests.execution_support import Base, HostBase, LocalHost, gone


class PlanValidation(unittest.TestCase):
def test_run_names_must_match_in_full(self):
for name in ("nightly", "run_1.2-3", "a" * 80):
with self.subTest(name=name):
self.assertIsNone(execution.Plan(name=name, script="true").check())
for name in ("nightly\n", "nightly\r\n", "night ly", "", "a" * 81):
with self.subTest(name=name):
self.assertEqual(execution.Plan(name=name, script="true").check(),
"the run needs a name: letters, digits, dots, dashes")


class Here(Base):
"""Local runs are real: bash, setsid, the exit file, the log."""

Expand Down