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
create rest api wrapper test runner
  • Loading branch information
ArthurRaizIntel committed Jul 27, 2025
commit 1db60e2b8d57f21ea717c87dbc4f04da1d326542
1 change: 0 additions & 1 deletion scripts/ubuntu-jammy
Submodule ubuntu-jammy deleted from 71c67c
1 change: 0 additions & 1 deletion ubuntu-jammy
Submodule ubuntu-jammy deleted from 71c67c
38 changes: 38 additions & 0 deletions unit-tests/live/wrappers/test-rest-api-wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#test:device D455

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")
Comment thread
ArthurRaizIntel marked this conversation as resolved.
Outdated
test.check(run_time_seconds < run_time_threshold)
run_time_stopwatch.reset()

test.finish()
#
#############################################################################################
test.print_results_and_exit()
4 changes: 2 additions & 2 deletions wrappers/rest-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ It simplifies remote control and data streaming from RealSense devices by handli
```bash
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
jinja2==3.1.6
typeguard==4.4.4
```
2 changes: 1 addition & 1 deletion wrappers/rest-api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fastapi==0.115.12
uvicorn==0.34.0
pydantic==2.10.6
pyrealsense2==2.55.1.6486
pyrealsense2==2.56.4.9191
aiortc==1.11.0
opencv-python==4.11.0.86
numpy==2.2.4
Expand Down