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
5 changes: 3 additions & 2 deletions unit-tests/live/metadata/test-usb-type-found.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# Copyright(c) 2023 RealSense, Inc. All Rights Reserved.


#test:device each(D400*) !D457
#test:device each(D500*) !D555
#test:device each(D400*)
#test:device each(D500*)
#test:type USB


import pyrealsense2 as rs
Expand Down
4 changes: 4 additions & 0 deletions unit-tests/py/rspy/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def name( self ):
def product_line( self ):
return self._product_line

@property
def connection_type( self ):
return self._connection_type

@property
def physical_port( self ):
return self._physical_port
Expand Down
7 changes: 7 additions & 0 deletions unit-tests/py/rspy/libci.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __init__( self, context ):
self._configurations = list()
self._priority = 1000
self._tags = set()
self._types = set() # usage: test:type <type> or test:type !<type>
self._flags = set()
self._timeout = 200
self._retries = 0
Expand Down Expand Up @@ -130,6 +131,10 @@ def retries( self ):
def tags( self ):
return self._tags

@property
def types( self ):
return self._types

@property
def flags( self ):
return self._flags
Expand Down Expand Up @@ -239,6 +244,8 @@ def derive_config_from_text( self, source, line_prefix ):
params )
elif directive == 'tag':
self._tags.update( map( str.lower, params )) # tags are case-insensitive
elif directive == 'type':
self._types.update( map( str.lower, params ))
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The type directive lacks consistency with the tag directive comment on line 246. Consider adding a similar inline comment explaining that types are case-insensitive, matching the pattern established for tags.

Suggested change
self._types.update( map( str.lower, params ))
self._types.update( map( str.lower, params )) # types are case-insensitive

Copilot uses AI. Check for mistakes.
elif directive == 'flag':
self._flags.update( params )
elif directive == 'donotrun':
Expand Down
20 changes: 20 additions & 0 deletions unit-tests/run-unit-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,26 @@ def close_hubs():
#
test_ok = True
for configuration, serial_numbers in devices_by_test_config( test, exceptions ):
# Currently, with all of our tests, serial_numbers holds a single serial number
# We will see multiple devices on serial_numbers only if the test specifies multiple devices in a
# single line. For example: "test:device D435 D455" will require both devices simultaneity
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'simultaneity' to 'simultaneously'.

Suggested change
# single line. For example: "test:device D435 D455" will require both devices simultaneity
# single line. For example: "test:device D435 D455" will require both devices simultaneously

Copilot uses AI. Check for mistakes.

skip_test = False
for sn in serial_numbers:
conn_type = devices.get(sn).connection_type.lower()
excluded_connections = [ t[1:].lower() for t in test.config.types if t.startswith('!') ]
required_connections = [ t.lower() for t in test.config.types if not t.startswith('!') ]
if conn_type in excluded_connections:
skip_test = True
break
if required_connections and conn_type not in required_connections:
skip_test = True
break

if skip_test:
log.d( f'connection type does not fit {test.config.types}; skipping' )
continue

for repetition in range(repeat):
try:
log.d( 'configuration:', configuration_str( configuration, repetition, sns=serial_numbers ) )
Expand Down
Loading