From d2b85fb428a785b0fb761c613921843033d3b474 Mon Sep 17 00:00:00 2001 From: leehk Date: Sun, 13 Apr 2025 18:22:38 +0800 Subject: [PATCH] run on host directly --- .github/workflows/develop.yml | 7 +++++-- app/backend/Dockerfile.prod | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index db94157..460450a 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -114,12 +114,15 @@ jobs: -e TESTING=0 \ -p 8004:8765 \ --memory="4g" \ - --memory-swap="5g" \ + --memory-swap="8g" \ ${{ env.IMAGE }}:latest - name: Monitor memory usage run: free -h + - name: Run Pytest directly + run: | + cd ./app/backend/ && pipenv install && pipenv run python -m pytest --disable-warnings - name: Pytest - run: docker exec backend pipenv run python -m pytest tests --disable-warnings + run: docker exec backend pipenv run python -m pytest -v # - name: Flake8 # run: docker exec backend pipenv run python -m flake8 . # - name: Black diff --git a/app/backend/Dockerfile.prod b/app/backend/Dockerfile.prod index 3afcd31..7b88ab4 100644 --- a/app/backend/Dockerfile.prod +++ b/app/backend/Dockerfile.prod @@ -77,6 +77,8 @@ RUN chown -R app:app $APP_HOME # change to the app user USER app +# pytest +RUN pipenv run pytest --disable-warnings -v # run gunicorn CMD pipenv run gunicorn --bind 0.0.0.0:$PORT backend.main:app -k uvicorn.workers.UvicornWorker \ No newline at end of file