test: add pytest suite and gate Docker builds on it
Unit tests cover the SQL gate, broadcast codec, Hive writer layout, and flight kinematics. CI runs pytest first; the simulator image build runs tests in a dedicated stage before the final layer.
This commit is contained in:
@@ -1,9 +1,24 @@
|
||||
FROM python:3.12-slim AS test
|
||||
|
||||
WORKDIR /app
|
||||
COPY requirements.txt .
|
||||
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt pytest
|
||||
COPY virtual_drone ./virtual_drone
|
||||
COPY monitoring ./monitoring
|
||||
COPY explorer ./explorer
|
||||
COPY tests ./tests
|
||||
RUN pytest tests/ -q
|
||||
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
COPY requirements.txt .
|
||||
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
|
||||
COPY virtual_drone ./virtual_drone
|
||||
# Monitoring and explorer ship in the same image so Kubernetes can run
|
||||
# them without bind mounts (Compose overrides these with live mounts)
|
||||
COPY monitoring ./monitoring
|
||||
COPY explorer ./explorer
|
||||
|
||||
ENV DATA_DIR=/data
|
||||
CMD ["python", "-m", "virtual_drone.main"]
|
||||
|
||||
Reference in New Issue
Block a user