Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-camero committed Nov 25, 2024
1 parent d63fb01 commit 49f139c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,21 @@ def test_samples(self):
rlg.generate()
except UnsupportedAccessoryException as e:
print(f'Unsupported accessory: {e}. Skipping')
continue
except UnsupportedPlatformException as e:
print(f'Unsupported platform: {e}. Skipping')
continue
except Exception as e:
errors.append("Sample '%s' failed to load: '%s'" % (
sample,
e.args[0],
))
continue
# Try to Load Xacro
try:
xacro.process_file(os.path.join(os.path.dirname(dst), 'robot.urdf.xacro')).toxml()
except xacro.XacroException as e:
if 'stereolabs' in src and 'package not found' in e.args[0]:
if 'stereolabs' in sample and 'not found' in e.args[0]:
continue
errors.append("Sample '%s' xacro failed to load: '%s'" % (
sample,
Expand Down
6 changes: 6 additions & 0 deletions clearpath_generator_common/test/test_generator_vcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import shutil

from ament_index_python.packages import get_package_share_directory
from clearpath_config.common.types.exception import UnsupportedAccessoryException
from clearpath_config.common.types.exception import UnsupportedPlatformException
from clearpath_generator_common.vcan.generator import VirtualCANGenerator


Expand All @@ -49,6 +51,10 @@ def test_samples(self):
try:
rlg = VirtualCANGenerator(os.path.dirname(dst))
rlg.generate()
except UnsupportedAccessoryException as e:
print(f'Unsupported accessory: {e}. Skipping')
except UnsupportedPlatformException as e:
print(f'Unsupported platform: {e}. Skipping')
except Exception as e:
errors.append("Sample '%s' failed to load: '%s'" % (
sample,
Expand Down

0 comments on commit 49f139c

Please sign in to comment.