mirror of
https://github.com/azaion/detections.git
synced 2026-06-21 05:41:07 +00:00
Fixed tests
This commit is contained in:
@@ -7,6 +7,7 @@ COPY . .
|
||||
RUN python setup.py build_ext --inplace
|
||||
ENV PYTHONPATH=/app/src
|
||||
RUN adduser --disabled-password --no-create-home --gecos "" appuser \
|
||||
&& mkdir -p /app/Logs \
|
||||
&& chown -R appuser /app
|
||||
USER appuser
|
||||
EXPOSE 8080
|
||||
|
||||
@@ -7,6 +7,7 @@ COPY . .
|
||||
RUN python3 setup.py build_ext --inplace
|
||||
ENV PYTHONPATH=/app/src
|
||||
RUN adduser --disabled-password --no-create-home --gecos "" appuser \
|
||||
&& mkdir -p /app/Logs \
|
||||
&& chown -R appuser /app
|
||||
USER appuser
|
||||
EXPOSE 8080
|
||||
|
||||
@@ -16,6 +16,7 @@ COPY . .
|
||||
RUN BUILD_TENSORRT_EXTENSIONS=1 python3 setup.py build_ext --inplace
|
||||
ENV PYTHONPATH=/app/src
|
||||
RUN adduser --disabled-password --no-create-home --gecos "" appuser \
|
||||
&& mkdir -p /app/Logs \
|
||||
&& chown -R appuser /app
|
||||
USER appuser
|
||||
EXPOSE 8080
|
||||
|
||||
@@ -3,4 +3,5 @@ WORKDIR /app
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY . .
|
||||
RUN mkdir -p /app/Logs && chmod 0777 /app/Logs
|
||||
CMD ["pytest", "--csv=/results/report.csv", "-v"]
|
||||
|
||||
@@ -238,6 +238,15 @@ def image_empty_scene():
|
||||
return _read_media("image_empty_scene.jpg")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def image_dense():
|
||||
for name in ("image_dense.jpg", "image_dense01.jpg", "image_dense02.jpg"):
|
||||
p = _media_dir() / name
|
||||
if p.is_file():
|
||||
return p.read_bytes()
|
||||
pytest.skip("missing dense image fixture")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def video_short_path():
|
||||
return str(_media_dir() / "video_test01.mp4")
|
||||
|
||||
@@ -29,7 +29,7 @@ services:
|
||||
CLASSES_JSON_PATH: /app/classes.json
|
||||
volumes:
|
||||
- ./fixtures:/media
|
||||
- ./logs:/app/Logs
|
||||
- detections-logs:/app/Logs
|
||||
shm_size: 512m
|
||||
mem_limit: 4g
|
||||
networks:
|
||||
@@ -52,7 +52,7 @@ services:
|
||||
CLASSES_JSON_PATH: /app/classes.json
|
||||
volumes:
|
||||
- ./fixtures:/media
|
||||
- ./logs:/app/Logs
|
||||
- detections-logs:/app/Logs
|
||||
networks:
|
||||
e2e-net:
|
||||
aliases:
|
||||
@@ -75,6 +75,7 @@ services:
|
||||
CLASSES_JSON_PATH: /app/classes.json
|
||||
volumes:
|
||||
- ./fixtures:/media:ro
|
||||
- detections-logs:/app/Logs
|
||||
shm_size: 512m
|
||||
networks:
|
||||
e2e-net:
|
||||
@@ -92,10 +93,11 @@ services:
|
||||
- mock-annotations
|
||||
environment:
|
||||
JWT_SECRET: test-secret-e2e-only
|
||||
MEDIA_DIR: /app/fixtures
|
||||
MEDIA_DIR: /media
|
||||
volumes:
|
||||
- ./fixtures:/media
|
||||
- ./results:/results
|
||||
- detections-logs:/app/Logs
|
||||
networks:
|
||||
- e2e-net
|
||||
command: ["pytest", "--csv=/results/report.csv", "-v"]
|
||||
@@ -103,3 +105,6 @@ services:
|
||||
networks:
|
||||
e2e-net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
detections-logs:
|
||||
|
||||
@@ -59,7 +59,7 @@ def test_ft_p09_sse_event_delivery(
|
||||
data = json.loads(event.data)
|
||||
collected.append(data)
|
||||
first_event.set()
|
||||
if len(collected) >= 5:
|
||||
if data.get("mediaStatus") in ("AIProcessed", "Error"):
|
||||
break
|
||||
except BaseException as e:
|
||||
thread_exc.append(e)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
import uuid
|
||||
@@ -7,7 +8,9 @@ from pathlib import Path
|
||||
import pytest
|
||||
import sseclient
|
||||
|
||||
FIXTURES_DIR = Path(__file__).resolve().parent.parent / "fixtures"
|
||||
FIXTURES_DIR = Path(
|
||||
os.environ.get("MEDIA_DIR", Path(__file__).resolve().parent.parent / "fixtures")
|
||||
)
|
||||
_VIDEO = str(FIXTURES_DIR / "video_test01.mp4")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user