test file added & mongo tested

This commit is contained in:
2025-01-14 17:01:33 +03:00
parent 5a23d41eef
commit 08b1815156
36 changed files with 2497 additions and 506 deletions

46
Ztest/Dockerfile Normal file
View File

@@ -0,0 +1,46 @@
# Use Python 3.9 as base image
FROM python:3.9-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
POETRY_VERSION=1.7.1 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_CREATE=false \
PYTHONPATH=/app
# Add Poetry to PATH
ENV PATH="$POETRY_HOME/bin:$PATH"
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
build-essential \
libpq-dev \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
# Set working directory
WORKDIR /app
# Copy project files
COPY pyproject.toml poetry.lock* ./
# Install dependencies
RUN poetry install --no-root --no-interaction --no-ansi
# Copy required directories
COPY Ztest/ ./Ztest/
COPY Services/ ./Services/
COPY AllConfigs/ ./AllConfigs/
COPY ApiLibrary/ ./ApiLibrary/
COPY ErrorHandlers/ ./ErrorHandlers/
# Set entrypoint for running tests
ENTRYPOINT ["poetry", "run", "pytest"]
CMD ["-v", "--cov=Services", "Ztest/"]