Files
detections/e2e/tests/test_resource_limits.py
T
Oleksandr Bezdieniezhnykh 5a968edcba Update .gitignore and refine documentation for execution environment
- Added Cython generated files to .gitignore to prevent unnecessary tracking.
- Updated paths in `inference.c` and `coreml_engine.c` to reflect the correct virtual environment.
- Revised the execution environment documentation to clarify hardware dependency checks and local execution instructions, ensuring accurate guidance for users.
- Removed outdated Docker suitability checks and streamlined the assessment process for test execution environments.
2026-03-30 00:53:46 +03:00

44 lines
1.2 KiB
Python

import re
from datetime import datetime
from pathlib import Path
import pytest
@pytest.mark.slow
@pytest.mark.timeout(120)
def test_nft_res_lim_03_max_detections_per_frame(
warm_engine, http_client, image_dense
):
r = http_client.post(
"/detect",
files={"file": ("img.jpg", image_dense, "image/jpeg")},
timeout=120,
)
assert r.status_code == 200
body = r.json()
assert isinstance(body, list)
assert len(body) <= 300
@pytest.mark.slow
def test_nft_res_lim_04_log_file_rotation(warm_engine, http_client, image_small):
http_client.post(
"/detect",
files={"file": ("img.jpg", image_small, "image/jpeg")},
timeout=60,
)
candidates = [
Path(__file__).resolve().parent.parent / "logs",
Path("/app/Logs"),
]
log_dir = next((p for p in candidates if p.is_dir()), None)
if log_dir is None:
pytest.skip("Log directory not accessible from e2e-runner container")
today = datetime.now().strftime("%Y%m%d")
expected = f"log_inference_{today}.txt"
names = {p.name for p in log_dir.iterdir() if p.is_file()}
if expected not in names:
pat = re.compile(r"^log_inference_\d{8}\.txt$")
assert any(pat.match(n) for n in names), names