Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove pyrealsense2 dependancy and run test only on linux
  • Loading branch information
ArthurRaizIntel committed Jul 27, 2025
commit 0c5509fa0df527f8c346aecad30eb6b4850ab970
14 changes: 14 additions & 0 deletions unit-tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fastapi==0.115.12
uvicorn==0.34.0
pydantic==2.10.6
aiortc==1.11.0
opencv-python==4.11.0.86
numpy==2.2.4
python-socketio==5.13.0
pytest==8.3.5
pytest-asyncio==0.26.0
typeguard==4.4.4
jinja2==3.1.6
pyyaml==6.0.2
lark==1.2.2
httpx==0.28.1
39 changes: 39 additions & 0 deletions unit-tests/wrappers/test-rest-api-wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#test:device D455
#test:donotrun:!linux

import pyrealsense2 as rs
from rspy import log, repo, test
from rspy.stopwatch import Stopwatch

#############################################################################################
#
test.start( "Run test-rest-api-wrapper test" )
import subprocess
run_time_stopwatch = Stopwatch()
run_time_threshold = 3
p = subprocess.run( ["pytest", "../wrappers/rest-api/tests/test_api_service.py"],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
timeout=10,
check=False ) # don't fail on errors

# Print failure information if subprocess failed
if p.returncode != 0:
log.e(f"Subprocess failed with return code: {p.returncode}")
if p.stdout:
log.e("Subprocess output:")
log.e(p.stdout)

test.check(p.returncode == 0) # verify success return code
run_time_seconds = run_time_stopwatch.get_elapsed()
if run_time_seconds > run_time_threshold:
log.e('Time elapsed too high!', run_time_seconds, ' > ', run_time_threshold)
log.d("rs-enumerate-devices completed in:", run_time_seconds, "seconds")
test.check(run_time_seconds < run_time_threshold)
run_time_stopwatch.reset()

test.finish()
#
#############################################################################################
test.print_results_and_exit()
Loading