pull/700/head
Patrick Devaney 7 days ago
parent bf0e503161
commit 875a4d621b

@ -46,7 +46,7 @@ jobs:
-e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \ -e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \
-v ${{ github.workspace }}/logs:/usr/src/app/logs \ -v ${{ github.workspace }}/logs:/usr/src/app/logs \
${{ env.IMAGE_TAG }} \ ${{ env.IMAGE_TAG }} \
/usr/src/app/tests --continue-on-collection-errors --tb=short --disable-warnings | tee ${{ github.workspace }}/logs/test_logs.txt /usr/src/app/tests | tee ${{ github.workspace }}/logs/test_logs.txt
- name: Print test logs - name: Print test logs
run: cat ${{ github.workspace }}/logs/test_logs.txt || echo "No test logs found" run: cat ${{ github.workspace }}/logs/test_logs.txt || echo "No test logs found"

@ -14,16 +14,16 @@ WORKDIR /usr/src/app
# Copy the entire project into the container # Copy the entire project into the container
COPY . . COPY . .
# Install system dependencies # Install system dependencies and clean up
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
git \ git \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install Poetry and dependencies # Install Poetry and pytest
RUN pip install --no-cache-dir poetry pytest RUN pip install --no-cache-dir poetry pytest
# Install project dependencies # Configure Poetry and install project dependencies
RUN poetry config virtualenvs.create false && \ RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi poetry install --no-interaction --no-ansi
@ -32,8 +32,12 @@ RUN mkdir -p /usr/src/app/logs && chmod -R 777 /usr/src/app/logs
# Add pytest to PATH and verify installation # Add pytest to PATH and verify installation
ENV PATH="/usr/local/bin:/root/.local/bin:$PATH" ENV PATH="/usr/local/bin:/root/.local/bin:$PATH"
# Verify pytest installation
RUN python -m pytest --version RUN python -m pytest --version
# Set the default command # Set the ENTRYPOINT to use pytest
ENTRYPOINT ["pytest"] ENTRYPOINT ["python", "-m", "pytest"]
CMD ["/usr/src/app/tests", "--continue-on-collection-errors", "--tb=short", "--disable-warnings"]
# Set default command arguments
CMD ["--continue-on-collection-errors", "--tb=short", "--disable-warnings"]
Loading…
Cancel
Save