Skip to content

Commit

Permalink
review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bstrzele committed May 23, 2024
1 parent 2bdf51e commit 327d90a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Installing and running tests
```bash
pip install -r requirements
pip install -r requirements.txt
pytest
```

Expand All @@ -11,12 +11,8 @@ Running tests with gpu
pytest --gpu
```

Run tests without re-downloading models
Run tests while caching downloaded models
```bash
pytest --model-cache ./cache
```

All subsequent runs could be made using
```bash
pytest --model-cache ./cache --skip-download
```
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

def pytest_addoption(parser):
parser.addoption("--gpu", action="store_true")
parser.addoption("--skip-download", action="store_true")
parser.addoption("--model-cache", action="store")
parser.addoption("--image", action="store")

def pytest_configure(config):
config.addinivalue_line(
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def triton_server(model_repository, request):
except socket.error as e:
if e.errno != errno.EADDRINUSE:
raise Exception(f"Not expected exception found in port manager: {e.errno}")
image_name = os.environ.get("TIS_IMAGE_NAME")
image_name = request.config.getoption("--image")
image_name = image_name if image_name is not None else "tritonserver:latest"
gpu = '--device /dev/dri --group-add=$(stat -c "%g" /dev/dri/render* )' if request.config.getoption("--gpu") else ""
subprocess.run(
Expand Down Expand Up @@ -55,7 +55,7 @@ def model_cache(request):
cache = dir.name
else:
cache = input_dir
if not request.config.getoption("--skip-download"):
if os.listdir(cache) == []:
for model in models:
MODEL_CONFIG[model]["fetch"](model, cache)
yield cache
Expand Down

0 comments on commit 327d90a

Please sign in to comment.