Skip to content

Commit

Permalink
run_all.py script fixes (#2519)
Browse files Browse the repository at this point in the history
* no longer getting stuck on face tracking
* fix failing saving on examples that can't do so
* fix not showing what example is run before running it

Fixes #2481

After these changes I can now run `python ./scripts/run_all.py --save`
on my machine successfully.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)

<!-- This line will get updated when the PR build summary job finishes.
-->
PR Build Summary: https://build.rerun.io/pr/2519

<!-- pr-link-docs:start -->
Docs preview: https://rerun.io/preview/728de20/docs
Examples preview: https://rerun.io/preview/728de20/examples
<!-- pr-link-docs:end -->
  • Loading branch information
Wumpf authored and emilk committed Jun 29, 2023
1 parent 4df5fb6 commit 0304410
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions scripts/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
EXTRA_ARGS = {
"examples/python/clock": ["--steps=200"], # Make it faster
"examples/python/live_camera_edge_detection": ["--num-frames=30"], # Make sure it finishes
"examples/python/face_tracking": ["--max-frame=30"], # Make sure it finishes
}

HAS_NO_SAVE_ARG = {
"examples/python/multiprocessing",
"examples/python/minimal",
"examples/python/dna",
"examples/python/blueprint",
}


Expand Down Expand Up @@ -45,6 +53,9 @@ def run_py_example(path: str, viewer_port: int | None = None, wait: bool = True,
if viewer_port is not None:
args += ["--connect", f"--addr=127.0.0.1:{viewer_port}"]

cmd = " ".join(f'"{a}"' if " " in a else a for a in args)
print(f"Running example '{path}' via '{cmd}'")

return start_process(
args,
cwd=path,
Expand Down Expand Up @@ -204,8 +215,9 @@ def run_web(examples: list[str], separate: bool) -> None:

def run_save(examples: list[str]) -> None:
for path in examples:
example = run_py_example(path, save="out.rrd")
print_example_output(path, example)
if path not in HAS_NO_SAVE_ARG:
example = run_py_example(path, save="out.rrd")
print_example_output(path, example)


def run_load(examples: list[str], separate: bool, close: bool) -> None:
Expand Down

0 comments on commit 0304410

Please sign in to comment.