feat: bring rvctool up to date with rtbtool/mvtbtool, add --test smoke test - #33
Merged
Merged
Conversation
…e test
Catches rvctool up to feature parity with its siblings, and adds the
smoke-test capability requested for it specifically (RTB/MVTB's own
CLI tools get their smoke tests in their own repos):
- New --test flag + run_smoke_test(): prints real package versions,
then one real functional check per toolbox (RTB fkine, MVTB
Image.smooth, spatialgeometry Cuboid, spatialmath SE3 composition,
Open3D PointCloud, and bdsim -- running vloop_test.py's block
diagram non-interactively). Missing optional deps (Open3D) are
reported as FAIL with reason, not silently skipped. Mirrors
mvtbtool's own --test design.
- New tests/test_bin.py, mirroring MVTB's tests/test_bin.py pattern:
subprocess-invokes `rvctool --help`/`--test`, asserts exit codes and
expected PASS/FAIL output.
- New RVC3/bin/_bintools.py: line-wrapping argparse help formatter,
RVC3's own copy of the same private helper RTB/MVTB each keep in
their own bin/ package.
- New RVCTOOL_OPTIONS env var (RVCTOOL kept for backward compat, now
prints a deprecation warning when used).
- New --torch and --reload flags, matching mvtbtool/rtbtool.
- Version banner rewritten: wrapped multi-line (was a single unwrapped
line), now includes bdsim and Open3D ("not installed" if missing)
alongside RTB/MVTB/SG/SMTB/NumPy/SciPy/Matplotlib. Fixes a bug where
SG's line reported spatialmath-python's version twice instead of
spatialgeometry's own.
- IPython/pygments/traitlets imports guarded with a friendly install
message instead of a hard top-level import failure.
- Fixed the %precision startup line spuriously auto-displaying its own
return value (e.g. bare `Out[]: '%.3g;'` printed before the first
real prompt) -- same class of bug also just fixed upstream in
rtbtool and mvtbtool.
- Suppressed IPython's own generic startup banner (Python/IPython
version, tips) since rvctool already prints its own richer one;
having both stacked was redundant and visually confusing.
- Fixed a real bug surfaced live while testing: `exec("from
spatialgeometry import *", globs)` injects SG's exported names
directly into the module's own globals(), including a class also
named `Path` -- silently shadowing `pathlib.Path` for the rest of
the function. Switched all internal path handling to explicit
`pathlib.Path` so it can't be shadowed by a wildcard import.
- mvb import alias fixed to match what the banner actually advertises
(was bound as `mvbase` in code but `mvb` in the printed banner text).
- README: documented `rvctool --test` as a post-install sanity check.
display_banner is now unconditionally False (rvctool prints its own richer banner instead), so these two lines no longer appear in real output -- remove them rather than leave a stale line in the example.
…nd-smoke-tests # Conflicts: # README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Catches
rvctoolup to feature parity with its siblings (rtbtool/mvtbtool), and adds the smoke-test capability requested for it specifically:--testflag +run_smoke_test(): prints real package versions, then one real functional check per toolbox (RTBfkine, MVTBImage.smooth, spatialgeometryCuboid, spatialmathSE3composition, Open3DPointCloud, and bdsim -- runningvloop_test.py's block diagram non-interactively). Missing optional deps (Open3D) are reported as FAIL with reason, not silently skipped. Mirrors mvtbtool's own--testdesign.tests/test_bin.py, mirroring MVTB'stests/test_bin.pypattern: subprocess-invokesrvctool --help/--test, asserts exit codes and expected PASS/FAIL output.RVC3/bin/_bintools.py: line-wrapping argparse help formatter, RVC3's own copy of the same private helper RTB/MVTB each keep in their ownbin/package.RVCTOOL_OPTIONSenv var (RVCTOOLkept for backward compat, now prints a deprecation warning when used).--torchand--reloadflags, matching mvtbtool/rtbtool.%precisionstartup line spuriously auto-displaying its own return value (bareOut[]: '%.3g;'printed before the first real prompt) -- same class of bug also just fixed upstream in rtbtool (fix: rtbtool's %precision line spuriously echoes its own return value robotics-toolbox-python#592) and mvtbtool (fix: mvtbtool's %precision line spuriously echoes with --showassign machinevision-toolbox-python#79).exec("from spatialgeometry import *", globs)injects SG's exported names directly into the module's ownglobals(), including a class also namedPath-- silently shadowingpathlib.Pathfor the rest of the function. Switched all internal path handling to explicitpathlib.Pathso it can't be shadowed by a wildcard import.mvbimport alias fixed to match what the banner actually advertises (was bound asmvbasein code butmvbin the printed banner text).rvctool --testas a post-install sanity check, and updated the example transcript to match (removed IPython's now-suppressed native banner lines).Test plan
rvctool --help-- exits 0, well-formattedrvctool --test-- reports PASS/FAIL per toolbox, exits 1 when Open3D genuinely missingrvctool(default interactive startup) -- confirmed clean banner, no double-banner, no spurious echo, verified livepython -m unittest tests.test_bin-- 2 passed