Skip to content
Open
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
12 changes: 12 additions & 0 deletions tests/test_progress_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,18 @@ def test_invalid_test_filter_is_an_argument_error(self):
self.assertNotIn(b"Traceback", result.stderr)
self.assertFalse(os.path.exists(out))

def test_tests_without_run_tests_is_an_argument_error(self):
with tempfile.TemporaryDirectory() as tmp:
out = os.path.join(tmp, "out")
for regex in ("test_boot_trace", "["):
with self.subTest(regex=regex):
result = subprocess.run([sys.executable, "-I", TOOL, "--out", out, "--tests", regex],
capture_output=True, cwd=ROOT, timeout=120)
self.assertEqual(result.returncode, 2, result.stderr.decode("utf-8", "replace"))
self.assertIn(b"--tests requires --run-tests", result.stderr)
self.assertNotIn(b"Traceback", result.stderr)
self.assertFalse(os.path.exists(out))

def test_out_inside_the_repository_is_refused(self):
r = subprocess.run([sys.executable, "-I", TOOL, "--out", os.path.join(ROOT, "progress_out_test")],
capture_output=True, cwd=ROOT, timeout=120)
Expand Down
5 changes: 4 additions & 1 deletion tools/progress_dashboard.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Progress dashboard: what works, what changed and what blocks next, from outcomes the project already produces.

python -I tools/progress_dashboard.py --out <folder outside the repository> [--work <work>] [--run-tests]
[--ctest-junit FILE] [--junit FILE ...] [--github] [--login NAME]
[--tests REGEX] [--ctest-junit FILE] [--junit FILE ...] [--github]
[--login NAME]

Writes, into --out only (a folder inside the repository is refused, so nothing here can be committed by accident):
progress.html one self-contained page (no network, no packages; open it from disk)
Expand Down Expand Up @@ -1062,6 +1063,8 @@ def main(argv=None):
ap.error("--jobs must be a positive integer")
if args.test_timeout < 1:
ap.error("--test-timeout must be a positive integer")
if args.tests is not None and not args.run_tests:
ap.error("--tests requires --run-tests")
if args.run_tests and args.tests:
try:
args.tests = re.compile(args.tests)
Expand Down